home *** CD-ROM | disk | FTP | other *** search
- ;demo13-09.bb - bullet
- ;______
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
-
- Const ESC_KEY = 1
- Const UP_KEY = 200
- Const DOWN_KEY = 208
- Const LEFT_KEY = 203
- Const RIGHT_KEY = 205
- Const SPACE_BAR = 57
- Const R_KEY = 19
- ; Create camera
- camera=CreateCamera()
-
- ;Create light
- light=CreateLight()
-
- ; Creating the background
-
- background=CreateSphere(32)
- ScaleEntity background, 200,200,200
- FlipMesh background
- EntityColor background, 255,214,100
-
- ;Creating the gun
-
- gun=CreateCylinder(12)
- ScaleEntity gun,0.2,0.6,0.4
- RotateEntity gun,45,0,0
- PositionEntity gun, EntityX(camera),EntityY(camera)-2, EntityZ(camera)+3
- EntityOrder gun, -1
- EntityParent gun,camera
- EntityColor gun, 100,100,100
- maxbull=100
-
-
- While Not KeyDown(ESC_KEY)
-
- ;Camera Controls
-
- If KeyDown(UP_KEY)= True Then cz#=cz#+.01
- If KeyDown (DOWN_KEY)= True Then cz#=cz#-.01
- If KeyDown(RIGHT_KEY)= True Then rx#=rx#-1
- If KeyDown (LEFT_KEY)= True Then rx#=rx#+1
-
-
- ;Control camera turning radius
-
- If rx# > 180 Then rx#=-180
- If rx# < -180 Then rx# = 180
-
-
- MoveEntity camera, 0,cy#,cz#
- RotateEntity camera, 0,rx#,0
-
-
- RenderWorld
-
- Flip
-
- Wend
- End