Global CurrentLevel = 1
Global MaxLevels = 5
 
Setup_Screen()
Gosub _InitialiseGlobals
Get_Textures()
 
For Level = 1 To CurrentLevel
Read_Maze()
Next Level
 
Create_Maze()
 
 
LastTime = Timer()
Do
	TimeLeft = TimeLeft - ((Timer()-LastTime)/1000)
	If TimeLeft < 0 Then Player_Death()
	If Object Collision(FinishObject, PlayerObject) = 1 Then Player_Win()
 
	Ink RGB(255,255,255),0	
	Set Text Size 12
	Text 0,0,"Lives: "+ str$(PlayerLives)
	Text 0,20,"Time Left: "+str$(TimeLeft)
 
	Handle_Bullets(1.5)
	Handle_Bombs(.1)
	Check_Wall_Collisions(2.0,0.25)
	Move_Camera(.25)
 
	LastTime = Timer()
	Sync
 
loop
 
 
Function Next_Level()
	Destroy_Level()
	Undim Cube(0) 
	Read_Maze()
	Create_Maze()		
endfunction
 
Function Restart_Level()
	Destroy_Level()
	Create_Maze()	
	TimeLeft = DefaultTime
endfunction
 
 
Function Destroy_Level()
	For z = 1 To MapHeight
		For x = 1 To MapWidth
			If Cube(x,z).Tile = 1 Then Delete Object Cube(x,z).Num
		next x
	next z
 
 
	While Array Count(Bullets(0))> 0
		Destroy_Bullet(1)		
	EndWhile
 
 
	PlayerAng = 0 
 
	`Bombs
 
	While Array Count(Bombs(0))<> 0
		Destroy_Bomb(1)		
	EndWhile
	BombCount = 120
 
	Delete Object FloorObject
	Delete Object CeilingObject	
	Delete Object FinishObject
 
Endfunction
 
Function Setup_Screen()
	sync on: sync rate 60
	autocam off	`:Position Camera 15,5,15
	Set ambient light 75
endfunction
 
 
_InitialiseGlobals:
	`Textures And miscellaneous objects:
	Global BrickImage As Integer
 
	Global BombRed As Integer
	Global BombGreen As Integer
 
	Global FloorObject As Integer
	Global FloorImage As Integer
 
	Global CeilingObject As Integer
	Global CeilingImage As Integer
 
	Global FinishImage As Integer
	Global FInishObject As Integer
 
	`All of the map variables
	Global MapWidth As Integer`: MapWidth = 10
	Global MapHeight As Integer`: MapHeight = 10
	Global Cubesize As Integer: CubeSize = 10
 
	Type Object
		X As Float: Y As Float: Z As Float
		num As Integer
		Tile As Integer
	endtype
 
	`Dim Cube(MapWidth,MapHeight) As Object
 
 
	`Bullets	
	Type Bullet
		X As Float: Y As Float: Z As Float
		SX As Float: SY As Float: SZ As Float
		num As Integer
	endtype
 
	Dim Bullets(0) As Bullet
 
	Global BulletTimeout As Integer
 
	`Stuff for moving the camera
	Dim WallExist(4)
 
	Global PlayerLives As Integer: PlayerLives = 3
	Global PlayerX As Float: Global PlayerY As Float: Global PlayerZ As Float
	Global PlayerAng As Float: PlayerAng = Camera angle Y()
 
	Global TimeLeft As Float: Global lastTime As Float
	Global DefaultTime As Float
 
	Global PlayerObject As Integer
	PlayerObject = Get_Free_Object_Number()
	Make Object Cube PlayerObject, 5
	Hide Object PlayerObject
 
	`Bombs
	Type Bomb
		X As Float: Y As Float: Z As FLoat
		Num As Integer
 
		Active As Integer
		Moving As Integer
		DestinationX As Float
		DestinationZ As Float
	Endtype 
 
	Dim Bombs(0) As Bomb
	Global BombCount As Integer: BombCount = 120
 
Return
 
_DimCube:
 
Dim Cube(MapWidth,MapHeight) As Object
Return
 
