Skip to content

Commit

Permalink
更改缠绕海草攻击范围
Browse files Browse the repository at this point in the history
  • Loading branch information
wszqkzqk committed Aug 8, 2022
1 parent 544560c commit 525ba76
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion source/component/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ def isAvailable(self, map_x, map_y, plant_name):
return False
else:
return True
elif (plant_name == c.PUMPKINHEAD) and (c.PUMPKINHEAD not in self.map[map_y][map_x][c.MAP_PLANT]): # 有花盆且没有南瓜头就能种南瓜头
elif ((plant_name == c.PUMPKINHEAD)
and (c.PUMPKINHEAD not in self.map[map_y][map_x][c.MAP_PLANT])): # 有花盆且没有南瓜头就能种南瓜头
return True
else:
return False
Expand Down
2 changes: 1 addition & 1 deletion source/component/plant.py
Original file line number Diff line number Diff line change
Expand Up @@ -1474,7 +1474,7 @@ def load_images(self):
def canAttack(self, zombie):
if zombie.state != c.DIE and (not zombie.losthead):
# 这里碰撞应当比碰撞一般更容易,就设置成圆形或矩形模式,不宜采用mask
if pg.sprite.collide_circle_ratio(0.7)(zombie, self):
if pg.sprite.collide_rect_ratio(1)(zombie, self):
return True
return False

Expand Down

0 comments on commit 525ba76

Please sign in to comment.