Blog Home

Using the MKR IoT Carrier board as a game console

Arduino TeamJuly 21st, 2021

One of the first things many makers try to do when they receive a new piece of cool hardware is write a game for it. This is exactly what Johan Halmén did with his Breakout console that uses the Arduino MKR IoT Carrier board and an MKR1000 to both run and display the game. 

Breakout typically involves moving a paddle horizontally along the bottom of the screen to bounce a ball that can destroy the bricks above it. However, since the carrier board’s color OLED screen is circular, Halmén had to create a different version of this, which he calls “BreakIn.” His game features a bunch of hexagonal tiles in the middle and a paddle that moves around the outside that is controlled by the onboard accelerometer. This lets the player tilt the device to move their paddle quickly and accurately. 

Getting the circular display to work was a bit more of a challenge than a normal square one because coordinates had to be mapped using a bit of trigonometry first. Additionally, figuring out the angle of tilt and the collision geometry took some math as well. But once everything was up and working, the game was very fun to play, as can be seen in Halmén’s demo video below. 

To read more about the code that went into this project, check out its Instructables write-up here.

Boards:MKR1000
Categories:Arduino