`-------------------------------------------------
`General Program Functions
`-------------------------------------------------
 
Function Get_Textures()
	BrickImage = Get_Free_Image_Number()
	BrickTexture(BrickImage)
 
	BombRed = Get_Free_Image_Number()
	BombTexture1(BombRed)
 
	BombGreen = Get_Free_Image_Number()
	BombTexture2(BombGreen)
 
	FloorImage = Get_Free_Image_Number()
	FloorTexture(FloorImage)
 
	CeilingImage = Get_Free_Image_Number()
	FloorTexture(CeilingImage)
 
	FinishImage = Get_Free_Image_Number()
	FinishTexture(FinishImage)
endfunction
 
 
Function Read_Maze()
	Sync
	Ink RGB(255,255,255),0
	Set Text Size 12
	cls 0
	Read NumLevelText
	For texts = 1 To NumLevelText
		Read LevelText$
		Print LevelText$	
	next texts
	Sync: Wait Key
 
	Read DefaultTime: TimeLeft = DefaultTime
 
	Read MapWidth
	Read MapHeight
 
	Gosub _DimCube
 
	For z = 1 To MapHeight
		For x = 1 To MapWidth
			Read Cube(x,z).Tile
			Cube(x,z).X = (x-1)*Cubesize+(Cubesize/2)
			Cube(x,z).Y = (Cubesize/2)
			Cube(x,z).Z = (z-1)*Cubesize+(Cubesize/2)
		next x
	next z
endfunction
 
 
 
Function Create_Maze()
	For z = 1 To MapHeight
		For x = 1 To MapWidth
			If Cube(x,z).Tile = 1 Then Make_Wall(x,z)
			If Cube(x,z).Tile = 2 Then RePositionCamera(Cube(x,z).X, Cube(x,z).Y, Cube(x,z).Z)
			If Cube(x,z).Tile = 3 Then Create_Bomb(0, Cube(x,z).X, Cube(x,z).Y, Cube(x,z).Z)
			If Cube(x,z).Tile = 4 Then Create_Bomb(1, Cube(x,z).X, Cube(x,z).Y, Cube(x,z).Z)
			If Cube(x,z).Tile = 10 Then Create_Finish(Cube(x,z).X, 2, Cube(x,z).Z)
		next x
	next z
 
	`Object that will represent the floor
	FloorObject = Get_Free_Object_Number()
	Make Object Plain FloorObject, MapWidth*Cubesize, MapHeight*CubeSize
	xrotate object FloorObject,90
	Position Object FloorObject, (MapWidth*Cubesize)/2,0,(MapHeight*CubeSize)/2
	Texture Object FloorObject, FloorImage
 
	`Object that will represent the ceiling
	CeilingObject = Get_Free_Object_Number()
	Make Object Plain CeilingObject, MapWidth*Cubesize, MapHeight*CubeSize
	xrotate object CeilingObject,90
	Position Object CeilingObject, (MapWidth*Cubesize)/2,Cubesize,(MapHeight*CubeSize)/2
	Texture Object CeilingObject,CeilingImage
EndFunction
 
Function Make_Wall(x,z)
	Cube(x,z).num = Get_Free_Object_Number()
	Make Object Cube Cube(x,z).num,Cubesize
	Texture Object Cube(x,z).num,BrickImage
	Position Object Cube(x,z).num, Cube(x,z).X, Cube(x,z).Y, Cube(x,z).Z
endfunction
 
 
 
`----------------------------------------------------
`Useful Code Snippets
`----------------------------------------------------
 
 
Function Get_Free_Object_Number()
	Remstart
	This function just finds a free object, and then returns its number.
	This is so that objects can be given variable names rather than numbers!
 
	***Special Thanks to Ric in the Darkbasic Pro forums who I stole this 
	function from.***
	Remend	
 
	Do
		inc ObjectNumber
	 	If Object Exist(ObjectNumber) = 0 Then Exit
	Loop
EndFunction ObjectNumber
 
 
Function Get_Free_Image_Number()
	Remstart
	This function just finds a free image, and then returns its number.
	This is so that images can be given variable names rather than numbers!
 
	***Special Thanks to Ric in the Darkbasic Pro forums who I stole this 
	function from.***
	Remend
 
	Do
		inc ImageNumber
		If Image Exist(ImageNumber) = 0 Then Exit
	loop
endfunction ImageNumber
 
