MCPcopy Index your code
hub / github.com/marblexu/PythonPlantsVsZombies / canAttack

Method canAttack

source/component/plant.py:195–199  ·  view source on GitHub ↗
(self, zombie)

Source from the content-addressed store, hash-verified

193 self.image.set_alpha(192)
194
195 def canAttack(self, zombie):
196 if (self.state != c.SLEEP and zombie.state != c.DIE and
197 self.rect.x <= zombie.rect.right):
198 return True
199 return False
200
201 def setAttack(self):
202 self.state = c.ATTACK

Callers 1

checkPlantMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected