Playing Field: 10(V)x5(H) Parts: Single Blocks Part Movement: Slowly falling controlled by player Horizontal Starting Distribution: Random
Scoring:
+1 point: Height of each Block stacked +20 points: Each completed row of Blocks
Failure Mode: Allowing Blocks to stack completely to the top
Controls:
Up: Does Nothing Right/Left: Move falling Block Down: Drop falling Block A/B: Drop falling Block & Continue
This is my first complete Arduboy game Iâve ever made and it was an absolute blast. Thank you so much for the help from @MLXXXp@Pharap and @filmote for getting this up and running. I wasnât originally going to make a game for this but I was playing âTetris for idiotsâ game that comes with Raspberry pi (lawyers??? ugh⌠anywaysâŚ) and couldnât stop laughing. Hopefully you get some laughter out of this too! Enjoy!
The source code is available here:
Note:
As I have enough Arduboys and other prizes already, you beautiful people can vote for my game but it doesnât effect the prize ranking. (i.e. if for some reason you kind people ranked my game 3rd, then actually the person who is 4th steps up and so-on down the line)
Before anyone asks, there is no EEPROM implementation for saving high scores because I didnât want to wear it down for such a silly game. Itâs something you can easily add on your own, but I donât really want to.
My thought would be to save it when you hold the up button when you are dead.
I did implement something to catch resets because I was corrupting the magic number. Usually this means you need to use flashlight mode to re-program the Arduboy.
This isnât fool-proof, it doesnât work all of the time, but it does work most of the time, but if you still have flash space available this little snippet can make your game easier to reprogram, although, it is less important with the advent of the FX bootloaderâŚ
I got the RAM down to 71%.
All it took was some fixed points and getting rid of boundL and boundR.
(Though you could also get rid of buffer if you used the FlashStringHelper trick to print the words directly rather than copying them to an intermediary buffer.)
Iâll ask the same question I always do:
Why are you using boot() instead of begin()?
The intent of boot() is to provide a way to save program memory if you need more to squeeze your game in. Your game uses only around half the available program memory, so thatâs not a valid reason.
If itâs to suppress the boot logo, so the game starts faster, there are two prescribed ways that allow the user to do this if they want to:
Press and hold the Right D-pad button when powering on, or press it any time while the logo is scrolling down. The the game will begin as soon as the button is released.
Load the SetSystemEEPROM example sketch provided in the Arduboy2 library File > Examples > Arduboy2 > SetSystemEEPROM
Set the âShow boot logoâ flag to âNOâ. The boot logo will then be skipped on that Arduboy for all sketches that use the Arduboy2 library. Itâs also possible to retain the logo sequence but suppress the flashing of the RGB LED, if desired, using the âShow boot LEDsâ flag.
And note that you havenât called arduboy.systemButtons() in setup(), for audio mute control (which using begin() would have). Since your game itself doesnât provide any way of turning sound on and off, you havenât given the user any way to mute or enable the sounds that your game generates.
If IDE preference âShow verbose output during: compilationâ is set, you get 4 compile warnings. At least one of them: comma operator has no effect
may be a bug.
There are many cases where 128 is used as an X coordinate, such as in drawRect() and fillRect() calls. Since on screen X coordinates are from 0 to 127 you are drawing a lot of stuff off screen. The same is true for Y coordinates of 64 or greater. Also, using WIDTH and HEIGHT instead of hard coding 128 and 64 may improve readability and could make the code easier to port to different display sizes if done properly.
You should use BLACK and WHITE to specify colours instead of hard coding 0 and 1.
All of the lines you draw are either horizontal or vertical. You could reduce code size and possibly make calculations easier by using drawFastHLine() or drawFastVLine() instead of drawLine().
Macro names for #defines traditionally should be all upper case with underscores to separate words. However, you would be better to keep the lower case names youâre using now but change the #defines to constexpr variables.
E.g.:
from: #define boardWidth 5
to: static constexpr boardWidth = 5;
I canât even put into words how much I hate the boot logo and these other solutions.
BIG. FAT. NAH.
Excellent observations, I care about none of them.
UPDATE: comma operator has no effect, I do care about this I was trying to do something like
a_button, b_button = 0; but I found out it doesnât work I thought I removed instances of it.
I should really probably say Thank you to the kind words people have said about the game!
The gameplay is intentionally âsillyâ. Basically, as I see it the actual âgameplayâ is that you mash buttons until a row gets too close for comfort from the top, maybe 7 or 8 rows. Then you have to slow down and clear some lines, then you can get back to mashing. Sometimes though even when you get to 8 rows, it randomly drops on that one, then you have 9, then you are really in trouble!
When you play on the hardware, it has sound, and the pitch of the tone increases each block you stack so you also get audio feedback you are getting close to the top, and is another cue that you need to slow down and clear things out.
Itâs also supposed to give you a moment to think about the meaning of life. In some ways I think Tetris is a great model for getting things done in life and how you go about working on problems. This game is like that too, but more simple. Sometimes you just gotta smash those buttons and work real hard and trust that everything will be fine, but you also have to pay attention and slow down even if the task at hand is very simple. But even when you are doing that, you wonder, âdo the choices I am making even matter?â. And in this game, yeah, a little bit, but not as much as you might like.
With this in mind, maybe the scoring could be more like Tetris. With Tetris, you get more points the more rows you clear at once (clearing 4 rows is called a âTetrisâ). Also with Tetris, if the game supports a âhard dropâ you get more points the greater the height the piece is dropped from.
For this game, I could see 2 ways of doing this kind of thing:
The same as Tetris, award more points the higher the piece is when dropped.
Since only one row can be cleared at a time, you canât award more points for multiple rows. Instead, you could award more points based on how many total blocks are currently on the board when a row is cleared.
And of course, like Tetris, you could gradually, or in steps, increase the speed that the blocks fall, either by time, by points or by the number of rows cleared, so the game canât go on forever.
The points are designed to encourage line clearing under all circumstances. The reason they give you more points when you stack them is to theoretically encourage stacking the blocks higher on each other.
But really, if you mash the buttons you can often get high scores of 1200 pretty quickly, but even âscore drivenâ meticulous play of clearing each line you probably would only get a few hundred points.
Thatâs kind of part of the life lesson. âWhy am I doing any of thisâ