-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMachineGun.py
More file actions
31 lines (27 loc) · 811 Bytes
/
MachineGun.py
File metadata and controls
31 lines (27 loc) · 811 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.
Fastest fire rate
Normal bullets
'''
class MachineGun(Gun):
'''
classdocs
'''
def __init__(self, mount, aimVector):
Gun.__init__(self, mount, aimVector)
self.delay = 100
self.bulletSpeed = 15
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.buildBaseBullet(self.origin.x, self.origin.y,
self.aimVector.x, self.aimVector.y, self.bulletSpeed)