daily pastebin goal
40%
SHARE
TWEET

team 2 project

ManuelSouza75 Apr 1st, 2016 264 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Graphics3D 640, 480
  2. SetBuffer BackBuffer()
  3.  
  4. ;Creating the types
  5. type_player=1
  6. type_powerup=2
  7.  
  8.  
  9. ;player
  10. player = CreateCube()
  11. PositionEntity player, 10, 0, 0
  12. EntityType player, type_player
  13.  
  14.  
  15. ;camera
  16. camera = CreateCamera(player)
  17. PositionEntity camera, 0 , 15, 2
  18. RotateEntity camera, 70, 0, 0
  19.  
  20. ;light
  21. light = CreateLight()
  22.  
  23. ;ground
  24. ground1 = CreateTerrain(128)
  25. PositionEntity ground1, 0 , -.5, 0
  26. gtex = LoadTexture("123image.jpg")
  27. EntityTexture ground1, gtex
  28.  
  29. ;Creating the bullets
  30.      
  31. maxbull = 100
  32.      Dim bullet(maxbull)
  33.           For i=0 To maxbull
  34.            bullet(i)=LoadMesh ("bullet.3ds")
  35.                EntityColor bullet(i), 100,100,100
  36.                EntityType bullet(i), type_bullet
  37.           Next
  38.  
  39.  
  40. ;powerup
  41. pu1= CreateSphere()
  42. PositionEntity pu1, 20, 0, 10
  43. EntityColor pu1, 150, 0, 0
  44. EntityType pu1, type_powerup
  45. EntityRadius pu1, 1
  46.  
  47.  
  48. ;collisions
  49. Collisions type_player, type_powerup,2,2
  50.  
  51. ;make it run
  52. While Not KeyDown(1)
  53.  
  54. If KeyDown(200) = True Then TranslateEntity player,0,0,.05
  55. If KeyDown(208) = True Then TranslateEntity player,0,0,-.05
  56. If KeyDown(205) = True Then TranslateEntity player,0.05,0,0
  57. If KeyDown(203) = True Then TranslateEntity player,-0.05,0,0
  58.  
  59. ;---------MainProgram--------------------------------------------------------
  60.  ;Firing bullets
  61.  If KeyHit (SPACE_BAR) And reload = 0
  62.          PositionEntity bullet(t) ,EntityX(gun,1),EntityY(gun,1),EntityZ(gun,1)
  63.          RotateEntity bullet(t),EntityPitch#(gun,1)-35,EntityYaw#(gun,1),EntityRoll#(gun,1)
  64.          EntityColor bullet(t),0,0,255
  65.     t=t+1
  66.  EndIf
  67.     For q = 0 To maxbull
  68.         MoveEntity bullet(q), 0,0.8,3
  69.  EndIf
  70.     Next
  71.     bulletcount=100-t
  72.         If t=100 Then
  73.          reload=1
  74.         EndIf
  75.         If KeyDown (R_KEY) = True Then
  76.          t=0
  77.          reload=0
  78.  EndIf
  79.  
  80.  
  81.  
  82. If CountCollisions(player) = True Then HideEntity pu1
  83.  
  84.  
  85. UpdateWorld
  86.  
  87. RenderWorld
  88.  
  89. Text 0,0, "use cursor keys to move"
  90.  
  91. Flip
  92.  
  93. Wend
  94.  
  95. End
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top