mirror of
https://github.com/jcreek/TheFarmerWasReplaced.git
synced 2026-07-12 18:43:47 +00:00
feat(*): Enable multiple drones for hay
This commit is contained in:
@@ -11,4 +11,27 @@ def harvest_hay():
|
||||
for y in range(get_world_size()):
|
||||
till_and_plant()
|
||||
move(North)
|
||||
move(East)
|
||||
move(East)
|
||||
|
||||
def harvest_hay_columns():
|
||||
columns_per_drone = get_world_size() / max_drones()
|
||||
for x in range(columns_per_drone):
|
||||
for y in range(get_world_size()):
|
||||
till_and_plant()
|
||||
move(North)
|
||||
move(East)
|
||||
|
||||
def spawn_drones():
|
||||
world_size = get_world_size()
|
||||
|
||||
columns_per_drone = world_size / max_drones()
|
||||
|
||||
i = 0
|
||||
while i < world_size:
|
||||
helpers.move_to_coords(i,0)
|
||||
spawn_drone(harvest_hay_columns)
|
||||
i += columns_per_drone
|
||||
|
||||
def harvest_hay_with_multiple_drones():
|
||||
spawn_drones()
|
||||
harvest_hay_columns()
|
||||
|
||||
Reference in New Issue
Block a user