refactor: adjust planting logic to use grid sections and add grass planting
This commit is contained in:
11
utils.py
11
utils.py
@@ -16,6 +16,17 @@ def move_to(x, y):
|
||||
# it will water the tile. If requireSoil is true, it will till the tile if it's not soil.
|
||||
# plantWith - list of entities to plant. The entities will alternate if repeated.
|
||||
def plant_grid(width, height, plantWith, waterBelow, requireSoil):
|
||||
x = get_pos_x()
|
||||
y = get_pos_y()
|
||||
|
||||
gridSize = get_world_size()
|
||||
|
||||
if (x + width) > gridSize:
|
||||
width = gridSize - x
|
||||
|
||||
if (y + height) > gridSize:
|
||||
height = gridSize - y
|
||||
|
||||
tracker = 0
|
||||
|
||||
others = {East:West, West:East}
|
||||
|
||||
Reference in New Issue
Block a user