How do I add score to a flappy bird style game?

0 favourites
  • 9 posts
From the Asset Store
The "Flying bird" game assets. The characters have been created with inspiration from popular mobile games
  • Hi,

    I've made many attempts to add scoring to Tappy Plane. My son wanted us to have a hobby something we could do together and since we both like games he suggested making games. So we are complete novices. So we've been trying to stick to simple stuff. We did the tutorial for Ghost Shooter and it turned out good. But my son wanted to do a flappy bird style game. So we gave it a try the only thing we can't seem to figure out is how to add scoring. I have read and watched tutorials but i must be missing something because it doesn't seem to work out. Any help would be greatly appreciated. Thanks in advance for any help.

  • Could try storing it in LocalStorage.

  • Could try storing it in LocalStorage.

    I've tried storage and whatever else i can think of but it's just not only saving the score its getting a scoring system implemented in the game at all. I'm going to keep trying to figure it out and maybe i'll figure it out eventually. Any help is appreciated.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • dwesley

    Have you taken a look at the Flappy Bird tutorial here?

    https://www.scirra.com/tutorials/857/fl ... 10-minutes

    The tutorial itself doesn't cover the scoring, but the included capx has scoring in it.

    Another possible way is to position an invisible sprite block over the pipes and when the player overlaps it would add +1 to the score variable.

  • dwesley

    Have you taken a look at the Flappy Bird tutorial here?

    https://www.scirra.com/tutorials/857/fl ... 10-minutes

    The tutorial itself doesn't cover the scoring, but the included capx has scoring in it.

    Another possible way is to position an invisible sprite block over the pipes and when the player overlaps it would add +1 to the score variable.

    I have tried the Flappy Bird tutorial but I must have did something wrong. I haven't tried your second suggestion. I will give it a try. Thanks for the help. <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile" />

  • So I'm working on exactly the same type of game and this is what I implemented (I'm assuming you have a pipe sprite called "Pipe" and a bird sprite called "Bird"):

    1. Keep a variable inside each of your pipe sprites called "Scored" and set it to false upon Create Object. This we will toggle once the pipe has a lower x-position than the bird (bird has "flown past", ie pipe has scrolled left past the bird). The reason for this is if we don't set Scored to true once the bird has flown past, it will continue to score that pipe.

    2. Add first-level action "Pipe.X <= Bird.X" AND a condition "Pipe: NOT Is Scored" (Pipe is not Scored, ie. Scored is false) which will test ALL pipes for which Score is false's x-location against the bird's x-location and run a command if true. The command simply adds 1 to your Score variable ("Add 1 to Score") and sets the variable Scored to true FOR THAT PIPE (Pipe: Set Scored to true action). Again, this is to prevent the pipe from being scored on every tick.

    There may be a more elegant way (you could investigate dwesley's invisible sprite method) which may be more processor-friendly, but this worked for me.

    Hope this helps!

  • So I'm working on exactly the same type of game and this is what I implemented (I'm assuming you have a pipe sprite called "Pipe" and a bird sprite called "Bird"):

    1. Keep a variable inside each of your pipe sprites called "Scored" and set it to false upon Create Object. This we will toggle once the pipe has a lower x-position than the bird (bird has "flown past", ie pipe has scrolled left past the bird). The reason for this is if we don't set Scored to true once the bird has flown past, it will continue to score that pipe.

    2. Add first-level action "Pipe.X <= Bird.X" AND a condition "Pipe: NOT Is Scored" (Pipe is not Scored, ie. Scored is false) which will test ALL pipes for which Score is false's x-location against the bird's x-location and run a command if true. The command simply adds 1 to your Score variable ("Add 1 to Score") and sets the variable Scored to true FOR THAT PIPE (Pipe: Set Scored to true action). Again, this is to prevent the pipe from being scored on every click.

    There may be a more elegant way (you could investigate dwesley's invisible sprite method) which may be more processor-friendly, but this worked for me.

    Hope this helps!

    I've tried this method and everything looked like it was correct but it didn't seem to work for me. I'm a complete novice so I'm still learning a lot of the ropes of construct 2. I will give this method a try again before trying the invisible sprite one. Maybe this time i'll get whatever I was missing before. Thanks for your help. Appreciate it.

  • > So I'm working on exactly the same type of game and this is what I implemented (I'm assuming you have a pipe sprite called "Pipe" and a bird sprite called "Bird"):

    >

    > 1. Keep a variable inside each of your pipe sprites called "Scored" and set it to false upon Create Object. This we will toggle once the pipe has a lower x-position than the bird (bird has "flown past", ie pipe has scrolled left past the bird). The reason for this is if we don't set Scored to true once the bird has flown past, it will continue to score that pipe.

    > 2. Add first-level action "Pipe.X <= Bird.X" AND a condition "Pipe: NOT Is Scored" (Pipe is not Scored, ie. Scored is false) which will test ALL pipes for which Score is false's x-location against the bird's x-location and run a command if true. The command simply adds 1 to your Score variable ("Add 1 to Score") and sets the variable Scored to true FOR THAT PIPE (Pipe: Set Scored to true action). Again, this is to prevent the pipe from being scored on every click.

    >

    > There may be a more elegant way (you could investigate dwesley's invisible sprite method) which may be more processor-friendly, but this worked for me.

    >

    > Hope this helps!

    >

    I've tried this method and everything looked like it was correct but it didn't seem to work for me. I'm a complete novice so I'm still learning a lot of the ropes of construct 2. I will give this method a try again before trying the invisible sprite one. Maybe this time i'll get whatever I was missing before. Thanks for your help. Appreciate it.

    Sorry, of course I meant Lancifer's invisible sprite method

    As a newbie, try using the Chome Console plugin to log some debug data when your bird flies past a pipe (See for the download and read up on how to install plugins.) This data will show up in Chrome's Console tab (right-click on the html page and select Inspect from the drop-down list to show the console).

  • >

    > > So I'm working on exactly the same type of game and this is what I implemented (I'm assuming you have a pipe sprite called "Pipe" and a bird sprite called "Bird"):

    > >

    > > 1. Keep a variable inside each of your pipe sprites called "Scored" and set it to false upon Create Object. This we will toggle once the pipe has a lower x-position than the bird (bird has "flown past", ie pipe has scrolled left past the bird). The reason for this is if we don't set Scored to true once the bird has flown past, it will continue to score that pipe.

    > > 2. Add first-level action "Pipe.X <= Bird.X" AND a condition "Pipe: NOT Is Scored" (Pipe is not Scored, ie. Scored is false) which will test ALL pipes for which Score is false's x-location against the bird's x-location and run a command if true. The command simply adds 1 to your Score variable ("Add 1 to Score") and sets the variable Scored to true FOR THAT PIPE (Pipe: Set Scored to true action). Again, this is to prevent the pipe from being scored on every click.

    > >

    > > There may be a more elegant way (you could investigate dwesley's invisible sprite method) which may be more processor-friendly, but this worked for me.

    > >

    > > Hope this helps!

    > >

    >

    > I've tried this method and everything looked like it was correct but it didn't seem to work for me. I'm a complete novice so I'm still learning a lot of the ropes of construct 2. I will give this method a try again before trying the invisible sprite one. Maybe this time i'll get whatever I was missing before. Thanks for your help. Appreciate it.

    >

    Sorry, of course I meant Lancifer's invisible sprite method

    As a newbie, try using the Chome Console plugin to log some debug data when your bird flies past a pipe (See log-text-amp-objects-to-chrome-console_t65979 for the download and read up on how to install plugins.) This data will show up in Chrome's Console tab (right-click on the html page and select Inspect from the drop-down list to show the console).

    I'll try that. Thanks

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)