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/222 bounce_from_border.py

16 lines
311 B

from miniworldmaker import *
import random
board = Board(150, 150)
token = Token((50,50))
token.add_costume("images/ball.png")
token.direction = 10
@token.register
def act(self):
self.move()
borders = self.sensing_borders()
if borders:
self.bounce_from_border(borders)
board.run()