maze

Blitz3D Forums/Blitz3D Beginners Area/maze

I got it to work!
Here it is:

Include "start.bb"

Const TYPE_MAZE=10,TYPE_B=10,t1=10

Collisions 2,1,2,2

cam=CreateCamera()
CameraRange cam,0.1,45000
PositionEntity cam,7,5,8
EntityType cam,2

maze=LoadMesh("maze2.x")
ScaleEntity maze,1.5,1.1,1.5
EntityType maze,type_maze

finish=CreateCube()
PositionEntity finish,15,5,-77
ScaleEntity finish,5,5,5
EntityAlpha finish,0
EntityType finish,1

b=LoadMesh("b1.x")
ScaleEntity b,1.5,1.1,1.5
EntityAlpha b,0
PositionEntity b,-2,-1,0
EntityType b,type_b

water=LoadMesh("water1.x")
PositionEntity water,-1.5,-1.5,0
EntityAlpha water,0.5
ScaleEntity water,1.5,1.1,1.5

sky=CreateSphere()
ScaleEntity sky,-1000,-1000,-1000
EntityColor sky,20,10,30

l=CreateLight()
LightRange l,45
TurnEntity l,45,45,0
LightColor l,90,90,90

While Not KeyHit(1)

If EntityCollided(cam,1)

EntityAlpha maze,0
EntityAlpha water,0

blank=CopyEntity(maze)
EntityColor blank,0,0,0

Print "You Win!"
Delay 1000

MoveEntity cam,0,-100000000,0

EntityType cam,3

Delay 1000

End

EndIf

If Not EntityCollided(cam,1)

Collisions 2,TYPE_MAZE,2,2
Collisions 2,TYPE_B,2,2

MoveEntity cam,0,-0.1,0

If KeyDown(200)
MoveEntity cam,0,0,0.2
EndIf

If KeyDown(208)
MoveEntity cam,0,0,-0.2
EndIf

If KeyHit(203)
TurnEntity cam,0,45,0
EndIf

If KeyHit(205)
TurnEntity cam,0,-45,0
EndIf
EndIf


UpdateWorld
RenderWorld
Flip
Wend
End


Have fun! Thanks for the help!
-me