Help with my flappy bird game

So I made a flappy bird game. When you die to the kill part 1 time, it brings you to the kill screen(as it should), but when you press “again…?” it’ll respawn you, but when you die a second time the game breaks. Help?

It’s possible that something isn’t resetting properly in your game, causing the break to happen.
Can you share the wick file or a copy of your code so I can take a look at it? It’s ok if you can’t.

Oh sorry I forgot to link the file… My Project8-25-2022_16-16-57.wick (11.9 KB)

try to reset acceleration when pressing “again” button

The issue is that in the default script of both the clips, you add an update event. Every time the default script is run, the update event is added to the clips, and the last update event that was “added” is still there. So in other words, you had more than 1 update event running the player’s code:

this.accel += 1.5;
this.y += this.accel;

This is why the player got faster every time you re-entered the frame.
The same issue is for the obstacle, which seemed to have bugged the game.

Solution:
Add an “update” script to the clips, and copy-paste the code inside the update event’s there.
DemDev’s Project.wick (11.8 KB)

1 Like