This commit is contained in:
206530334 2021-06-15 14:36:30 +08:00
parent bbd5aeaced
commit b8be4f9034
1 changed files with 10 additions and 1 deletions

View File

@ -123,4 +123,13 @@ class HeroPlane(object):
self.space_key_list.remove(key)
except Exception:
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