diff --git a/heroplane.py b/heroplane.py index 5e87814..354c806 100644 --- a/heroplane.py +++ b/heroplane.py @@ -123,4 +123,13 @@ class HeroPlane(object): self.space_key_list.remove(key) except Exception: raise - \ No newline at end of file + # 按键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