TWO LIFE

This is the first time I ever coded and I need help. This change life by -1 keeps removing 2 instead. I tried doubling the set life but sometimes, it removes 1 life. The game is about 5 monkeys bouncing off the walls and you have to prevent them from touching the floor.

2 Likes

This is happening because the monkeys are being sneaky and hitting two tiles at once. You can see how it’s working in this variation:

To fix, you can

  • change the angle they fly down at (so it comes in solidly on one tile)
  • only take the life if the exact bottom-center of the monkey is touching the tile
  • only take the life when the sprite is destroyed

I think the last one is easiest. You can see my fix here:

1 Like