|
@@ -103,7 +103,7 @@ def relative_move_asset(asset, x:int=0, y:int=0):
|
|
|
return new_asset
|
|
return new_asset
|
|
|
|
|
|
|
|
# Move a passed asset in relation to her orientation
|
|
# Move a passed asset in relation to her orientation
|
|
|
-def orientation_move_asset(asset, direction, amount):
|
|
|
|
|
|
|
+def orientation_move_asset(asset, direction:str, amount:int):
|
|
|
# Direction translation
|
|
# Direction translation
|
|
|
if asset[1][4].startswith("east"): # East
|
|
if asset[1][4].startswith("east"): # East
|
|
|
if direction.lower() == "forward" or direction.lower() == "front":
|
|
if direction.lower() == "forward" or direction.lower() == "front":
|
|
@@ -155,7 +155,7 @@ def orientation_move_asset(asset, direction, amount):
|
|
|
return new_asset
|
|
return new_asset
|
|
|
|
|
|
|
|
# Move a passed asset to new coordinates
|
|
# Move a passed asset to new coordinates
|
|
|
-def absolute_move_asset(asset, x, y):
|
|
|
|
|
|
|
+def absolute_move_asset(asset, x:int, y:int):
|
|
|
# Update coordinates in list
|
|
# Update coordinates in list
|
|
|
asset[1][1] = x
|
|
asset[1][1] = x
|
|
|
asset[1][2] = y
|
|
asset[1][2] = y
|
|
@@ -654,7 +654,7 @@ it may be useful in case of moving in relation to orientation,
|
|
|
perhaps in coordinated group movements with Karels.
|
|
perhaps in coordinated group movements with Karels.
|
|
|
"""
|
|
"""
|
|
|
# Draw a random Karel outside the canvas
|
|
# Draw a random Karel outside the canvas
|
|
|
-def generate_outofbounds_random_beeper(canvas, side):
|
|
|
|
|
|
|
+def generate_outofbounds_random_beeper(canvas, side:str):
|
|
|
size = determine_max_size(canvas)
|
|
size = determine_max_size(canvas)
|
|
|
|
|
|
|
|
# Generate random coordinates (Outside the canvas geometry)
|
|
# Generate random coordinates (Outside the canvas geometry)
|