replace farmers wip
#python #Game
code:python
def move_to(x, y):
while get_pos_x() != x:
move(East)
while get_pos_y() != y:
move(North)
def run(entity_type, x = 0, y = 0):
if entity_type == Entities.Carrot:
if get_ground_type() != Grounds.Soil:
till()
plant(Entities.Carrot)
elif entity_type == Entities.Bush:
if get_ground_type() != Grounds.Grassland:
till()
plant(Entities.Bush)
elif entity_type == Entities.Tree:
if get_ground_type() != Grounds.Grassland:
till()
if (x % 2 == 0 and y % 2 == 0) or (x % 2 != 0 and y % 2 ):
plant(Entities.Tree)
elif entity_type == Entities.Pumpkin:
if get_ground_type() != Grounds.Soil:
till()
plant(Entities.Pumpkin)
elif entity_type == Entities.Grass:
if get_ground_type() != Grounds.Grassland:
till()
else:
pass
move_to(0, 0)
while True:
for x in range(get_world_size()):
for y in range(get_world_size()):
move_to(x, y)
harvest()
run(Entities.Tree, x, y)