refactor: adjust planting logic to use grid sections and add grass planting

This commit is contained in:
2026-01-04 18:36:26 -05:00
parent 95d8540116
commit cb702bed32
2 changed files with 44 additions and 17 deletions

View File

@@ -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}