Skip to content

Commit

Permalink
Added a shortcut to quit
Browse files Browse the repository at this point in the history
  • Loading branch information
kitao committed Feb 12, 2024
1 parent 825a9ed commit 34d243e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/pyxel/examples/15_tiled_map_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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
Expand Down

0 comments on commit 34d243e

Please sign in to comment.