Using the PMO object, I'm trying to create one of those types of platform games where there are two playable characters that you can switch to at will. What I'm a little stuck on is how to program the second playable character to follow the first player (think games like Donkey Kong Country).
After some tinkering I've kind of figured it out myself! Turns out all you have to do is set up a counter,
Initial value 1
Min value 1
Max value 3
Since there are 2 playable characters, the numbers indicate which character is currently being controlled. 1 for player 1, 2 for player 2. Number three exists to shift control back to 1.
Basically the code looks like this:
Group P2 Follow player 1
X position of player2 sprite > X(position of P1 collision detector box)+15
User is holding left input key (for P2 PMO object)
X position of player2 sprite < X(position of P1 collision detector box)-15
User is holding right input key (for P2 PMO object)
Always
P2 collision look at (0,0) from P1 collision box
Same goes for the player 1 Follow player 2 group.
Hope that helps for anyone else who is curious to pull this off in their games.