Flappy Birdo

Share your games and programs with the community.

Flappy Birdo

Postby Jerom » Fri Apr 10, 2015 12:44 am

Image
Nothing original, just another clone of Flappy Bird :P

- difficulty level menu (FAST is the easiest difficulty)
- sound can be muted ingame with "B"
- highscore is saved for each level (is not saved in .sav file though, but only when the game is loaded).
Attachments
FlappyBirdo.zip
(93.35 KiB) Downloaded 679 times
Last edited by Jerom on Mon Apr 13, 2015 12:49 pm, edited 4 times in total.
User avatar
Jerom
 
Posts: 58
Joined: Tue Mar 31, 2015 4:47 pm
Location: France

Re: Flappy Birdo

Postby Skyrunner65 » Fri Apr 10, 2015 2:49 am

I'd consider changing the name, just in case good old Dong Nguyen gets mad.( :lol: What a name.)
Be lucky that he isn't a Big Company.
Also, not everyone has 7-Zip (They should, really.), so I would consider making it a .zip .
Finally, whenever I die and it sends me back to the Title Screen, I have to reset the console for it to work(I recommend checking out my Smash and Crash code for a good example).

Still, great game. It actually has sound, great graphics, and good gameplay (CURSE YOU, FIRST PIPE!). :lol:
User avatar
Skyrunner65
 
Posts: 371
Joined: Thu Mar 20, 2014 5:37 pm
Location: NC,USA

Re: Flappy Birdo

Postby Jerom » Fri Apr 10, 2015 9:54 am

Skyrunner65 wrote:I'd consider changing the name, just in case good old Dong Nguyen gets mad.( :lol: What a name.)
Be lucky that he isn't a Big Company.

Hehehe I'll take risk and keep the name :P (Hundred of clones with spoof names has been made during several game-jams this last year...)

Also, not everyone has 7-Zip (They should, really.), so I would consider making it a .zip .

Good suggestion (yeah, a 7-zip file has a better compression than zip file...).

Finally, whenever I die and it sends me back to the Title Screen, I have to reset the console for it to work(I recommend checking out my Smash and Crash code for a good example).

Thank you, I was searching an example indeed!

Edit... so I just have to put gb.changegame() into void initGame()?! that's really easy!
Code: Select all
void setup() {
  gb.begin();
  gb.titleScreen(titleBitmap);
}
void initGame() {
  gb.changeGame();
}
User avatar
Jerom
 
Posts: 58
Joined: Tue Mar 31, 2015 4:47 pm
Location: France

Re: Flappy Birdo

Postby clement » Sat Apr 11, 2015 7:32 am

Hi ,

it's not a good idea to go to the game selection.

i modify you code to return to the title screen :

Code: Select all
//SETUP
void setup() {
  gb.begin();
  initGame();
}
void initGame() {
  gb.titleScreen(titleBitmap);
  gb.pickRandomSeed();
  gb.titleScreen(titleBitmap);
  gb.pickRandomSeed(); //randomize an original random every restart.
  pipesStart(); //each pipes starts at a random height.
  //gb.changeGame(); //Really reset the game without pressing "C" two times...
  //gb.titleScreen(F("FLAPPY BIRD clone\n \n\ ARROWS+A to fly.\n C to reset."));
  //gb.battery.show = false;
  player_y = ((LCDHEIGHT - GROUNDH) / 2); //the player starts at the middle of the LCD screen height minus the ground height.
  gravity = 0; //gravity variable.
  player_death = false;
  player_animation = 0;
  score = 0;
  score_timer = - PLAYERX - (PLAYERW / 2);
  score_units = 0;
  int score_maxreached = 0;
  gameover_timer = 0;
}


++
clement
 
Posts: 161
Joined: Sat Oct 25, 2014 8:06 am

Re: Flappy Birdo

Postby Jerom » Sat Apr 11, 2015 9:44 am

clement wrote:it's not a good idea to go to the game selection.

