重构
This commit is contained in:
parent
08ec7e2d00
commit
777e937d98
@ -1279,18 +1279,20 @@ class TorchWood(Plant):
|
|||||||
|
|
||||||
def idling(self):
|
def idling(self):
|
||||||
for i in self.bullet_group:
|
for i in self.bullet_group:
|
||||||
if i.name == c.BULLET_PEA:
|
if (i.name == c.BULLET_PEA
|
||||||
if i.passed_torchwood_x != self.rect.centerx:
|
and i.passed_torchwood_x != self.rect.centerx
|
||||||
if abs(i.rect.centerx - self.rect.centerx) <= 20:
|
and abs(i.rect.centerx - self.rect.centerx) <= 20):
|
||||||
self.bullet_group.add(Bullet(i.rect.x, i.rect.y, i.dest_y,
|
self.bullet_group.add(Bullet(i.rect.x, i.rect.y, i.dest_y,
|
||||||
c.BULLET_FIREBALL, c.BULLET_DAMAGE_FIREBALL_BODY, effect=c.BULLET_EFFECT_UNICE, passed_torchwood_x=self.rect.centerx))
|
c.BULLET_FIREBALL, c.BULLET_DAMAGE_FIREBALL_BODY,
|
||||||
i.kill()
|
effect=c.BULLET_EFFECT_UNICE, passed_torchwood_x=self.rect.centerx))
|
||||||
elif i.name == c.BULLET_PEA_ICE:
|
i.kill()
|
||||||
if i.passed_torchwood_x != self.rect.centerx:
|
elif (i.name == c.BULLET_PEA_ICE
|
||||||
if abs(i.rect.centerx - self.rect.centerx) <= 20:
|
and i.passed_torchwood_x != self.rect.centerx
|
||||||
self.bullet_group.add(Bullet(i.rect.x, i.rect.y, i.dest_y,
|
and abs(i.rect.centerx - self.rect.centerx)):
|
||||||
c.BULLET_PEA, c.BULLET_DAMAGE_NORMAL, effect=None, passed_torchwood_x=self.rect.centerx))
|
self.bullet_group.add(Bullet(i.rect.x, i.rect.y, i.dest_y,
|
||||||
i.kill()
|
c.BULLET_PEA, c.BULLET_DAMAGE_NORMAL,
|
||||||
|
effect=None, passed_torchwood_x=self.rect.centerx))
|
||||||
|
i.kill()
|
||||||
|
|
||||||
class StarFruit(Plant):
|
class StarFruit(Plant):
|
||||||
def __init__(self, x, y, bullet_group, level):
|
def __init__(self, x, y, bullet_group, level):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user