Tests examples for the miniworldmaker engine https://www.miniworldmaker.de
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
miniworldmaker_cookbook/snippets/2 Movement/201_b_flipthefish_object_ba...

22 lines
443 B

from miniworldmaker import *
board=TiledBoard()
board.columns = 4
board.rows = 1
board.add_background("images/water.png")
fish = Token()
fish.border = 1
fish.add_costume("images/fish.png")
fish.direction = "right"
fish.orientation = -90
@fish.register
def act(self):
print("act", self.position, self.direction)
self.move()
@fish.register
def on_sensing_not_on_board(self):
self.move_back()
self.flip_x()
board.run()