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.
24 lines
602 B
24 lines
602 B
from miniworldmaker import *
|
|
board = TiledBoard()
|
|
board.columns = 20
|
|
board.rows = 8
|
|
board.tile_size = 40
|
|
board.add_background("images/stone.png")
|
|
board.background.is_textured = True
|
|
t1 = Token((0,0))
|
|
t2 = Token((3,4))
|
|
t1.add_costume("images/player_blue.png")
|
|
t2.add_costume("images/player_red.png")
|
|
|
|
@t2.register
|
|
def on_mouse_left(self, mouse_pos):
|
|
if self.sensing_point(mouse_pos):
|
|
self.dragged = True
|
|
|
|
@t2.register
|
|
def on_mouse_left_released(self, mouse_pos):
|
|
if not board.is_mouse_pressed():
|
|
self.dragged = False
|
|
self.position = mouse_pos
|
|
|
|
board.run() |