How do I change/switch between player controllers?

Get help using Construct 2

Post » Fri Jan 31, 2014 9:16 pm

Hi everybody!

I wonder the way to switch between two or more playable characters (with some player controllers asociated) by pressing a button.
Is there any way to do this?

I appreciatte any help, because I'm stuck on my project because i can't do that :(

Thanks and regards!
B
2
Posts: 2
Reputation: 154

Post » Fri Jan 31, 2014 10:29 pm

You could (and I'm sure there are better ways) put each player in a group with all it's attributes and movements and deactivate the groups that you don't want. Then on click activate the group (player) you want to use and deactivate the others.

Like I said I'm still learning but that's what I would try if I was trying to figure it out...

Hope this helps if not sorry.
Check out my latest game RAPID-TAPIT. Get your Fingercise on with this one. A steady Tap is all you need to score points. Lift a finger and see what you can do...

Image

ALLMarkMade Designs
B
32
S
15
G
3
Posts: 356
Reputation: 5,269

Post » Fri Jan 31, 2014 10:36 pm

Give the players a boolean, activeplayer false.
Start with one activated.
On click other character set other chars activeplayer to false and self active player to true.


Control events could be assisted with boolean check as to which player to move.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,562

Post » Fri Jan 31, 2014 11:41 pm

Have you tried Pin behaviour ?
It seems to be usefull in you case https://www.scirra.com/manual/99/pin
B
8
S
2
Posts: 35
Reputation: 838

Post » Sat Feb 01, 2014 8:06 am

I think that i understand Pin's concepto, but that is not what i want to do. What i wanna do is that you have three separated characters, in any place of the level. Then, if you press a key, the current character controller is deactivated and the character controller of the next character is activated, and so on.
I don't get hoy Pin can help me to do this.

In the other hand, Lennaert, how can i deactivate control event of a characters controlling it by a boolean?
B
2
Posts: 2
Reputation: 154

Post » Sat Feb 01, 2014 8:29 am

Add a condition "character is boolean" to the control events.

If the characters are very different in the way you control them, create groups with events that are only activated when a certain characters boolean is true.

I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: NadeemAbbass, plinkie, Yahoo [Bot] and 8 guests