need help with setting up 2 player death

Get help using Construct 2

Post » Thu Nov 28, 2013 5:11 am

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.
B
10
S
3
G
1
Posts: 12
Reputation: 818

Post » Thu Nov 28, 2013 6:20 am

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:)
Image
Check out our start-up and configure your own helmet in true 3D.
B
44
S
11
G
11
Posts: 1,154
Reputation: 9,978

Post » Thu Nov 28, 2013 4:09 pm

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

B
87
S
44
G
16
Posts: 1,002
Reputation: 17,932

Post » Thu Nov 28, 2013 5:32 pm

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.
B
10
S
3
G
1
Posts: 12
Reputation: 818


Return to How do I....?

Who is online

Users browsing this forum: David181, OBLIVION and 56 guests