mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-16 11:28:14 +00:00
game: small fix to 2048
This commit is contained in:
parent
be833053a9
commit
076d1a7e53
@ -32,7 +32,7 @@ color = {
|
|||||||
|
|
||||||
class Game:
|
class Game:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.d = ui.Display()
|
self.d = ui.display
|
||||||
self.d.backlight(ui.BACKLIGHT_NORMAL)
|
self.d.backlight(ui.BACKLIGHT_NORMAL)
|
||||||
self.d.bar(0, 0, ui.WIDTH, ui.HEIGHT, color["0"][1])
|
self.d.bar(0, 0, ui.WIDTH, ui.HEIGHT, color["0"][1])
|
||||||
self.m = [[0 for _ in range(4)] for _ in range(4)]
|
self.m = [[0 for _ in range(4)] for _ in range(4)]
|
||||||
@ -81,6 +81,7 @@ class Game:
|
|||||||
def update(self, d):
|
def update(self, d):
|
||||||
for _ in range(4):
|
for _ in range(4):
|
||||||
self.compact(d)
|
self.compact(d)
|
||||||
|
self.add()
|
||||||
|
|
||||||
def compact(self, d):
|
def compact(self, d):
|
||||||
if d == SWIPE_DOWN:
|
if d == SWIPE_DOWN:
|
||||||
@ -127,7 +128,6 @@ async def layout_game():
|
|||||||
game.render()
|
game.render()
|
||||||
swipe = await Swipe(absolute=True)
|
swipe = await Swipe(absolute=True)
|
||||||
game.update(swipe)
|
game.update(swipe)
|
||||||
game.add()
|
|
||||||
|
|
||||||
|
|
||||||
workflow.startdefault(layout_game)
|
workflow.startdefault(layout_game)
|
||||||
|
Loading…
Reference in New Issue
Block a user