Advertisement
Guest User

Untitled

a guest
Apr 1st, 2016
317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;Creating the bullets
  2.      maxbull = 100
  3.      Dim bullet(maxbull)
  4.           For i=0 To maxbull
  5.            bullet(i)=LoadMesh ("bullet.3ds")
  6.                EntityColor bullet(i), 100,100,100
  7.                EntityType bullet(i), type_bullet
  8.           Next
  9.  
  10. ;---------MainProgram--------------------------------------------------------
  11.  
  12. ;Firing bullets
  13.     If KeyHit (SPACE_BAR) And reload = 0
  14.           PlaySound phaser
  15.          PositionEntity bullet(t) ,EntityX(gun,1),EntityY(gun,1),EntityZ(gun,1)
  16.          RotateEntity bullet(t),EntityPitch#(gun,1)-35,EntityYaw#(gun,1),EntityRoll#(gun,1)
  17.          EntityColor bullet(t),0,0,255
  18.     t=t+1
  19.     EndIf
  20.     For q = 0 To maxbull
  21.          MoveEntity bullet(q), 0,0.8,3
  22.     If CountCollisions (bullet(q))
  23.             crash=CollisionEntity (bullet(q),1)
  24.             HideEntity crash
  25.         score#=score#+1
  26.         PlaySound explosion
  27.       EndIf
  28.     Next
  29.     bulletcount=100-t
  30.         If t=100 Then
  31.          reload=1
  32.         EndIf
  33.         If KeyDown (R_KEY) = True Then
  34.          t=0
  35.          reload=0
  36.     EndIf
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement