MCPcopy Create free account
hub / github.com/marblexu/PythonPlantsVsZombies / createZombie

Method createZombie

source/state/level.py:189–200  ·  view source on GitHub ↗
(self, name, map_y)

Source from the content-addressed store, hash-verified

187 self.checkGameState()
188
189 def createZombie(self, name, map_y):
190 x, y = self.map.getMapGridPos(0, map_y)
191 if name == c.NORMAL_ZOMBIE:
192 self.zombie_groups[map_y].add(zombie.NormalZombie(c.ZOMBIE_START_X, y, self.head_group))
193 elif name == c.CONEHEAD_ZOMBIE:
194 self.zombie_groups[map_y].add(zombie.ConeHeadZombie(c.ZOMBIE_START_X, y, self.head_group))
195 elif name == c.BUCKETHEAD_ZOMBIE:
196 self.zombie_groups[map_y].add(zombie.BucketHeadZombie(c.ZOMBIE_START_X, y, self.head_group))
197 elif name == c.FLAG_ZOMBIE:
198 self.zombie_groups[map_y].add(zombie.FlagZombie(c.ZOMBIE_START_X, y, self.head_group))
199 elif name == c.NEWSPAPER_ZOMBIE:
200 self.zombie_groups[map_y].add(zombie.NewspaperZombie(c.ZOMBIE_START_X, y, self.head_group))
201
202 def canSeedPlant(self):
203 x, y = pg.mouse.get_pos()

Callers 1

playMethod · 0.95

Calls 1

getMapGridPosMethod · 0.80

Tested by

no test coverage detected