From 1939f8b93b17285ddc2790db01a51a33fdba9588 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E5=A4=96=E4=B9=8B=E7=A5=9E?= Date: Mon, 2 May 2022 22:16:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BD=93=E9=AA=8C=E4=BA=86?= =?UTF-8?q?=E5=B0=8F=E6=B8=B8=E6=88=8F=E5=85=B3=E5=8D=A1=E4=B9=8B=E5=90=8E?= =?UTF-8?q?=E5=86=92=E9=99=A9=E5=8D=9A=E5=A3=AB=E5=85=B3=E5=8D=A1=E8=BF=9B?= =?UTF-8?q?=E5=BA=A6=E4=BC=A0=E9=80=92=E5=A4=B1=E8=B4=A5=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/component/plant.py | 3 +-- source/state/level.py | 5 +++-- source/tool.py | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/source/component/plant.py b/source/component/plant.py index a4ee7ab..d4e9494 100755 --- a/source/component/plant.py +++ b/source/component/plant.py @@ -732,7 +732,6 @@ class Spikeweed(Plant): self.loadFrames(self.frames, name, 0.9, c.WHITE) def setIdle(self): - print('spikeweed idle') self.animate_interval = 70 self.state = c.IDLE @@ -1161,7 +1160,7 @@ class StarFruit(Plant): def attacking(self): if (self.current_time - self.shoot_timer) > 1400: - self.bullet_group.add(StarBullet(self.rect.left + 10, self.rect.y + 15, c.BULLET_DAMAGE_NORMAL, c.STAR_BACKWARD, self.level)) + self.bullet_group.add(StarBullet(self.rect.left + 5, self.rect.y + 15, c.BULLET_DAMAGE_NORMAL, c.STAR_BACKWARD, self.level)) self.bullet_group.add(StarBullet(self.rect.centerx - 20, self.rect.bottom - self.rect.h + 5, c.BULLET_DAMAGE_NORMAL, c.STAR_UPWARD, self.level)) self.bullet_group.add(StarBullet(self.rect.centerx - 20, self.rect.bottom - 5, c.BULLET_DAMAGE_NORMAL, c.STAR_DOWNWARD, self.level)) self.bullet_group.add(StarBullet(self.rect.right - 5, self.rect.bottom - 20, c.BULLET_DAMAGE_NORMAL, c.STAR_FORWARD_DOWN, self.level)) diff --git a/source/state/level.py b/source/state/level.py index 6276c40..c1331ee 100644 --- a/source/state/level.py +++ b/source/state/level.py @@ -40,6 +40,7 @@ class Level(tool.State): file_path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))),'resources' , 'data', 'map', map_file) # 最后一关之后应该结束了 try: + print(self.game_info[c.LEVEL_NUM]) f = open(file_path) self.map_data = json.load(f) f.close() @@ -242,7 +243,6 @@ class Level(tool.State): return self.beforePauseTime def initBowlingMap(self): - print('initBowlingMap') for x in range(3, self.map.width): for y in range(self.map.height): self.map.setMapGridType(x, y, c.MAP_STATE_UNAVAILABLE) # 将坚果保龄球红线右侧设置为不可种植任何植物 @@ -1068,10 +1068,11 @@ class Level(tool.State): def checkGameState(self): if self.checkVictory(): - if c.LITTLEGAME_BUTTON in self.game_info: + if (c.LITTLEGAME_BUTTON in self.game_info) and (self.game_info[c.LITTLEGAME_BUTTON]): self.game_info[c.LITTLEGAME_NUM] += 1 else: self.game_info[c.LEVEL_NUM] += 1 + print(self.game_info[c.LEVEL_NUM]) self.next = c.GAME_VICTORY self.done = True elif self.checkLose(): diff --git a/source/tool.py b/source/tool.py index dbd5e36..a5122ba 100755 --- a/source/tool.py +++ b/source/tool.py @@ -89,7 +89,6 @@ class Control(): elif event.type == pg.MOUSEBUTTONDOWN: self.mouse_pos = pg.mouse.get_pos() self.mouse_click[0], _, self.mouse_click[1] = pg.mouse.get_pressed() - print('pos:', self.mouse_pos, ' mouse:', self.mouse_click) def run(self):