What about something like this? Press keys 1 to 6.
Type CUBE
Field ent,x#,y#,z#
End Type
;setup scene
Graphics3D 640,480,0,2
SetBuffer BackBuffer()
camera=CreateCamera()
PositionEntity camera,0,20,0
light=CreateLight()
RotateEntity light,90,0,0
For id=1 To 7
temp.CUBE=New CUBE
temp\ent=CreateCube()
temp\x#=Rand(-20,20)
temp\z#=Rand(-20,20)
PositionEntity temp\ent,temp\x#,EntityY(temp\ent),temp\z#
Next
player.CUBE=Last cube
player\x#=0
player\z#=0
PositionEntity player\ent,player\x#,EntityY(player\ent),player\z#
;main
While Not KeyDown(1)
do=0
If KeyDown(2) Then do=1
If KeyDown(3) Then do=2
If KeyDown(4) Then do=3
If KeyDown(5) Then do=4
If KeyDown(6) Then do=5
If KeyDown(7) Then do=6
PointEntity camera,player\ent
If do=1
temp.CUBE=First cube
PointEntity player\ent,temp\ent
MoveEntity player\ent,0,0,0.1
ElseIf do=2
temp.CUBE=First cube
temp.CUBE=After temp
PointEntity player\ent,temp\ent
MoveEntity player\ent,0,0,0.1
ElseIf do=3
temp.CUBE=First cube
For id=1 To 2 : temp.CUBE=After temp : Next
PointEntity player\ent,temp\ent
MoveEntity player\ent,0,0,0.1
ElseIf do=4
temp.CUBE=First cube
For id=1 To 3 : temp.CUBE=After temp : Next
PointEntity player\ent,temp\ent
MoveEntity player\ent,0,0,0.1
ElseIf do=5
temp.CUBE=First cube
For id=1 To 4 : temp.CUBE=After temp : Next
PointEntity player\ent,temp\ent
MoveEntity player\ent,0,0,0.1
ElseIf do=6
temp.CUBE=First cube
For id=1 To 5 : temp.CUBE=After temp : Next
PointEntity player\ent,temp\ent
MoveEntity player\ent,0,0,0.1
EndIf
RenderWorld
Flip
Wend
|