From 0db90ba8c87a42dc578a11ba984c2baa989c4b10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E5=A4=96=E4=B9=8B=E7=A5=9E?= Date: Sat, 4 Jun 2022 21:31:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E9=A3=9E=E5=87=BA=E5=B1=8F?= =?UTF-8?q?=E5=B9=95=E5=AF=B9=E8=B1=A1=E7=9A=84=E6=9D=80=E6=AD=BB=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/component/plant.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/component/plant.py b/source/component/plant.py index 68f5eb7..cffca58 100755 --- a/source/component/plant.py +++ b/source/component/plant.py @@ -207,7 +207,7 @@ class StarBullet(Bullet): else: self.rect.x -= 10 self.handleMapYPosition() - if ((self.rect.x > c.SCREEN_WIDTH + 60) or (self.rect.x < -40) + if ((self.rect.x > c.SCREEN_WIDTH + 60) or (self.rect.x < -60) or (self.rect.y > c.SCREEN_HEIGHT) or (self.rect.y < 0)): self.kill() elif self.state == c.EXPLODE: @@ -1161,7 +1161,7 @@ class WallNutBowling(Plant): self.handleMapYPosition() if self.shouldChangeDirection(): self.changeDirection(-1) - if self.init_rect.x > c.SCREEN_WIDTH: + if self.init_rect.x > c.SCREEN_WIDTH + 60: self.health = 0 self.move_timer += self.move_interval @@ -1253,7 +1253,7 @@ class RedWallNutBowling(Plant): elif (self.current_time - self.move_timer) >= self.move_interval: self.rotate_degree = (self.rotate_degree - 30) % 360 self.init_rect.x += self.vel_x - if self.init_rect.x > c.SCREEN_WIDTH: + if self.init_rect.x > c.SCREEN_WIDTH + 60: self.health = 0 self.move_timer += self.move_interval