`----------------------------------------------------------
`Textures
`----------------------------------------------------------
 
Function BrickTexture(ImageNumber)
 
Ink Rgb(128,64,0),0
Box 0,0,64,64
 
Ink Rgb(0,0,0),0
For a = 0 To 7
	Line 0,(a*8),64,(a*8)
next a
 
For x = 0 To 7
	For y = 0 To 7
		If (x+y) mod 2 = 0 Then Line (x*8),(y*8),(x*8),((y+1)*8)		
	next y
next x
 
Get Image Imagenumber, 0, 0, 64, 64
 
EndFunction
 
 
Function FloorTexture(ImageNumber)
	Ink RGB(50,50,50),0
	box 0,0,64,64
 
	Get Image Imagenumber, 0, 0, 64, 64
endfunction
 
Function BombTexture1(ImageNumber)
	Ink Rgb(200,50,50),0
	Box 1,1,64,64
 
	Get Image ImageNumber, 1, 1, 64, 64
endfunction
 
Function BombTexture2(ImageNumber)
	Ink Rgb(50,200,50),0
	Box 1,1,64,64
 
	Get Image ImageNumber, 1, 1, 64, 64	
endfunction
 
Function FinishTexture(ImageNumber)
	Ink RGB(255,255,0),0
	box 0,0,64,64
 
	Get Image Imagenumber, 0, 0, 64, 64
endfunction
 
`-------------------------------------------
`Movement and Collision Functions
`-------------------------------------------
 
 
Function Check_Wall_Collisions(Buffer#,Speed#)
	For direction = 1 To 4
		WallExist(direction) = 0
	next direction
 
	For z = 1 To MapHeight
		For x = 1 To MapWidth
			If Cube(x,z).Tile = 1
				If Abs((Cube(x,z).X-Buffer#-(Cubesize/2)-PlayerX)) < Speed#  And Abs((Cube(x,z).Z)-PlayerZ)-Buffer# < (Cubesize/2) Then WallExist(1) = 1
				If Abs((Cube(x,z).X+Buffer#+(Cubesize/2)-PlayerX)) < Speed#  And Abs((Cube(x,z).Z)-PlayerZ)-Buffer# < (Cubesize/2) Then WallExist(3) = 1
 
				If Abs((Cube(x,z).Z-Buffer#-(Cubesize/2)-PlayerZ)) < Speed#  And Abs((Cube(x,z).X)-PlayerX)-Buffer# < (Cubesize/2) Then WallExist(2) = 1
				If Abs((Cube(x,z).Z+Buffer#+(Cubesize/2)-PlayerZ)) < Speed#  And Abs((Cube(x,z).X)-PlayerX)-Buffer# < (Cubesize/2) Then WallExist(4) = 1	
			endif
		next x
	next z
 
endfunction
 
Function RepositionCamera(X#,Y#,Z#)
	Position Camera X#, Y#, Z#
	PlayerX = Camera Position X(): PlayerY = Camera Position Y(): PlayerZ = Camera Position Z()
endfunction
 
Function Move_Camera(Speed#)
 
	If Leftkey() = 1 Then PlayerAng = WrapValue(PlayerAng - Speed#*4.0)
	If RightKey() = 1 Then PlayerAng = WrapValue(PlayerAng + Speed#*4.0)
 
 
	If PlayerAng >= 0 AND PlayerAng <= 180
		If  WallExist(1) = 0 And Upkey() = 1 Then PlayerX = Newxvalue(PlayerX, PlayerAng, Speed#)
		If  WallExist(2) = 0 And ControlKey() = 1 Then PlayerZ = Newzvalue(PlayerZ, PlayerAng-90,speed#/2.0)
		If  WallExist(3) = 0 And Downkey() = 1 Then PlayerX = Newxvalue(PlayerX,PlayerAng,-Speed#)
		If  WallExist(4) = 0 And Keystate(82) = 1 Then PlayerZ = Newzvalue(PlayerZ, PlayerAng+90,speed#/2.0)
	Endif
 
	If PlayerAng >= 180 And PlayerAng <= 360
		If  WallExist(1) = 0 And Downkey() = 1 Then PlayerX = Newxvalue(PlayerX,PlayerAng,-Speed#)
		If  WallExist(2) = 0 And Keystate(82) = 1 Then PlayerZ = Newzvalue(PlayerZ, PlayerAng+90,speed#/2.0)
		If  WallExist(3) = 0 And Upkey() = 1 Then PlayerX = Newxvalue(PlayerX, PlayerAng, Speed#)	
		If  WallExist(4) = 0 And ControlKey() = 1 Then PlayerZ = Newzvalue(PlayerZ, PlayerAng-90,speed#/2.0)
	Endif
 
	If PlayerAng >= 270 Or PlayerAng <= 90
		If  WallExist(3) = 0 And ControlKey() = 1 Then PlayerX = Newxvalue(Playerx, PlayerAng-90,speed#/2.0)
		If  WallExist(2) = 0 And Upkey() = 1 Then PlayerZ = Newzvalue(PlayerZ, PlayerAng, Speed#)
		If  WallExist(1) = 0 And Keystate(82) = 1 Then PlayerX = Newxvalue(Playerx, PlayerAng+90,speed#/2.0)
		If  WallExist(4) = 0 And Downkey() = 1 Then PlayerZ = Newzvalue(PlayerZ,PlayerAng,-Speed#)			
	Endif		
 
	If PlayerAng >= 90 And PlayerAng <= 270
		If  WallExist(4) = 0 And Upkey() = 1 Then PlayerZ = Newzvalue(PlayerZ, PlayerAng, Speed#)
		If  WallExist(1) = 0 And ControlKey() = 1 Then PlayerX = Newxvalue(Playerx, PlayerAng-90,speed#/2.0)
		If  WallExist(2) = 0 And Downkey() = 1 Then PlayerZ = Newzvalue(PlayerZ,PlayerAng,-Speed#)			
		If  WallExist(3) = 0 And Keystate(82) = 1 Then PlayerX = Newxvalue(Playerx, PlayerAng+90,speed#/2.0)
	Endif		
 
 
 
	Position Camera PlayerX, PlayerY, PlayerZ
	Yrotate Camera PlayerAng
 
	Position Object PlayerObject, PlayerX, PlayerY, PlayerZ
endfunction
 
 
`----------------------------------------------------------
`Bullet Functions
`----------------------------------------------------------
 
 
Function Make_bullet(Speed#)
	If Array Count(Bullets(0)) = 100 Then Destroy_Bullet(1)
 
	Add To Queue Bullets(0)
	BNum = Array Count(Bullets(0))
 
	Pick Screen MouseX(),MouseY(), Speed#
	Bullets(BNum).SX = Get Pick Vector X()
	Bullets(BNum).SY = Get Pick Vector Y()
	Bullets(BNum).SZ = Get Pick Vector Z()
 
	Bullets(BNum).X = Camera Position X()+Bullets(BNum).SX*2
	Bullets(BNum).Y = Camera Position Y()+Bullets(BNum).SY*2
	Bullets(BNum).Z = Camera Position Z()+Bullets(BNum).SZ*2
 
	Bullets(BNum).Num = Get_Free_Object_Number()
	Make Object Sphere Bullets(BNum).Num,1
	Position Object Bullets(BNum).Num,Bullets(BNum).X, Bullets(BNum).Y, Bullets(BNum).Z
 
endfunction
 
Function Move_Bullets()
	For tb = 1 To Array Count(Bullets(0))
		Bullets(tb).X = Bullets(tb).X + Bullets(tb).SX
		Bullets(tb).Y = Bullets(tb).Y + Bullets(tb).SY
		Bullets(tb).Z = Bullets(tb).Z + Bullets(tb).SZ
 
		Position Object Bullets(tb).Num,Bullets(tb).X, Bullets(tb).Y, Bullets(tb).Z
	next tb
 
endfunction
 
 
Function Destroy_Bullet(BNum)
	Delete Object Bullets(BNum).Num
	Array Delete Element Bullets(0),BNum
endfunction
 
 
Function Handle_Bullets(Speed#)
	If MouseClick() = 1 And BulletTimeout < 1
		Make_Bullet(Speed#)
		BulletTimeout = 30
	Endif
	If BulletTimeOut > 0 Then Dec BulletTimeout,1
 
	Move_Bullets() 
 
	`Check if a bullet collides with a wall or a bomb
	For tb = 1 To Array Count(Bullets(0))
		If Object Position Y(Bullets(tb).Num) > CubeSize Or Object Position Y(Bullets(tb).Num) < 0 
			Destroy_Bullet(tb)
			tb = tb - 1: If tb = 0 Then tb = 1: If tb > Array Count(Bullets(0)) Then Goto _HBExitLoop
		endif
 
		For z = 1 To MapHeight
			For x = 1 To MapWidth
				If Cube(x,z).Tile = 1
					If Object Collision(Bullets(tb).Num, Cube(x,z).num) = 1
						 Destroy_Bullet(tb)
						 tb = tb - 1: If tb = 0 Then tb = 1: If tb > Array Count(Bullets(0)) Then Goto _HBExitLoop
					Endif
				Endif
			next x
		next z
 
		For BNum = 1 To Array Count(Bombs())
			If Object Collision(Bullets(tb).Num,Bombs(BNum).Num) = 1
				If Bombs(Bnum).Active = 1 Then Player_Death(): ExitFunction
				If Bombs(Bnum).Active = 2 Then Destroy_Bomb(BNum)
				Destroy_Bullet(tb)
				tb = tb - 1: If tb = 0 Then tb = 1: If tb > Array Count(Bullets(0)) Then Goto _HBExitLoop
			endif
		next bnum		
 
		_HBExitLoop:
 
 
	next tb
Endfunction
 
`------------------------------------------
`Bomb Functions
`------------------------------------------
 
Function Create_Bomb(Moving, X#, Y#, Z#)
	Add to queue Bombs(0)
	BNum = Array Count(Bombs(0))
	Bombs(BNum).X = X#
	Bombs(BNum).Y = Y#
	Bombs(BNum).Z = Z#
	Bombs(BNum).Num = Get_Free_Object_Number()
	Bombs(BNum).Active = RND(1)+1
	Bombs(BNum).Moving = Moving
	Bombs(BNum).DestinationX = X#
	Bombs(BNum).DestinationZ = Z#
 
	Make Object Sphere Bombs(BNum).Num,5
 
	If Bombs(BNum).Active = 1 Then Texture Object Bombs(BNum).Num, BombRed
	If Bombs(BNum).Active = 2 Then Texture Object Bombs(BNum).Num, BombGreen
 
	Position Object Bombs(BNum).Num, Bombs(BNum).X, Bombs(BNum).Y, Bombs(BNum).Z
endfunction
 
 
Function Change_Bomb_States()
	For b = 1 To Array Count(Bombs(0))
		If RND(2) = 2 Then Bombs(b).Active = 2: Texture Object Bombs(b).Num, BombGreen
		If RND(2) = 1 Then Bombs(b).Active = 1: Texture Object Bombs(b).Num, BombRed
	next b
endfunction
 
 
Function Destroy_Bomb(BNum)
	Delete Object Bombs(BNum).Num
	Array Delete Element Bombs(0), BNum
endfunction
 
Function Handle_Bombs(Speed#)
	If BombCount < 0
		BombCount = 120
		Change_Bomb_States()
	Else
		dec BombCount,1
	Endif
 
	For BNum = 1 TO Array Count(Bombs(0))
		If Object Collision(PlayerObject, Bombs(BNum).Num) = 1 Then Player_Death(): ExitFunction
 
		If Bombs(BNum).Moving = 1 
			If abs(Bombs(BNum).X-Bombs(BNum).DestinationX) < Speed# And abs(Bombs(BNum).Z-Bombs(BNum).DestinationZ) < Speed# Then ChooseBombDestination(BNum, Speed#)
 
			If Bombs(BNum).X > Bombs(BNum).DestinationX  Then Dec Bombs(BNum).X, Speed#
			If Bombs(BNum).X < Bombs(BNum).DestinationX Then Inc Bombs(BNum).X, Speed#
			If Bombs(BNum).Z > Bombs(BNum).DestinationZ  Then Dec Bombs(BNum).Z, Speed#
			If Bombs(BNum).Z < Bombs(BNum).DestinationZ Then Inc Bombs(BNum).Z, Speed#
 
			Position Object Bombs(BNum).num, Bombs(BNum).X, Bombs(BNum).Y, Bombs(BNum).Z
		endif
 
	next bnum
 
endfunction
 
 
Function ChooseBombDestination(Bomb, Speed#)
	BombSquareX = int(Bombs(Bomb).X/Cubesize) + 1
	BombSquareZ = int(Bombs(Bomb).Z/Cubesize) + 1
 
	Repeat 
		Direction = RND(4)
		If Direction = 1 And Cube(BombSquareX-1, BombSquareZ).Tile <> 1 Then Dec Bombs(Bomb).DestinationX, 10
		If Direction = 2 And Cube(BombSquareX, BombSquareZ+1).Tile <> 1 Then Inc Bombs(Bomb).DestinationZ, 10
		If Direction = 3 And Cube(BombSquareX+1, BombSquareZ).Tile <> 1 Then Inc Bombs(Bomb).DestinationX, 10
		If Direction = 4 And Cube(BombSquareX, BombSquareZ-1).Tile <> 1 Then Dec Bombs(Bomb).DestinationZ, 10
	until abs(Bombs(Bomb).X-Bombs(Bomb).DestinationX) > Speed# Or abs(Bombs(Bomb).Z-Bombs(Bomb).DestinationZ) > Speed# 
endfunction
 
`-------------------------------------------
`End Game Functions
`-------------------------------------------
 
 
Function Create_Finish(X#,Y#,Z#)
	FinishObject = Get_Free_Object_Number()
 
	Make Object Cube FinishObject, 4
	Position Object FinishObject, X#, Y#, Z#
	Texture Object FinishObject, FinishImage
endfunction
 
Function Player_Death()
	Cls RGB(255,0,0)
 
	Ink 0,0
	Set Text Size 50
	Center Text Screen Width()/2,(Screen Height()-50)/2,"KABOOOM!!!"
	Sync
	Wait Key
 
	Dec PlayerLives, 1
	If PlayerLives < 1 Then End	
 
	Restart_Level()
 
	`End	
endfunction
 
Function Player_Win()
	Inc CurrentLevel, 1
	If CurrentLevel > MaxLevels 
		Ink RGB(255,0,0),0
		Set Text Size 40
		Text 0,0,"CONGRATULATIONS!!!"
		Text 0,50,"You have completed all of the levels!!!"
		Sync
		Wait Key
		End
	endif
	Ink RGB(255,0,0),0
	Set Text Size 40
	Text 0,0,"Bomb Defused."
	Sync: Wait Key
 
	Next_Level()
 
endfunction
 
`Level 1
 
Data 21
Data "Training Level 1"
Data " "
Data "Greetings new recruit! I'm your commander, Mr. TinkleToes."
Data "To complete your training,  You just have 2 more tests to do."
Data " "
Data "Here is your first test: See if you can diffuse a bomb."
Data "The bomb will be yellow. If you are able to get to it, you should"
Data "be able to diffuse it easily with the techniques you have already"
Data "learned. Take this seriously, because a bomb such as this could"
Data "destroy a city the size of London in the real world."
Data " "
Data "However, there is one small problem. A minor bomb is blocking your"
Data "way. This bomb will explode on impact. However, if it is green and you"
Data "use your specially formulated bomb destroying gun, you should be able"
Data "to destroy it. But if it is red, then the gun will not work, and you will"
Data "need to wait."
Data " "
Data "And another thing: The major yellow bomb will blow up in 20 seconds, so"
Data "It would be a good idea to diffuse it before then!"
Data " "
Data "Press any key to continue."
 
Data 20.0
Data 3,5
Data 1, 1, 1
Data 1, 2, 1
Data 1, 3, 1
Data 1,10, 1
Data 1, 1, 1
 
 
`Level 2
Data 9
Data "Training Level 2"
Data " "
Data "Congratulations on successfully completing the first training level."
Data " "
Data "It is now time for you to try something a little harder. In this training"
Data "level you will need to diffuse another bomb. This time, it is blocked"
Data "by a more advanced minor bomb that moves. Other than that, though,"
Data "everything about it should be the same. Just don't let it touch you, because"
Data "like all minor bombs it explodes on impact."
 
Data 20.0
Data 7, 7
Data 1, 1, 1, 1, 1, 1, 1
Data 1, 0, 0, 2, 0, 0, 1
Data 1, 0, 0, 0, 0, 0, 1
Data 1, 0, 0, 0, 0, 0, 1
Data 1, 0, 0, 4, 0, 0, 1
Data 1, 0, 0,10, 0, 0, 1
Data 1, 1, 1, 1, 1, 1, 1
 
 
`Level 3
Data 14
Data "Congratulations! You have completed all of the training levels!"
Data "You are now an official member of: The Super Cool and Extraordinary"
Data "Group of Super Heroes and Secret Agents who Protect Planet Earth from"
Data "Aliens, Evil Geniuses and Baddies. Or TSCAEGOSHAWPPEFAEGAB for short."
Data ""
Data "Anyways, we have just learned that Dr EvilPants has just planted a bomb"
Data "under New York city. Being an evil genius, he decided to put this bomb"
Data "inside a labyrinth. Our sensors have detected that there are no minor"
Data "bombs in this labyrinth, so you don't have to use your cool gun thingy,"
Data "but you will have to use your wits and labyrinth figuring out intellect"
Data "to find the bomb!"
Data ""
Data "Good Luck! Our scanners have also predicted that the bomb will blow up"
Data "in 2 minutes."
 
 
Data 120.0
Data 20,20
Data 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Data 1, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
Data 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1
Data 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1
Data 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1
Data 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1
Data 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1
Data 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1
Data 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1
Data 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1
Data 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1
Data 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1
Data 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1
Data 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1
Data 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1
Data 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1
Data 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1
Data 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Data 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,10, 0
Data 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
 
 
 
 
 
`Level 4
Data 16
Data "Good job. You have successfully saved New York from destruction."
Data ""
Data "Well, now that we have a bit of spare time, let me tell you of the"
Data "secret sign of the TSCAEGOSHAWPPEFAEGAB. First, you need to turn"
Data "your head to the right, stick your tongue out, try to bite your ear,"
Data "while sing Marry Had A Little Lamb and karate chopping yourself in your"
Data "left arm using your right hand. Got it? Then it's time for your next"
Data "assignment!"
Data ""
Data "It looks like a group of aliens from the W.E.I.R.D. system have landed,"
Data "and are trying to blow up Tokyo. Don't ask why they want to. They just do."
Data "Anyways, these aliens are not very creative, but have a lot of firepower,"
Data "so you'll have to face a lot of bombs, but not a lot of walls. "
Data ""
Data "Oh, and these aliens use the metric system for bomb timers, so they count"
Data "in units of 100 seconds, not 60."
 
Data 100.0
Data 10,10
 
Data 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Data 1, 2, 0, 4, 3, 0, 4, 0, 0, 1
Data 1, 0, 0, 0, 1, 1, 1, 1, 3, 1
Data 1, 0, 0, 0, 1, 0, 0, 0, 0, 1
Data 1, 4, 0, 4, 1, 0, 0, 0, 0, 1
Data 1, 3, 1, 1, 1, 0, 0, 0, 0, 1
Data 1, 0, 1, 0, 0, 0, 4, 4, 4, 1
Data 1, 4, 1, 0, 0, 0, 4, 3, 3, 1
Data 1, 0, 3, 0, 0, 0, 4, 3,10, 1
Data 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
 
`Level 5
Data 7
Data "Thanks to your good work, the aliens have gotten frustrated, and left to"
Data "attempt to blow up Pluto instead. "
Data ""
Data "It's now time for your hardest challenge yet. Dr. EvilPants has created"
Data "another labyrinth (this time packed with bombs) and is again threatening"
Data "to blow up New York. Stretch well, because you will have to do this in"
Data "under 5 minutes..."
 
 
Data 300.0
Data 20,20
Data 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Data 1, 4, 0, 3, 0, 2, 0, 3, 0, 0, 1, 0, 3, 0, 0, 0, 0, 0, 0, 1
Data 1, 0, 0, 0, 1, 0, 1, 0, 4, 0, 1, 0, 1, 0, 4, 0, 4, 0, 0, 1
Data 1, 0, 0, 0, 1, 0, 1, 0, 4, 0, 1, 0, 1, 0, 4, 0, 4, 0, 0, 1
Data 1, 0, 0, 4, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1
Data 1, 0, 1, 1, 1, 3, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1
Data 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1
Data 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 4, 0, 1
Data 1, 0, 0, 0, 0, 0, 1, 3, 0, 4, 0, 4, 0, 1, 1, 1, 0, 4, 0, 1
Data 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1
Data 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1
Data 1, 4, 0, 1, 0, 4, 0, 0, 0, 1, 0, 4, 0, 0, 0, 0, 0, 1, 0, 1
Data 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1
Data 1, 0, 4, 3, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1
Data 1, 0, 4, 3, 0, 0, 1, 4, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1
Data 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 4, 0, 1, 1, 1, 3, 1, 1, 1
Data 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 4, 4, 4, 0, 1
Data 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 4, 3, 4, 0, 1
Data 1, 0, 4, 1, 0, 0, 4, 0, 0, 0, 0, 4, 0, 1, 0, 3,10, 3, 0, 1
Data 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1