0 Favourites

need help with setting up 2 player death

  • Not sure the easiest way to proceed, and im not even sure on the terminology to look for what im trying to do.

    i have 2 players that play using the keyboard.

    i want a system like cloudberry kingdom on wii u,

    where the players share lives, so while playing a layout, if one dies, the other can keep going and beat the level, at no cost to the lives "pot"

    but if both die, then a life is lost and the layout is reset.

    i'm not even sure how to implement that.

    what i thought (and there is probably an easier way)

    is to have a bool on the players, that is constatly checked, so that when a character dies, the bool isdead = true

    and then a constant loop seeing if the isdead is true for both.

    but I have NO idea how to set this up in the events.

    I just need a push in the right direction and i think i could manage the rest. unless someone wants to selflessly explain word for word how to do this :)

    Thanks for you time reading this,

    Gathos.

  • How about a global variable? 1= both active 2= Player one dead 3=player two dead 4= both dead

    With such a system, you can easily share lifes etc:)

  • Give a variable to each player called "active"

    When they spawn set active to 1

    When they die, set "active" to 0

    system player1.active=0 AND player2.active=0 -> end game

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • thank you this sounds just like what I need thanks. I already have the variables setup for i just could wrap my head around what i should do with them, i guess i just had a major brain fart thanks justifun.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
0 Favourites
[plugin] Youtube player
175 20,543
rexrainbow's avatar
rexrainbow
Unread hot topic
157 12,693
megatronx's avatar
megatronx
Unread hot topic
0 Favourites
Kiira will help! :D
132 16,616
Kiira's avatar
Kiira