home *** CD-ROM | disk | FTP | other *** search
- ;demo11-01.bb - Collisions
- ; ------------------
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
- Const ESC_KEY = 1
- Const LEFT_KEY = 203
- Const RIGHT_KEY = 205
- Const UP_KEY = 200
- Const DOWN_KEY = 208
-
- camera=CreateCamera()
- ; Creating a light
- light=CreateLight()
- ; Creating a sphere
- sphere=CreateSphere()
- ScaleEntity sphere, 0.5,0.5,0.5
- PositionEntity sphere, -3,0,5
- ; Creating a cone
- cone=CreateCone()
- PositionEntity cone, 1,0,5
- ScaleEntity cone, 1.5,1.5,1.5
- ; This following code makes our program run
- While Not KeyDown(ESC_KEY)
- x#=0
- y#=0
- z#=0
- If KeyDown(LEFT_KEY)=True Then x#=-0.1
- If KeyDown(RIGHT_KEY)=True Then x#=0.1
- If KeyDown(DOWN_KEY)=True Then y#=-0.1
- If KeyDown(UP_KEY)=True Then y#=0.1
- MoveEntity sphere,x#,y#,z#
- RenderWorld
- Flip
- Wend
- End