Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Graphics3D 640, 480
- SetBuffer BackBuffer()
- ;Creating the types
- type_player=1
- type_powerup=2
- ;player
- player = CreateCube()
- PositionEntity player, 10, 0, 0
- EntityType player, type_player
- ;camera
- camera = CreateCamera(player)
- PositionEntity camera, 0 , 15, 2
- RotateEntity camera, 70, 0, 0
- ;light
- light = CreateLight()
- ;ground
- ground1 = CreateTerrain(128)
- PositionEntity ground1, 0 , -.5, 0
- gtex = LoadTexture("123image.jpg")
- EntityTexture ground1, gtex
- ;Creating the bullets
- maxbull = 100
- Dim bullet(maxbull)
- For i=0 To maxbull
- bullet(i)=LoadMesh ("bullet.3ds")
- EntityColor bullet(i), 100,100,100
- EntityType bullet(i), type_bullet
- Next
- ;powerup
- pu1= CreateSphere()
- PositionEntity pu1, 20, 0, 10
- EntityColor pu1, 150, 0, 0
- EntityType pu1, type_powerup
- EntityRadius pu1, 1
- ;collisions
- Collisions type_player, type_powerup,2,2
- ;make it run
- While Not KeyDown(1)
- If KeyDown(200) = True Then TranslateEntity player,0,0,.05
- If KeyDown(208) = True Then TranslateEntity player,0,0,-.05
- If KeyDown(205) = True Then TranslateEntity player,0.05,0,0
- If KeyDown(203) = True Then TranslateEntity player,-0.05,0,0
- ;---------MainProgram--------------------------------------------------------
- ;Firing bullets
- If KeyHit (SPACE_BAR) And reload = 0
- PositionEntity bullet(t) ,EntityX(gun,1),EntityY(gun,1),EntityZ(gun,1)
- RotateEntity bullet(t),EntityPitch#(gun,1)-35,EntityYaw#(gun,1),EntityRoll#(gun,1)
- EntityColor bullet(t),0,0,255
- t=t+1
- EndIf
- For q = 0 To maxbull
- MoveEntity bullet(q), 0,0.8,3
- EndIf
- Next
- bulletcount=100-t
- If t=100 Then
- reload=1
- EndIf
- If KeyDown (R_KEY) = True Then
- t=0
- reload=0
- EndIf
- If CountCollisions(player) = True Then HideEntity pu1
- UpdateWorld
- RenderWorld
- Text 0,0, "use cursor keys to move"
- Flip
- Wend
- End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement