Hi there,
Trying to work through a time overlap problem. When a player falls and hits a “bottom” tile, the player then should be teleported to the start, and 1 single life should be removed. I am instead sometimes seeing two lives being removed.
I reduced the problem to the simple project:
I think I see the issue, just not sure how to handle it. The sprite is hitting two of the bottom tiles at the same time, resulting in the overlap event firing twice.
How can I code this so that the overlap event only fires once (or the lives is only reduced by one)?
1 Like
put a pause block in the container maybe that will help
1 Like
2 options
1 use a forever block and do if tile to center of mysprite is (the kill tile)
2 Once you hit the tile it doesn’t take away a life, instead it imeadatly teleports you to a real kill tile in a top corner.
1 Like
it tried that it was laggy so use game update instead 20ms
@michaelcaplan sorry if this is a bit late, but there is an extension called timers, which allows you to put this block and it will limit the amount of times you can get hit. Tell me if this helps.
Thanks everyone for your thoughts on this subject
@CodeOnTheCob your solution in the game loop worked really well.
I’ll check out the timers extension @BotWarrior
1 Like