# \[Game\]Pokittris

**URL:** <https://talk.pokitto.com/t/game-pokittris/467>\
**Category:** Games\
**Tags:** arcade, release, game\
**Created:** [September 23, 2017, 7:46pm UTC](https://talk.pokitto.com/t/game-pokittris/467 "2017-09-23T19:46:24Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![spinal](https://talk.pokitto.com/user_avatar/talk.pokitto.com/spinal/32/44_2.png) [@spinal](https://talk.pokitto.com/u/spinal)\
**Post date:** [September 23, 2017, 7:46pm UTC](https://talk.pokitto.com/t/game-pokittris/467/1 "2017-09-23T19:46:24Z")

</div>

Pokittris is the first ‘Tetris’ game for Pokitto. It is based on the code for ‘Tiny Bloks’ by myself for the Arduboy.  
This is my second attempt at a tetris game, so please don’t be too harsh with the comments.  
Please enjoy.

[Pokittris Beta](http://socoder.net/uploads/124/Pokittris_beta_23_09_17.zip)  
[Pokittris 01/10/17](http://socoder.net/uploads/124/pokittris_01_10_17.zip)  
[Pokittris 02/10/17](http://socoder.net/uploads/124/pokittris_03_10_17.zip) - Latest version!

to hear the bg music in the simulator, copy pokittris.raw to the POKITTO\_SIM\bin\Debug folder (I assume there’s a better way to do that, but I don’t know it).

![](https://talk.pokitto.com/uploads/default/original/2X/c/ce9ac6c8a1db9c85610350e9d9941a8d162349d7.gif)

![](https://talk.pokitto.com/uploads/default/original/1X/842b193900d15c8e7867fd2100dd2bff33913f0a.png) ![](https://talk.pokitto.com/uploads/default/original/1X/a5f7f7385da20bc93cb32adf5e67d7bb74a2f35b.png)  
 ![](https://talk.pokitto.com/uploads/default/original/1X/4bf55137d419b9910adc7d0e72087387e670a939.gif)

As always, all comments welcome. and @Jonne - This one will probably run on hardware, nothing stupid going on that I can think of.

[edit]  
I just noticed I forgot to clear the score/lines/screen after game over, that’ll be done in the next upload.

---

<div class="post-metadata">

**Author:** ![BigBadHodad](https://talk.pokitto.com/user_avatar/talk.pokitto.com/bigbadhodad/32/330_2.png) [@BigBadHodad](https://talk.pokitto.com/u/BigBadHodad)\
**Post date:** [September 24, 2017, 3:38am UTC](https://talk.pokitto.com/t/game-pokittris/467/2 "2017-09-24T03:38:19Z")

</div>

That looks really good.  
I like the solid blocks, all the fake shape in the gb one always annoyed me.

---

<div class="post-metadata">

**Author:** ![VonBednar](https://talk.pokitto.com/user_avatar/talk.pokitto.com/vonbednar/32/239_2.png) [@VonBednar](https://talk.pokitto.com/u/VonBednar)\
**Post date:** [September 26, 2017, 1:13am UTC](https://talk.pokitto.com/t/game-pokittris/467/3 "2017-09-26T01:13:59Z")

</div>

It looks grand!

I would however make the background bricks brighter, or even only as outlines, because the dark bricks on the lower half might make it a bit harder to play on a small screen.

Alternatively, you can always make a call for some unobtrusive pixel art to be used as backgrounds.

---

<div class="post-metadata">

**Author:** ![jonne](https://talk.pokitto.com/user_avatar/talk.pokitto.com/jonne/32/6528_2.png) [@jonne](https://talk.pokitto.com/u/jonne)\
**Post date:** [September 27, 2017, 5:42pm UTC](https://talk.pokitto.com/t/game-pokittris/467/4 "2017-09-27T17:42:40Z")

</div>

@Spinal is the easing.h your own work?

Also, can I please add a bit of color?

I made a colorscheme like this and it looks pretty good

 ![](https://talk.pokitto.com/uploads/default/original/1X/26043b3482b98ae28bd11ada8147d3bd35bcd2a4.png)

Line 391 in main.cpp:

```auto
    const unsigned short *p;
    pallet[0] = game.display.RGBto565(0xff,0xff,0xff);
    pallet[1] = game.display.RGBto565(0xdb,0x00,0xdf); //db00df
    pallet[2] = game.display.RGBto565(0xf1,0x8b,0x00); //f18b00
    pallet[3] = game.display.RGBto565(0x15,0xa2,0xa7); //15a2a7
    p=pallet+(palNum*4);
    game.display.load565Palette(p);

```

---

<div class="post-metadata">

**Author:** ![Hanski](https://talk.pokitto.com/user_avatar/talk.pokitto.com/hanski/32/526_2.png) [@Hanski](https://talk.pokitto.com/u/Hanski)\
**Post date:** [September 27, 2017, 6:49pm UTC](https://talk.pokitto.com/t/game-pokittris/467/5 "2017-09-27T18:49:46Z")

</div>

Looks really nice with colors! Still, I understand that a monochrome palette has appeal to the GB fans.

Edit: There could be a selectable palette, and that could be saved to eeprom. Do we have API for eeprom, and some system so that we are not using the same slots with different games?

---

<div class="post-metadata">

**Author:** ![spinal](https://talk.pokitto.com/user_avatar/talk.pokitto.com/spinal/32/44_2.png) [@spinal](https://talk.pokitto.com/u/spinal)\
**Post date:** [September 27, 2017, 7:14pm UTC](https://talk.pokitto.com/t/game-pokittris/467/6 "2017-09-27T19:14:49Z")

</div>

nope, easing.h is stolen from jquery. I changed it a tiny bit to be C rather than javascript, but other than that I did nothing to it. As for the colour, sure add whatever you want. There is a range of palettes already in the source, I do intend of adding a little effect just to integrate the colours into the gameplay a little more.

---

<div class="post-metadata">

**Author:** ![jonne](https://talk.pokitto.com/user_avatar/talk.pokitto.com/jonne/32/6528_2.png) [@jonne](https://talk.pokitto.com/u/jonne)\
**Post date:** [September 27, 2017, 7:18pm UTC](https://talk.pokitto.com/t/game-pokittris/467/7 "2017-09-27T19:18:14Z")

</div>

> [@Hanski](#):
>
> Still, I understand that a monochrome palette has appeal to the GB fans.

You have a color TFT and you want to make it look like a monochrome LCD? Yea, I guess it makes sense! No seriously: I am going to start constructing the games page within two days and Pokittris is a really good advert for Pokitto - but better when in color, IMHO.

---

<div class="post-metadata">

**Author:** ![Hanski](https://talk.pokitto.com/user_avatar/talk.pokitto.com/hanski/32/526_2.png) [@Hanski](https://talk.pokitto.com/u/Hanski)\
**Post date:** [September 27, 2017, 7:29pm UTC](https://talk.pokitto.com/t/game-pokittris/467/8 "2017-09-27T19:29:25Z")

</div>

[http://luftrausers.com/](http://luftrausers.com/)

---

<div class="post-metadata">

**Author:** ![Pharap](https://talk.pokitto.com/user_avatar/talk.pokitto.com/pharap/32/10364_2.png) [@Pharap](https://talk.pokitto.com/u/Pharap)\
**Post date:** [September 27, 2017, 8:36pm UTC](https://talk.pokitto.com/t/game-pokittris/467/9 "2017-09-27T20:36:13Z")

</div>

I know what you mean, you want to show off the Pokitto’s colour abilities because that’s one of its main selling points that sets it apart from certain similar devices.

But I must admit, retroism and nostalgia can sell well too.

Personally I think multiple colour palettes is the best route to go, since that gives you an extra feature to advertise:

“Pokittris, featuring multiple palettes: Technicolour and Retro”

 ![](https://talk.pokitto.com/uploads/default/original/1X/4a212053c0211f3d84a5cd99ecbaffa609e73cb0.jpg)

(Please excuse the badly put together image, it was the best I could do on short notice.)

> [@spinal](#):
>
> easing.h is stolen from jquery

Somehow I’m not surprised.

Changing the state of variables mid-expression and code littered with magic numbers is the sort of thing I’d expect from a Javascript library.

---

<div class="post-metadata">

**Author:** ![jonne](https://talk.pokitto.com/user_avatar/talk.pokitto.com/jonne/32/6528_2.png) [@jonne](https://talk.pokitto.com/u/jonne)\
**Post date:** [September 28, 2017, 1:02pm UTC](https://talk.pokitto.com/t/game-pokittris/467/10 "2017-09-28T13:02:02Z")

</div>

Now I have a mindless urge to do exactly on hardware what you have shown in the picture, ie. graphics output split in the middle, with palette being flipped in between.

---

<div class="post-metadata">

**Author:** ![Pharap](https://talk.pokitto.com/user_avatar/talk.pokitto.com/pharap/32/10364_2.png) [@Pharap](https://talk.pokitto.com/u/Pharap)\
**Post date:** [September 28, 2017, 1:18pm UTC](https://talk.pokitto.com/t/game-pokittris/467/11 "2017-09-28T13:18:53Z")

</div>

That’s completely crazy!..

Though probably possible.  
A horizontal or vertical split would be easier than diagonal though.

Maybe add it to the ‘to do’ list and have a crack at it when you’ve got the bulk of the Pokittos shipped, or at least enough staff to handle it.

---

<div class="post-metadata">

**Author:** ![jonne](https://talk.pokitto.com/user_avatar/talk.pokitto.com/jonne/32/6528_2.png) [@jonne](https://talk.pokitto.com/u/jonne)\
**Post date:** [September 28, 2017, 1:20pm UTC](https://talk.pokitto.com/t/game-pokittris/467/12 "2017-09-28T13:20:51Z")

</div>

> [@Pharap](#):
>
> Maybe add it to the ‘to do’ list and have a crack at it when you’ve got the bulk of the Pokittos shipped

Which is _exactly_ why you should think before posting stuff like that here!

---

<div class="post-metadata">

**Author:** ![crait](https://talk.pokitto.com/user_avatar/talk.pokitto.com/crait/32/1221_2.png) [@crait](https://talk.pokitto.com/u/crait)\
**Post date:** [September 28, 2017, 3:36pm UTC](https://talk.pokitto.com/t/game-pokittris/467/13 "2017-09-28T15:36:33Z")

</div>

It would be cool to have the ability to change the pallet in-game.

---

<div class="post-metadata">

**Author:** ![jonne](https://talk.pokitto.com/user_avatar/talk.pokitto.com/jonne/32/6528_2.png) [@jonne](https://talk.pokitto.com/u/jonne)\
**Post date:** [September 28, 2017, 3:39pm UTC](https://talk.pokitto.com/t/game-pokittris/467/14 "2017-09-28T15:39:51Z")

</div>

Its very very easy. But maybe its up to @spinal. “C” button is free

---

<div class="post-metadata">

**Author:** ![spinal](https://talk.pokitto.com/user_avatar/talk.pokitto.com/spinal/32/44_2.png) [@spinal](https://talk.pokitto.com/u/spinal)\
**Post date:** [September 28, 2017, 4:02pm UTC](https://talk.pokitto.com/t/game-pokittris/467/15 "2017-09-28T16:02:05Z")

</div>

Actually, I have been messing with the code a little today.  
Give this a try…

[pokittris\_28\_09\_17.zip](http://socoder.net/uploads/124/pokittris_28_09_17.zip)

Once you play bad enough for the tiles to reach half way up the screen, the palette will turn red depending on how full the top half of the screen is.  
Also, added the game over gfx. @jonne does it run on hardware?

---

<div class="post-metadata">

**Author:** ![jonne](https://talk.pokitto.com/user_avatar/talk.pokitto.com/jonne/32/6528_2.png) [@jonne](https://talk.pokitto.com/u/jonne)\
**Post date:** [September 28, 2017, 4:02pm UTC](https://talk.pokitto.com/t/game-pokittris/467/16 "2017-09-28T16:02:40Z")

</div>

Trying this on HW right now

---

<div class="post-metadata">

**Author:** ![spinal](https://talk.pokitto.com/user_avatar/talk.pokitto.com/spinal/32/44_2.png) [@spinal](https://talk.pokitto.com/u/spinal)\
**Post date:** [September 28, 2017, 4:03pm UTC](https://talk.pokitto.com/t/game-pokittris/467/17 "2017-09-28T16:03:51Z")

</div>

Perhaps a video…?

---

<div class="post-metadata">

**Author:** ![jonne](https://talk.pokitto.com/user_avatar/talk.pokitto.com/jonne/32/6528_2.png) [@jonne](https://talk.pokitto.com/u/jonne)\
**Post date:** [September 28, 2017, 4:08pm UTC](https://talk.pokitto.com/t/game-pokittris/467/18 "2017-09-28T16:08:44Z")

</div>

Compiles Ok, 91kB… digging out a Pokitto

---

<div class="post-metadata">

**Author:** ![Pharap](https://talk.pokitto.com/user_avatar/talk.pokitto.com/pharap/32/10364_2.png) [@Pharap](https://talk.pokitto.com/u/Pharap)\
**Post date:** [September 28, 2017, 4:14pm UTC](https://talk.pokitto.com/t/game-pokittris/467/19 "2017-09-28T16:14:27Z")

</div>

> [@jonne](#):
>
> Which is exactly why you should think before posting stuff like that here!

In fairness I just made the image as a sort of advertising gimmick.  
I wasn’t expecting it to spark a “let’s make this a feature” vibe `:P`.

---

<div class="post-metadata">

**Author:** ![jonne](https://talk.pokitto.com/user_avatar/talk.pokitto.com/jonne/32/6528_2.png) [@jonne](https://talk.pokitto.com/u/jonne)\
**Post date:** [September 28, 2017, 4:14pm UTC](https://talk.pokitto.com/t/game-pokittris/467/20 "2017-09-28T16:14:30Z")

</div>

Runs very slow. Something wrong with Game loop timing.

Looks awesome though

@spinal if I press down to drop the block it goes fast, but the norma “fall is veeeery slow”

I suspect this has something to do with the easing?

[Next page](https://talk.pokitto.com/t/game-pokittris/467.md?page=2)
