# My First Game for the Playdate - FlatCube

2025-11-19 - [54] 9:4

After picking up the PlayDate about 2 months ago, I wanted to build something for it. Well, my first completed project for it is done! This is my annoying 3x3x3 twisty puzzle game "FlatCube"! Have you ever wanted to solve a Rubik's cube but only wanted to ever be able to look at 1 side? Have you ever wanted to solve a Rubik's cube, but you aren't allowed to turn the back side of the cube? Have you ever thought "I totally wish I couldn't rotate the whole cube"? Have you ever wanted your Rubik's cube to assign a random color scheme after every scramble? Well, FlatCube is here for you!

FlatCube is a 3x3x3 twisty puzzle cube with a few changes and restrictions:

- Only the [F]ront face is visible
- The cube cannot be rotated, meaning no X-, Y-, or Z-axis rotations of the cube
- The only turns allowed are [F]ront, [U]p, [D]own, and [R]ight, [L]eft face turns (so no [B]ack turns or slice moves)
- Every scramble randomizes the color scheme of the cube

## Controls

- A - Turn [F]ront face clockwise
- Up - Turn [U]p face clockwise
- Down - Turn [D]own face clockwise
- Right - Turn [R]ight face clockwise
- Left - Turn [L]eft face clockwise
- Hold B - Turns will be counterclockwise instead of clockwise

The cube can be scrambled by selecting "scramble" in the menu after hitting the Menu button on the Playdate.

## Achievements

This game has 4 achievements. The achievements are:

- 3x3 - Get all of the [F]ront side pieces to be the same color
- 3x3x1 - Solve the entire [F]ront layer
- 3x3x3? - "Solve the cube"
- 3x3x3 - Make sure the cube is guaranteed solved

When an achievement unlocks for the first time, the achievement title and a star will appear. A checkmark will also appear if the achievement was met during the current scramble.

When the cube is scrambled, all of the checkmarks for the achievements will disappear.

### 3x3

You probably know someone who could "solve 1 side" of a Rubik's cube. In this case, I mean matching all of the colors on a single side. This achievement unlocks when all 9 stickers of the [F]ront side are the same color.

### 3x3x1

For a "side" to actually be solved on a Rubik's cube, the corners and edges need to be solved for the entire layer. To unlock this achievement, the entire [F]ront layer needs to be solved.

### 3x3x3?

There is a parity error on this cube. Because you cannot see the Up, Down, Right, and Left centers, you cannot know for certain by only looking at the [F]ront face whether you solved the cube or not. Once the cube is "solved", there is a 50% chance that the Up, Down, Right, and Left centers will be off by 180 degrees. Getting either of these 2 "solves" unlocks this achievement.

### 3x3x3

As I mentioned, there is only a 50% chance a solve happened. To guarantee a solve, this achievement requires you to "solve" the cube both ways on a single scramble.

## The Future

I hope to make an NES and Game Boy port at some point in the future. I also don't intend to have FlatCube check if a cube scramble is valid or not. If the cube is invalid, using "scramble" in the menu should make the cube valid again.

## Source Code / Compiled Game

The source code and the compiled game are available over git.

FlatCube Git Repository [HTTP]

You can pull the repository via `git` over git://, http://, or https:// at `git.vigrey.com/flatcube`.

From the root directory of the git repository, the compiled game can be found at `playdate/bin/FlatCube.pdx` and sideloaded onto a Playdate.

## Contact/Reply

If you would like to reply to this post, feel free to send me an email.

Email: vi@vigrey.com [Email]
PGP Public Key [515F AD67 F931 0A2B 9B93 CE19 814F ECB1 A398 63CE]