Skip to content

Commit

Permalink
更改飞出屏幕对象的杀死条件
Browse files Browse the repository at this point in the history
  • Loading branch information
wszqkzqk committed Jun 4, 2022
1 parent 1ff2d1a commit 0db90ba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/component/plant.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def update(self, game_info):
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:
Expand Down Expand Up @@ -1161,7 +1161,7 @@ def idling(self):
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

Expand Down Expand Up @@ -1253,7 +1253,7 @@ def idling(self):
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

Expand Down

0 comments on commit 0db90ba

Please sign in to comment.