Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
denismr authored Mar 3, 2019
1 parent 2568313 commit 0a79600
Show file tree
Hide file tree
Showing 6 changed files with 760 additions and 0 deletions.
7 changes: 7 additions & 0 deletions My_settings.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#ifndef MY_SETTINGS_H
#define MY_SETTINGS_H

#define PROJ_SCREENMODE 2
#define PROJ_ENABLE_SOUND 0

#endif
25 changes: 25 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Raquer * Mete

It's a clone of the minigame [Hack*Match](https://www.youtube.com/watch?v=socMP6jpA_A) in the excellent [Exapunks](http://www.zachtronics.com/exapunks/), made for the [Pokitto](https://www.pokitto.com/).

It's a rather faithful clone, including freezing time, combos, bombs, and same number of lines and columns. The most notable missing feature is the speed not increasing over time in this version.

The game does not have sound, at least yet. I may add sfx later on. I may also fine-tune freenzing time, bomb rate, falling speed, the **color palette**, etc.

You can find a video of the game running on the [emulator](https://github.com/felipemanga/PokittoEmu) with this [link](https://youtu.be/QAOuVoEG2bc) and on the **actual Pokitto** [here](https://youtu.be/mi8BovujRD0).

Disclaimer about the name: it's a joke that only makes sense in Portuguese.

**Have fun!**

## Note
First, I coded this game exclusively for fun.

This code is a *complete* mess and sure isn't a good depiction of the usual quality of my code.
I'll admit that I have almost null experience with embedding programming. I just *felt* (with some reasoning) like the right thing to do would be to avoid any and all use of the heap (especially for larger structures), and also that I should store the most heavy and the most used structures as globals (although I'm usually strongly against global variables in any circumstance).

Then one bad thing thing leads to another, and at the end of the day, I was writing important literals like the number of rows and columns inline so that changing even this minor aspect now is a headache :)

I'd rather not comment about the currently impossibility of writing unit tests for this.

I'm sorry for that. It was nonetheless a fun day coding it, the game **works** on the Pokitto (and on the [emulator](https://github.com/felipemanga/PokittoEmu) as well) and I finally can play it anywhere.
181 changes: 181 additions & 0 deletions assets.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
#ifndef ASSETS_H
#define ASSETS_H

#include <inttypes.h>

static const uint16_t game_palette[] = {
0x18c3, 0xea06, 0x88a1, 0xf3a6,
0x91c1, 0xffb3, 0x9440, 0x7e08,
0x4b84, 0x0499, 0x0352, 0xce59,
0x7bcf, 0x4a69, 0x80e7, 0x29aa,
};

static const uint8_t sprite_piece1[] = {
8,8,
0x01,0x11,0x11,0x00,
0x11,0x11,0x11,0x10,
0x11,0x21,0x21,0x12,
0x12,0x22,0x22,0x12,
0x11,0x22,0x21,0x12,
0x11,0x12,0x11,0x12,
0x01,0x11,0x11,0x22,
0x00,0x22,0x22,0x20,
};

static const uint8_t sprite_piece2[] = {
8,8,
0x03,0x33,0x33,0x00,
0x33,0x33,0x33,0x30,
0x33,0x44,0x43,0x34,
0x34,0x43,0x44,0x34,
0x33,0x44,0x43,0x34,
0x33,0x33,0x33,0x34,
0x03,0x33,0x33,0x44,
0x00,0x44,0x44,0x40,
};

static const uint8_t sprite_piece3[] = {
8,8,
0x05,0x55,0x55,0x00,
0x55,0x55,0x55,0x50,
0x55,0x65,0x65,0x56,
0x55,0x55,0x55,0x56,
0x56,0x66,0x66,0x56,
0x55,0x66,0x65,0x56,
0x05,0x55,0x55,0x66,
0x00,0x66,0x66,0x60,
};

static const uint8_t sprite_piece4[] = {
8,8,
0x07,0x77,0x77,0x00,
0x77,0x28,0x87,0x70,
0x78,0x88,0x88,0x78,
0x78,0x88,0x82,0x78,
0x77,0x78,0x77,0x78,
0x77,0x78,0x77,0x78,
0x07,0x77,0x77,0x88,
0x00,0x88,0x88,0x80,
};

static const uint8_t sprite_piece5[] = {
8,8,
0x09,0x99,0x99,0x00,
0x99,0x9b,0x99,0x90,
0x99,0xba,0xa9,0x9a,
0x9a,0xaa,0xaa,0x9a,
0x99,0xaa,0xa9,0x9a,
0x99,0x9a,0x99,0x9a,
0x09,0x99,0x99,0xaa,
0x00,0xaa,0xaa,0xa0,
};

