|
@@ -100,6 +100,30 @@ my_karel = draw_karel(canvas, colour="red", background="blue")
|
|
|
my_karel = relative_move_asset(my_karel, 10, -10)
|
|
my_karel = relative_move_asset(my_karel, 10, -10)
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
|
|
+### Changing position relative to its orientation
|
|
|
|
|
+To change the position of an asset on the canvas relative to its current orientation, use orientation_move_asset(asset, direction, amount)
|
|
|
|
|
+Directional options:
|
|
|
|
|
+* forward
|
|
|
|
|
+* front
|
|
|
|
|
+* left
|
|
|
|
|
+* right
|
|
|
|
|
+* backward
|
|
|
|
|
+* back
|
|
|
|
|
+To move an asset to its right by 10 pixels:
|
|
|
|
|
+```
|
|
|
|
|
+my_karel = draw_karel(canvas, colour="red", background="blue")
|
|
|
|
|
+my_karel = orientation_move_asset(my_karel, "right", 10)
|
|
|
|
|
+```
|
|
|
|
|
+
|
|
|
|
|
+### Changing absolute position on the canvas
|
|
|
|
|
+To change the position of an asset on the canvas with absolute coordinates, use absolute_move_asset(asset, x, y).
|
|
|
|
|
+Where x is the absolute width centre and y is the absolute height centre.
|
|
|
|
|
+To move an asset to 100 by 100:
|
|
|
|
|
+```
|
|
|
|
|
+my_karel = draw_karel(canvas, colour="red", background="blue")
|
|
|
|
|
+my_karel = absolute_move_asset(my_karel, 100, 100)
|
|
|
|
|
+```
|
|
|
|
|
+
|
|
|
### Rotating
|
|
### Rotating
|
|
|
To turn an asset, use rotate_asset(asset, orientation).
|
|
To turn an asset, use rotate_asset(asset, orientation).
|
|
|
Orientation options:
|
|
Orientation options:
|