-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRocketGun.py
More file actions
31 lines (27 loc) · 812 Bytes
/
RocketGun.py
File metadata and controls
31 lines (27 loc) · 812 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from Gun import *
from Vector2 import *
from BulletManager import *
import pygame
'''
Shoots one bullet at a time.
Slowest fire rate
Largest bullets
'''
class RocketGun(Gun):
'''
classdocs
'''
def __init__(self, mount, aimVector):
Gun.__init__(self, mount, aimVector)
self.delay = 750
self.bulletSpeed = 5
self.timer = pygame.time.get_ticks()
self.isRapidFire = True
def shoot(self):
#print "machinegun.shoot", self.canShoot
if self.canShoot:
self.timer = pygame.time.get_ticks()
self.generateBullets()
def generateBullets(self):
BulletManager.buildRocketBullet(self.origin.x, self.origin.y,
self.aimVector.x, self.aimVector.y, self.bulletSpeed)