Hard mode is added in this update, I couldn’t get pass pipe 10!
Also a strange bug that causes the Hi-Score of Hard Mode to be changed to 256.
If you can please tell me the problem I will turn that frown emoji into a smile one.
I created a little Flappy Bird clone for the Arduboy.
It’s name is Flappy Birdie.
It’s pretty similiar to Flappy Bird
This is the first game I made for the Arduboy.
Please tell me if you found a bug so I can fix it in future releases.
Press A to make the little birdie fly!
Avoid hitting pipes or crashing into the ground.
The game gets a little bit harder after reaching 10, 20 and 50 points.
Source code is available here:
Also if anyone is interested in Flappy Bird, it’s available for Android and iOS.
Just an F.Y.I.:
The Arduboy2 library contains functions for controlling the RGB LED. By replacing the Arduino pin functions that you’re using with Arduboy2 functions, you can save 392 bytes of code.
You can remove line 50: pinMode(RED_LED, OUTPUT);
The library already sets the RGB LED to the proper mode.
I ingored it for some time, but I want to fix it just in case it causes errors.
Since you helped me already, I thought to myself maybe you can help me again? Possibly?
Anyway, you probably already noticed it but when compiling, it says this:
warning: narrowing conversion of ‘((pipe[i].Pipe::level + 16) * 2)’ from ‘int’ to ‘uint8_t {aka unsigned char}’ inside { } [-Wnarrowing]
That warning doesn’t appear to be for the block of code you posted, unless you’ve tweaked it since the warning was generated.
What the warning means is that the width and height fields of Rect are uint8_t (which are 8 bits wide), but the operations you’re using convert them into int (which is 16 bits wide on the Arduboy) so they have to be ‘narrowed’ down to 8 bits to fit.
It’s a warning because the upper 8 bits are lost as a result of the narrowing conversion from int to uint8_t, so the compiler tells you to make sure you’re not making a mistake.
If you’re sure that you want to narrow the result to 8 bits then you can wrap the value in a static cast, e.g.
Rect pipe2Rect = Rect { pipe[i].x, pipe[i].y + 68 - pipe[i].level * 2, 16, static_cast<uint8_t>(32 + pipe[i].level * 2) };
If you need Rects with a height or width of more than 255 then you’ll need to write your own version of Rect.
@GameExpress,
You may also wish to address other warnings that are generated by your code at higher compiler warning levels. In the Arduino IDE go into preferences: File > Preferences
and select Compiler warnings:All
(You don’t have to worry about the warnings from EEPROM.h since they’re not from your code.)
Hi, I just got my Arduboy. I managed to transfer the game and it plays well, but there is no sound. I don’t know much about programming so please bare with me.
No i didn’t use it. And for some reason i have encountered the same problem again. I transfered the game again, unmuted the system, but there is no sound. Also from time to time there is this bug where if I pause i get points while paused at a rapid speed…
There ought to be some kind of licence agreement or copyright notice.
Even closed source games have EULAs to stop people disassembling the compiled code.
Otherwise how can anyone know how many copies they’re allowed to keep or what they’re not allowed to do?
There at least needs to be a copyright notice stating things like “you may keep as many copies of the file as you like” and “you may not attempt to disassemble the code”.
It permits sharing, forces people to give credit to you, prevents people from using the game for commercial purposes and prevents people making derivatives.
If you don’t mind me asking, is there a particular reason you don’t want to permit derivatives?
It’s quite unusual for Arduboy games to not allow derivatives, and the others that don’t tend to be completely closed source (i.e. they don’t make the source code available, just the .hex file).
Shoot, theres already a flappy bird clone on here
I kinda want to port the clone I made with python on my Github to the arduboy, not sure if I should do it now.