This commit is contained in:
parent
bbd5aeaced
commit
b8be4f9034
11
heroplane.py
11
heroplane.py
|
@ -123,4 +123,13 @@ class HeroPlane(object):
|
||||||
self.space_key_list.remove(key)
|
self.space_key_list.remove(key)
|
||||||
except Exception:
|
except Exception:
|
||||||
raise
|
raise
|
||||||
|
# 按键space不放,持续开火
|
||||||
|
|
||||||
|
def press_fire(self):
|
||||||
|
starttime = pygame.time.get_ticks()
|
||||||
|
passtime = starttime - self.endtime
|
||||||
|
|
||||||
|
if len(self.space_key_list) != 0 and passtime > self.interval:
|
||||||
|
# and passtime >100:
|
||||||
|
self.shot()
|
||||||
|
self.endtime = starttime
|
||||||
|
|
Loading…
Reference in New Issue