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

Method getMapGridPos

source/component/map.py:28–30  ·  view source on GitHub ↗
(self, map_x, map_y)

Source from the content-addressed store, hash-verified

26 return (x // c.GRID_X_SIZE, y // c.GRID_Y_SIZE)
27
28 def getMapGridPos(self, map_x, map_y):
29 return (map_x * c.GRID_X_SIZE + c.GRID_X_SIZE//2 + c.MAP_OFFSET_X,
30 map_y * c.GRID_Y_SIZE + c.GRID_Y_SIZE//5 * 3 + c.MAP_OFFSET_Y)
31
32 def setMapGridType(self, map_x, map_y, type):
33 self.map[map_y][map_x] = type

Callers 4

showPlantMethod · 0.95
setupCarsMethod · 0.80
playMethod · 0.80
createZombieMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected