DIY a Raspberry Game - 2048

3310Published On Mar 08,2017 11:19 AMshare0

Game 【2048】is a single-player sliding block puzzle game by Italian web developer Gabriele Cirulli. 2048 was originally written in JavaScript and CSS during a weekend, and released on March 9, 2014, as free and open-source software subject to the MIT license.

The game's objective is to slide numbered tiles on a grid to combine them to create a tile with the number 2048.

In this project, I rewritten the game 【2048】in Python on Raspberry Pi, and made a little change with it. The numbers in the grid are swapped with a series of words that explain the the process of 【how does an idea become a real product in the market】:

  • 2 => Idea
  • 4 => Design
  • 8 => Make
  • 16 => Prototype
  • 32 => Seeed
  • 64 => Improve
  • 128 => Sample
  • 256 => Product
  • 512 => Promote
  • 1024 => Market
  • 2048 => Success

There is a camera mounted in front of the game machine, when you win the game, it will take a photo of you and list it on the ranklist.

Besides, to add more fun, I connected the game machine to a Canon SELPHY CP1200 photo printer so it can print out the photo of the winner as a reward.

When you finished this tutorial, you can acquire the following knowledge:

  • Be familiar with Raspberry Pi
  • Understand python programming using pyside
  • The skills of dealing with pictures using Pi Camera


Setup the GrovePi+

Setup the Pi Camera

Setup the Photo Printer

Install Pyside and Download the Project Code

Setup the Startup Script

Laser Cut the Plate

Install the Screen Section

Install the Hardware

Install the Housing

Install the Camera and Top Panel

The Result


啸天 吴
Raspberry Pi - Model B
$39.90 Add To Cart
Raspberry Pi Camera Module
$29.90 Add To Cart
Grove - Thumb Joystick
$6.90 Add To Cart
Add All To Cart
Related Recipes
Popular Recipes