2048: Embedded Edition

Embedded touch version of 2048 tile gameHow ’bout that 2048 game? Pretty addictive, huh? Almost as addictive as embedded systems are, at least if you’re [Andrew]. Armed (pun intended) with a Nucleo F4 and a Gameduino 2 shield, he decided to have a go at making an embedded version of the popular tile pusher web game.

If you’re unfamiliar with the Nucleo boards from STMicroelectronics, check out our post on the Nucleo family from a couple of months ago. The Gameduino 2 shield ships with a 4.3″ touchscreen driven by an FT800 GPU EVE. [Andrew] wrote his own driver for it and his blog post goes into great detail about its programming model and the SPI read, write, and command functions he wrote. Full code is available from [Andrew]’s repo.

He started by generating a blank screen based on clues found in the Gameduino 2 source. Pretty soon he had rendered a rectangle and then a full 2048 board. A minor difference between [Andrew]’s creation and the original is that his always creates new tiles as ‘2’ while the web game cranks out the occasional ‘4’.

We were unable to embed [Andrew]’s gameplay videos, but you’ll find two on his blog.

 

6 thoughts on “2048: Embedded Edition

  1. My algorithm for winning this stupid game:
    up, right, up, right, up, right, …, up, right
    When nothing happens for up or right: left or down, then *immediately* back to up/right.
    Refining the algo:
    * Switch to right, up, right, up etc. to balance out sides when they grow
    * After doing a left or down, do multiple up,up or right, right to merge high values in the corner.
    * To fix diagonal rows of the same value: use left, down, UP (important here), right. Trick is to not push the new block spawned to the right every time.

    This algorithm works surprisingly well I must say, a little to well to be true actually..

    1. That is a fantastic idea. Gameboy, GBA, etc should all have this game.

      Great game, cool hack.

      Now where can I find a square touchscreen for this…. I’m thinking one button to turn it on and off and a picture frame style border. Actually, why not make it a picture frame/slideshow thing that doubles as a handheld 2048?

      1. I had plans to make one with a vacuum fluorescent display. They come in a square form-factor. I was thinking to put four tactile switches above, below, to the left and to the right of the screen.

        I imagine the FT800 can support square displays just fine, if you can find one :)

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.