I need help with my flappy bird game (second round not working)

Hi, so I’m very new to p5.js and I’m trying to make a basic flappy bird game with two levels. This is pretty much my first project in p5.

So my first level is working how I want it to, if the player survives until the timer runs out (15 seconds without losing all 5 lives) I have a working win screen. But I want the player to be able to click anywhere and the second level should start, but that isn’t working.

I’ve tried console logging and I think the second round function is being called properly, so I’m not sure where to go from here. Here is my code:

https://codepen.io/sterling/pen/MWRZvjz

I guess you need to reset some variables

such as

    this.y = height/2;
    this.x = 64;
1 Like

What do you mean by reset?

Just set the values of crucial variables back to the initial values

1 Like