- Mahjong CE
- 29 Nov 2018 10:00:54 pm
- Last edited by commandblockguy on 11 Apr 2019 08:55:49 pm; edited 2 times in total
Download link is here!
(end necro-edit, begin original first post)
------------------------------------------------------------------------------------------------------------------
Alright, hopefully I can actually get a project into the POTM this time. This will be significantly less impressive than my USB stuff (at least IMO), but hopefully it won't take too long to finish.
If it wasn't immediately obvious from the title, I'm making Mahjong Solitaire for the CE. I'm writing it in C, as assembly's speed isn't a necessity and I find C a bit easier to use for larger projects than ICE. Graphically, I'm loosely basing it off of GNOME's mahjongg, but I am implementing the backend stuff differently.
My implementation uses a 3D array of tiles, with each tile consisting of two bits of "offset" data and six bits of type data. If an offset bit for a particular location in the array is set, the tile is actually located either half a unit to the right or half a unit to the top of where it would normally be. This probably isn't the best way to store the locations of tiles but I'll roll with it.
I'm finished with tile rendering for the most part, here's an sample image which uses the one sprite that I've made so far:
Still left to do: the remaining 35 sprites, formatting starting layouts, generating a level, determining whether a tile is removable (which I have the logic planned out for), handling user input, storing high scores, and the main menu.