

tag @e remove currentcorner
scoreboard players set game levelstarted 0
execute as @e[tag=corner] if score @s level = game level run tag @s add currentcorner
tag @e remove currentspawn
execute as @e[tag=levelspawn] if score @s level = game level run tag @s add currentspawn
tp @e[name=marker] @e[tag=currentspawn,limit=1]
scoreboard players set game dimension 0

scoreboard players set red keyused 0
scoreboard players set orange keyused 0
scoreboard players set yellow keyused 0
scoreboard players set green keyused 0
scoreboard players set cyan keyused 0
scoreboard players set blue keyused 0
scoreboard players set purple keyused 0
scoreboard players set magenta keyused 0

effect give @p resistance 1000000 250 true
effect give @p saturation 1000000 250 true

kill @e[name=checkpoint]

scoreboard players set game gameactive 1

function game:drawmaster
fill 1017 31 26 1000 48 9 black_concrete_powder replace diamond_block
scoreboard players set game levelstarted 1

gamemode adventure @a

title @a times 20 40 20

execute if score game level matches 1 run title @a title ["",{"text":"Level 1","color":"green","bold":true}]
execute if score game level matches 1 run title @a subtitle ["",{"text":"4 Dimensions","color":"white","bold":false}]

execute if score game level matches 2 run title @a title ["",{"text":"Level 2","color":"gold","bold":true}]
execute if score game level matches 2 run title @a subtitle ["",{"text":"Stairway to a new world","color":"white","bold":false}]

execute if score game level matches 3 run title @a title ["",{"text":"Level 3","color":"aqua","bold":true}]
execute if score game level matches 3 run title @a subtitle ["",{"text":"Hypercrystal Caves","color":"white","bold":false}]

execute if score game level matches 4 run title @a title ["",{"text":"Level 4","color":"light_purple","bold":true}]
execute if score game level matches 4 run title @a subtitle ["",{"text":"Endercube","color":"white","bold":false}]

execute if score game level matches 5 run title @a title ["",{"text":"Level 5","color":"white","bold":true}]
execute if score game level matches 5 run title @a subtitle ["",{"text":"Dimensional Frost","color":"white","bold":false}]

execute if score game level matches 6 run title @a title ["",{"text":"Level 6","color":"yellow","bold":true}]
execute if score game level matches 6 run title @a subtitle ["",{"text":"Teleportation","color":"white","bold":false}]

execute if score game level matches 7 run title @a title ["",{"text":"Level 7","color":"blue","bold":true}]
execute if score game level matches 7 run title @a subtitle ["",{"text":"The Final Stage","color":"white","bold":false}]

