summaryrefslogtreecommitdiff
path: root/wasp/apps/software.py
diff options
context:
space:
mode:
authorMiguel Rochefort <miguelrochefort@gmail.com>2021-01-05 03:12:39 (GMT)
committerDaniel Thompson <daniel@redfelineninja.org.uk>2021-01-10 18:14:36 (GMT)
commitffff5ae52b9e7d7e6ddf45075e1ee100d73ae75b (patch)
tree24549828042459bf288a4efa3754ec7b98d68515 /wasp/apps/software.py
parent8a07edb4d8509e5c6962d9437cc86b5df01c02d1 (diff)
apps: play2048: Add the 2048 game application
2048 is a popular sliding block puzzle game in which tiles are combined to make the number 2048. It's one of the few games that are enjoyable to play on such a small form factor. This started as a port of a TkInter implementation of the 2048 game. I implemented all of the TkInter APIs used by the game and it worked on wasp-os without any code change in the game. However, the performance was very poor and it consumed too much RAM. I have since reimplemented the whole game from scratch and managed to achieve acceptable performance, although more improvements could still be made. Because names in Python can't start with numbers, I had some trouble naming things. The module is called "ttfe" (two-thousand-forty-eight), the class name is Play2048App, and the software.py entry is "Play 2048". Signed-off-by: Miguel Rochefort <miguelrochefort@gmail.com> [daniel@redfelineninja.org.uk: Renamed the python filename, normalized the screenshot and included the app in the docs] Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Diffstat (limited to 'wasp/apps/software.py')
-rw-r--r--wasp/apps/software.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/wasp/apps/software.py b/wasp/apps/software.py
index b8bea2c..92a2531 100644
--- a/wasp/apps/software.py
+++ b/wasp/apps/software.py
@@ -19,10 +19,11 @@ class SoftwareApp():
('fibonacci_clock', wasp.widgets.Checkbox(0, 120, 'Fibonacci Clock')),
('gameoflife', wasp.widgets.Checkbox(0, 160, 'Game Of Life')),
('musicplayer', wasp.widgets.Checkbox(0, 0, 'Music Player')),
- ('snake', wasp.widgets.Checkbox(0, 40, 'Snake Game')),
- ('flashlight', wasp.widgets.Checkbox(0, 80, 'Torch')),
- ('testapp', wasp.widgets.Checkbox(0, 120, 'Test')),
- ('timer', wasp.widgets.Checkbox(0, 160, 'Timer')),
+ ('play2048', wasp.widgets.Checkbox(0, 40, 'Play 2048')),
+ ('snake', wasp.widgets.Checkbox(0, 80, 'Snake Game')),
+ ('flashlight', wasp.widgets.Checkbox(0, 120, 'Torch')),
+ ('testapp', wasp.widgets.Checkbox(0, 160, 'Test')),
+ ('timer', wasp.widgets.Checkbox(0, 0, 'Timer')),
)
self.si = wasp.widgets.ScrollIndicator()
self.page = 0