home *** CD-ROM | disk | FTP | other *** search
- ;demo13-03.bb - Velocity
- ;_______________
-
-
- camdistance=10
-
- Graphics3D 640,480
- SetBuffer BackBuffer()
-
-
- ;Key Constants
- Const ESC_KEY = 1
- Const UP_KEY = 200
- Const DOWN_KEY = 208
- Const S_KEY = 31
-
-
- ; Creating the types
-
- type_player=1
- type_ground=2
-
-
- ; Create camera
- camera=CreateCamera(pivot)
- PositionEntity camera, 15,7,0
- RotateEntity camera, 30,0,0
-
-
- ; Creating a light
-
- light=CreateLight()
-
- ; Creating a terrain
-
- terrain=CreateTerrain(512)
- EntityColor terrain, 125,136,32
- PositionEntity terrain, -300,-1,-100
- EntityType terrain,type_ground
-
- ; Creating the sky
-
- sky=CreateSphere(32)
- ScaleEntity sky, 100,100,100
- EntityColor sky, 102,153,255
- FlipMesh sky
-
-
- ; Creating a sphere
-
- sphere=CreateSphere(64)
- PositionEntity sphere, 15,3,9
- EntityType sphere,type_player
- ScaleEntity sphere ,0.4,0.4,0.2
- EntityRadius sphere, 0.5
- Texture=CreateTexture(16,16): SetBuffer TextureBuffer(texture)
- ClsColor 12,35,36
- Cls
- Color 123,256,256
- Rect 0,0,8,8,1
- Rect 8,8,8,8,1
- ScaleTexture Texture,.2,.2
- EntityTexture sphere,texture
-
- ;Creating a pivot
-
- pivot=CreatePivot(sphere)
- MoveEntity pivot, 0,0,-camdistance
-
-
- ; This following code makes our program run
-
- While Not KeyDown(ESC_KEY)
- TranslateEntity sphere, 0,-0.03,0
- Collisions type_player,type_ground,2,2
- Collisions type_ground,type_player,2,2
-
-
- UpdateWorld
- RenderWorld
- Flip
- Wend
-
- End