冰豌豆爆炸时使用独立图片
This commit is contained in:
parent
cbfa280893
commit
3507eb5972
BIN
resources/graphics/Bullets/PeaIceExplode/PeaIceExplode_0.png
Normal file
BIN
resources/graphics/Bullets/PeaIceExplode/PeaIceExplode_0.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1007 B |
@ -76,6 +76,8 @@ class Bullet(pg.sprite.Sprite):
|
|||||||
fly_name = self.name
|
fly_name = self.name
|
||||||
if self.name == c.BULLET_MUSHROOM:
|
if self.name == c.BULLET_MUSHROOM:
|
||||||
explode_name = 'BulletMushRoomExplode'
|
explode_name = 'BulletMushRoomExplode'
|
||||||
|
elif self.name == c.BULLET_PEA_ICE:
|
||||||
|
explode_name = 'PeaIceExplode'
|
||||||
else:
|
else:
|
||||||
explode_name = 'PeaNormalExplode'
|
explode_name = 'PeaNormalExplode'
|
||||||
|
|
||||||
|
|||||||
@ -202,7 +202,6 @@ class Zombie(pg.sprite.Sprite):
|
|||||||
|
|
||||||
def setDamage(self, damage, effect=False, damageType=c.ZOMBIE_COMMON_DAMAGE):
|
def setDamage(self, damage, effect=False, damageType=c.ZOMBIE_COMMON_DAMAGE):
|
||||||
# 冰冻减速效果
|
# 冰冻减速效果
|
||||||
print(damage, effect, damageType)
|
|
||||||
if effect == c.BULLET_EFFECT_ICE:
|
if effect == c.BULLET_EFFECT_ICE:
|
||||||
if damageType == c.ZOMBIE_DEAFULT_DAMAGE: # 寒冰射手不能穿透二类防具进行减速
|
if damageType == c.ZOMBIE_DEAFULT_DAMAGE: # 寒冰射手不能穿透二类防具进行减速
|
||||||
if not self.helmetType2:
|
if not self.helmetType2:
|
||||||
|
|||||||
@ -638,7 +638,7 @@ class Level(tool.State):
|
|||||||
|
|
||||||
|
|
||||||
def checkGlobalBulletCollision(self):
|
def checkGlobalBulletCollision(self):
|
||||||
collided_func = pg.sprite.collide_circle_ratio(0.7)
|
collided_func = pg.sprite.collide_circle_ratio(0.6)
|
||||||
for i in range(self.map_y_len):
|
for i in range(self.map_y_len):
|
||||||
for globalBullet in self.global_bullet_group:
|
for globalBullet in self.global_bullet_group:
|
||||||
if globalBullet.state == c.FLY:
|
if globalBullet.state == c.FLY:
|
||||||
@ -841,12 +841,6 @@ class Level(tool.State):
|
|||||||
elif plant.name == c.STARFRUIT:
|
elif plant.name == c.STARFRUIT:
|
||||||
can_attack = False
|
can_attack = False
|
||||||
if (plant.state == c.IDLE):
|
if (plant.state == c.IDLE):
|
||||||
'''
|
|
||||||
totalZombie = 0
|
|
||||||
for zombieColumn in range(self.map_y_len):
|
|
||||||
totalZombie += len(self.zombie_groups[zombieColumn])
|
|
||||||
if totalZombie > 0: # 只要场上有僵尸就需要判断
|
|
||||||
'''
|
|
||||||
for zombie_group in self.zombie_groups: # 遍历循环所有僵尸
|
for zombie_group in self.zombie_groups: # 遍历循环所有僵尸
|
||||||
for zombie in zombie_group:
|
for zombie in zombie_group:
|
||||||
if plant.canAttack(zombie):
|
if plant.canAttack(zombie):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user