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.

 

Comments

  1. Pixel Pirate says:

    Well… I know what I must now make…

  2. Joel says:

    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..

  3. rj says:

    And then there’s a port to the original gameboy: https://github.com/Sanqui/2048-gb

    • Spork says:

      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?

      • Andrew says:

        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

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 96,764 other followers