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

Method getMapIndex

source/component/map.py:23–26  ·  view source on GitHub ↗
(self, x, y)

Source from the content-addressed store, hash-verified

21 return (self.map[map_y][map_x] == c.MAP_EMPTY)
22
23 def getMapIndex(self, x, y):
24 x -= c.MAP_OFFSET_X
25 y -= c.MAP_OFFSET_Y
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,

Callers 4

showPlantMethod · 0.95
handleMapYPositionMethod · 0.80
addPlantMethod · 0.80
killPlantMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected