Switch between active chars..

Get help using Construct 2

Post » Sat Jan 28, 2012 7:42 pm

How do i switch between two player chars in a platformer?

I have created a regular platform level that is about twice the width of the screen size and placed a sprite as player-character with the solid/scroll to/platformMP behaviours. Nothing fancy..

Now i want to dump another sprite at the other end as second (inactive) character and have a button to switch between which character the player controls. Preferably since the other char may be offscreen the 'scroll to' behaviour could be switched between chars too?

I would apreciate being pointed in the right direction or perhaps even an example?

Greetz,
Danny
B
54
S
7
G
8
Posts: 150
Reputation: 5,812

Post » Sat Jan 28, 2012 7:47 pm

the easiest way I could think of is have different animations within one spriteWeishaupt2012-01-28 19:47:48
B
42
S
19
G
12
Posts: 723
Reputation: 13,911

Post » Sat Jan 28, 2012 7:49 pm

But i want both to be present in the level at all times.. I mean the point of the game would be to bring both to a specific point or bring them together by moving them in turn and switching between them..
(seemed like a fun concept to me) *nods
B
54
S
7
G
8
Posts: 150
Reputation: 5,812

Post » Sat Jan 28, 2012 7:55 pm

you can clone your sprite, ie have a second instance of it...
B
42
S
19
G
12
Posts: 723
Reputation: 13,911

Post » Sat Jan 28, 2012 8:12 pm

Here's a possible implementation

The trick is to use a third object with the scroll to behavior, and switch between the characters, starting/stoping the user's input depending on which character is to be controlled.

Simply cloning the character's instance is possible too, but sounds like way more trouble imo.
And also, if both sprites have the scroll to behavior, the program will struggle to try to put the view on both at the same time.Kyatric2012-01-28 20:13:28
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Sat Jan 28, 2012 8:22 pm

Awesome stuff, thank you both Weishaupt and Kyatric for your help.
The example shown by Kyatric does what i seek perfectly. *nods and smiles
:)
B
54
S
7
G
8
Posts: 150
Reputation: 5,812

Post » Sat Jan 28, 2012 8:25 pm

Good way to learn having multiple conditions i must add..
I am very happy now :)
B
54
S
7
G
8
Posts: 150
Reputation: 5,812


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 24 guests