How do I lose all 3 lives from lava?

0 favourites
  • 8 posts
From the Asset Store
Tileset for action or adventure platformer games with underground, cave, lava, mine, and or similar themes.
  • This is a harder than usual question for me so pretty much I have a game and the red = lava which I have annotated, the 3 hearts signify your life which I have not made a variable from yet

    3 lives and I want all gone when touched lava. How can I do that?

  • Player is overlapping object lava, subtract 3 from lives variable. Or if it's every X seconds you can add this condition too and subtract 1 from lives.

  • OK, I did what I could and I ran into a problem, can someone tell me what went wrong? the problem occours when I get into the game, touch the lava and no live sprites are deducted, including the variable.

    ^ Code

    Lava = red, blue = platform, character is the small kind of Minecraft-ish character at the start.

    problem occouring [this also doesn't deduct the global variable]

    Here, you can see that I am touching the lava [invisible solid sprite, you can see I am touching it as I am floating from the ground]

    Finally, layers:

    Finally, this isn't made for people to comment on the game but specifically why lives isn't working, can anyone find the problem?

  • bump-

  • It's because lives goes straight to 0 on collision with lava, and then starts subtracting 1 every tick when you are overlapping lava which goes into negative numbers, so none of the events are true. You need something like if player is overlapping lava, every 1 seconds subtract 1 from lives, then you will see a change in variable and the hearts being removed.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Just when the player collides with the lava just put destroy player instead of taking away the sprites but if you want the sprites to go away I can't help you on that bub

  • change your code to Lives = or < than 2,1,0 instead of just = and it should work

  • I found the problem! It's because I forgot to connect the scene to the actual event sheet so no events could even be done oops

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