From 34d243eba88b5c4f18b32f512321cae972aaea9f Mon Sep 17 00:00:00 2001 From: Takashi Kitao Date: Mon, 12 Feb 2024 14:38:20 +0900 Subject: [PATCH] Added a shortcut to quit --- python/pyxel/examples/15_tiled_map_file.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/pyxel/examples/15_tiled_map_file.py b/python/pyxel/examples/15_tiled_map_file.py index fa7699d2cb..a3fb0ef096 100644 --- a/python/pyxel/examples/15_tiled_map_file.py +++ b/python/pyxel/examples/15_tiled_map_file.py @@ -46,7 +46,7 @@ def __init__(self): ) for i in range(3): pyxel.tilemaps[i] = pyxel.Tilemap.from_tmx("assets/urban_rpg.tmx", i) - self.player = (0, 0, 1, 0) # (x, y, u, v) + self.player = (160, 80, 1, 0) # (x, y, u, v) self.cars = [ # (x, y, dx, image) (128, 104, -2, 0), (288, 104, -2, 1), @@ -58,6 +58,9 @@ def __init__(self): pyxel.run(self.update, self.draw) def update(self): + if pyxel.btnp(pyxel.KEY_Q): + pyxel.quit() + # Update player x, y, u, v = self.player dx, dy = 0, 0