static const uint8_t sprite_pieceQ[] = {
8,8,
0x0b,0xbb,0xbb,0x00,
0xbb,0xcc,0xcb,0xb0,
0xbb,0xbb,0xcb,0xbc,
0xbb,0xbc,0xcb,0xbc,
0xbb,0xbb,0xbb,0xbc,
0xbb,0xbc,0xbb,0xbc,
0x0b,0xbb,0xbb,0xcc,
0x00,0xcc,0xcc,0xc0,
};

static const uint8_t sprite_combo[] = {
8,8,
0x01,0x11,0x11,0x00,
0x12,0x22,0x22,0x10,
0x12,0x01,0x00,0x12,
0x12,0x11,0x10,0x12,
0x12,0x01,0x22,0x12,
0x12,0x00,0x20,0x12,
0x01,0x11,0x11,0x22,
0x00,0x22,0x22,0x20,
};

static const uint8_t sprite_bomb1[] = {
8,8,
0x00,0xbb,0xb0,0x00,
0x0b,0xbb,0xbb,0x00,
0xbb,0x1b,0x1b,0xb0,
0xb1,0x11,0x11,0xbc,
0xbb,0x11,0x1b,0xbc,
0x0b,0xb1,0xbb,0xcc,
0x00,0xbb,0xbc,0xc0,
0x00,0x0c,0xcc,0x00,
};

static const uint8_t sprite_bomb2[] = {
8,8,
0x00,0xbb,0xb0,0x00,
0x0b,0xbb,0xbb,0x00,
0xbb,0x33,0x3b,0xb0,
0xb3,0x3b,0x33,0xbc,
0xbb,0x33,0x3b,0xbc,
0x0b,0xbb,0xbb,0xcc,
0x00,0xbb,0xbc,0xc0,
0x00,0x0c,0xcc,0x00,
};

static const uint8_t sprite_bomb3[] = {
8,8,
0x00,0xbb,0xb0,0x00,
0x0b,0xbb,0xbb,0x00,
0xbb,0x5b,0x5b,0xb0,
0xbb,0xbb,0xbb,0xbc,
0xb5,0x55,0x55,0xbc,
0x0b,0x55,0x5b,0xcc,
0x00,0xbb,0xbc,0xc0,
0x00,0x0c,0xcc,0x00,
};

static const uint8_t sprite_bomb4[] = {
8,8,
0x00,0xbb,0xb0,0x00,
0x0b,0x18,0x8b,0x00,
0xb8,0x88,0x88,0xb0,
0xb8,0x88,0x81,0xbc,
0xbb,0xb8,0xbb,0xbc,
0x0b,0xb8,0xbb,0xcc,
0x00,0xbb,0xbc,0xc0,
0x00,0x0c,0xcc,0x00,
};

static const uint8_t sprite_bomb5[] = {
8,8,
0x00,0xbb,0xb0,0x00,
0x0b,0xb9,0xbb,0x00,
0xbb,0x99,0x9b,0xb0,
0xb9,0x9b,0x99,0xbc,
0xbb,0x99,0x9b,0xbc,
0x0b,0xb9,0xbb,0xcc,
0x00,0xbb,0xbc,0xc0,
0x00,0x0c,0xcc,0x00,
};

static const uint8_t sprite_marked[] = {
8,8,
0x01,0x11,0x11,0x00,
0x12,0x22,0x22,0x10,
0x12,0x00,0x00,0x12,
0x12,0x00,0x00,0x12,
0x12,0x00,0x00,0x12,
0x12,0x00,0x00,0x12,
0x01,0x11,0x11,0x22,
0x00,0x22,0x22,0x20,
};

static const uint8_t sprite_grabber[] = {
16,8,
0x00,0x00,0xfb,0xff,0xff,0xbf,0x00,0x00,
0x00,0x00,0xdb,0xbc,0xcb,0xbd,0x00,0x00,
0x70,0x00,0xfd,0xc9,0x9c,0xdf,0x00,0x01,
0x86,0x00,0xff,0xda,0xad,0xff,0x00,0x32,
0xc6,0xc0,0xfc,0xbd,0xdb,0xcf,0x0c,0x4c,
0x0c,0xdb,0xbb,0xbb,0xbb,0xbb,0xbd,0xc0,
0x0d,0xdc,0xbb,0x42,0x86,0xbb,0xcd,0xd0,
0x00,0xdd,0xdd,0xff,0xff,0xdd,0xdd,0x00,
};

#endif
Loading

0 comments on commit 0a79600

Please sign in to comment.