This is a sliding tile game for the O Watch based on the simple and addicting game 2048 by Gabriele Cirulli.
- Use the four O Watch buttons to slide the numbered tiles horizontally or vertically. Combine similar tiles to reach 2048 and beyond.
I studied the original 2048 JavaScript source code and wondered if it would be possible to recreate the game-play on an embedded device without the supporting web browser application. The O Watch seemed like a perfect choice, even with the limited screen size.
This playable version uses a basic non-stack state machine to accept input from the user as well as update the game properties and refresh the TinyScreen+ display. To improve the visual performance I've implemented a framebuffer rather than sending individual sprites over the SPI bus.
The four buttons have additional functionality beyond the Up, Down, Left, and Right used while playing the game. These functions are only enabled while the display is in sleep mode -- which is entered after 10 seconds of inactivity.
The Menu provides access to the date and time settings.
NOTE: I'm not sure the tiny O Watch buttons are designed to handle the quantity of clicks this game will require to reach 2048!
I've put the source code on GitHub, it's still a work in progress.
Comments