# FlatCube 3x3x3 puzzle cube where only 1 side is visible (Available for the Playdate and NES) FlatCube was created by Vi Grey ## Description 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 ## Achievements This game has 4 achievements: * 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 Getting an achievement will display the name of the achievement and a star indicating that the achivement has been unlocked. A checkmark will appear to show the achievement has been met for the current scramble. When the cube is "solved", there is actually only a 50% chance it is solved. There is the chance that the [U]p and [D]own centers need to be swapped and the [R]ight and [L] centers need to be swapped. Because the cube cannot be rotated, meaning the corners are fixed in place, all of the edges and corners would need to be swapped 180 degrees along the Z-axis. Getting either of these 2 solves unlocks the "3x3x3?" achievement. Because it is only 50% likely the cube is actually solved, in order to guarantee the cube got truly solved, both "solves" need to be done. Doing both "solves" on the same scramble unlocks the "3x3x3" achievement. ## Playdate The files for the Playdate version of this game can be found in the `playdate/` directory from the root of this repository. ## Playdate Controls * A - Turn [F]ront face clockwise * Up - Turn [U]p face clockwise * Down - Turn [D]own face clockwise * Right - Turn [L]eft face clockwise * Left - Turn [R]ight face clockwise * Hold B - Turns will be counterclockwise instead of clockwise ### Scramble the Cube on Playdate The cube can be scrambled using the "scramble" option when in the Playdate Menu using the "MENU" button. ### Sideloading on Playdate The Playdate version of FlatCube can be found at `playdate/bin/FlatCube.pdx` from the root of this repository. ### Build the Playdate Version Be sure to have the Playdate SDK and the `PLAYDATE_SDK_PATH` environmental variable pointing to the full path of the Playdate SDK. `pdc` is also needed and is included in the Playdate SDK. The following lines of shell code can build `FlatCube.pdx`. Just be sure to set `/path/to/` and `/path/for/` to the paths you want. ``` Shell Code PLAYDATE_SDK_PATH=/path/to/PlaydateSDK $PLAYDATE_SDK_PATH/bin/pdc playdate/src /path/for/FlatCube.pdx ``` There is also a Makefile that can be used at `playdate/Makefile` from the root of this repository that assumes `pdc` is in your `$PATH`. You can `cd` into the `playdate/` directory from the root of this repository and use `make`. ``` Shell Code PLAYDATE_SDK_PATH=/path/to/PlaydateSDK cd playdate/ make ``` The .pdx file once built using the Makefile will be located at `playdate/build/FlatCube.pdx` from the root of this repository. ## NES The files for the NES version of this game can be found in the `nes/` directory from the root of this repository. ## NES Controls * A - Turn [F]ront face clockwise * Up - Turn [U]p face clockwise * Down - Turn [D]own face clockwise * Right - Turn [L]eft face clockwise * Left - Turn [R]ight face clockwise * Hold B - Turns will be counterclockwise instead of clockwise * Start + Select - Scramble Cube ### Prebuilt NES ROM The MMC1 Mapper NES FlatCube ROM can be found at `nes/bin/flatcube.nes` and `nes/bin/flatcube-mmc1.nes` from the root of this repository. The NROM Mapper NES FlatCube ROM can be found at `nes/bin/flatcube-nrom` from the root of this repository. The MMC1 version exists so most NES emulators will behave as expected for saving and loading data. The NROM version exists because it is one of the simplest mapper types to burn the ROM onto, even if it generally gets rid of the ability to have save data. ### Build the NES ROM The NES version uses the `asm6` assembler to build the NES ROM. The following lines of shell code can build the NROM version of `flatcube.nes`. Just be sure to set `/path/to/` to the path you want and make sure `relative/path/for` is the relative path for where you want flatcube.nes to be built to relative to `/nes/src/` from the root of this repository (for example, `../../` would be the relative path for the root of this repository from `/nes/src/`). ``` Shell Code` cd nes/src/ /path/to/asm6 flatcube.asm relative/path/for/flatcube-nrom.nes ``` There is also a Makefile that can be used at `nes/Makefile` from the root of this repository that assumes `asm6` is in your `$PATH`. You can `cd` into the `nes/` directory from the root of this repository and use `make`. ``` Shell Code cd nes/ make ``` Running the Makefile will result in 3 NES ROMs located at `nes/build/bin/flatcube.nes`, `nes/build/bin/flatcube-mmc1.nes`, and `nes/build/flatcube-nrom.nes` from the root of this repository. Both `nes/build/bin/flatcube.nes` and `nes/build/bin/flatcube-mmc1.nes` are identical.