Thank you for your help, the files are fixed!
So I understand why it's better to reset each variables, but why the previous solution wasn't a good idea?
User avatar
Jerom
 
Posts: 58
Joined: Tue Mar 31, 2015 4:47 pm
Location: France

Re: Flappy Birdo

Postby Skyrunner65 » Sat Apr 11, 2015 7:34 pm

The way that I have done it is this:
Code: Select all
void loop(){
  gb.battery.show = false;
  switch(gb.menu(menu, MENULENGTH)){
    case -1: //nothing selected
      titlescreen();
      break;
    case 0: //Load Survival
      gb.display.print(F("    Loading...."));
        gb.pickRandomSeed();
        playerx = 20;
        playery = 20;
        playerflip = NOFLIP;
        playerxv = 2;
        playeryv = 1;
        playergrav = 1;
        meteory = 0;
        meteorx = random(0,76);
        arrowx = 0;
        arrowy = random(20,40);
        alive = true;
        play();
      break;

That's an excerpt from my code.
This sets up variables for the game itself.
Note the play() part; That links over to my player.ino:
Code: Select all
void play(){
  while(true){
    if(gb.update()){
      if(alive == true){
        frames = frames + 1;
       

This is the beginning of the play() function.
The alive variable tell the game they are still alive or dead.
Say I hit a meteor:
Code: Select all
        if(gb.collideBitmapBitmap(playerx, playery, player, meteorx, meteory, meteor) == true){
          alive = false;
        };

Okay, I'm dead. Now what?
Code: Select all
if(alive == false){
        gb.display.setFont(font3x5);
        gb.display.cursorX = 0;
        gb.display.cursorY = 0;
        gb.display.println("You died!");
        ......
        if (gb.buttons.pressed(BTN_B)){
          gb.sound.playCancel();
          frames = 0;
          gb.display.setFont(font5x7);
          break;
          break;
          break;
          };
        };
      };
    };
  };

When the player presses B, it does a few things, then breaks out of the play() function and back to the menu (shown above).
This essentially makes a loop. Got it?
clement wrote:It's not a good idea to go to the game selection.

Really? I have it so that you only really need to see the title screen once, and instead of a button labeled "Title Screen", there is "Change Game".
User avatar
Skyrunner65
 
Posts: 371
Joined: Thu Mar 20, 2014 5:37 pm
Location: NC,USA

Re: Flappy Birdo

Postby clement » Sun Apr 12, 2015 3:53 pm

clement wrote:
It's not a good idea to go to the game selection.


Really? I have it so that you only really need to see the title screen once, and instead of a button labeled "Title Screen", there is "Change Game".


My english is not very weel ;) and my word could misunderstood.

I would tell , if you return to the loader each time you die the player became crazy.

mainly for a die and retry game.

moreover my code is not very well (I do it very fast for my daughter).

I can forget initialization variable (the position of game over screen for exemple)


otherwise I find the games very cool!

a dificulty choice will be very appreciate. (change speed of the bird for exemple)


thx for the share jerom !
clement
 
Posts: 161
Joined: Sat Oct 25, 2014 8:06 am

Re: Flappy Birdo

Postby Jerom » Sun Apr 12, 2015 5:39 pm

clement wrote:I would tell , if you return to the loader each time you die the player became crazy... mainly for a die and retry game.

Oh ok, I see what you mean! Unless the player press 'C', I should skip the titlescreen everytime the player die, and start the level directly at the beginning, with the bird already flying. Indeed, it's faster in this way!

It's coded now, and I'll try to add a difficulty selection screen for the next version.
User avatar
Jerom
 
Posts: 58
Joined: Tue Mar 31, 2015 4:47 pm
Location: France

Re: Flappy Birdo

Postby clement » Mon Apr 13, 2015 6:08 pm

I just test the new version and it is good. I prefer the faster mode
clement
 
Posts: 161
Joined: Sat Oct 25, 2014 8:06 am


Return to Games Gallery

Who is online

Users browsing this forum: No registered users and 14 guests

cron