Lane Shifting and Ignoring Objects

For questions about using Classic.

Post » Tue Jun 28, 2011 5:42 am

I'm trying to build a beat-em-up similar to Guardian Heroes from the Sega Saturn or Panzer Bandit on the PSX and these work via multiple lanes, that is instead of being able to move up or down one wide lane like in Final Fight or Streets of Rage, there's two or more lanes which all act as a 2D field where you can move left and right along with jumping and crouching.

I've tried what Daiz recommended in http://www.scirra.com/forum/ignoring-collision-from-one-layer-to-another_topic40099.html#p51640 and that kind of got the lane shifting mechanic working except that it seems to apply globally to anything with a platformer behaviour (if any other players are around, they'll probably shift lanes too).

Is it possible to have an object ignore families or other objects with a specific attribute? That's the only way I can see this working right so that the players can shift lanes and if there's any enemies on lane 2 and the player is on Lane 1, neither one will be able to affect the other.

If there's a better way to achieve what I'm trying to do, I'm all ears too. I'm pretty new to Construct and I'm open to learning how to use it better.tenpoundpixel2011-07-27 22:21:44
B
3
G
1
Posts: 6
Reputation: 487

Post » Tue Jun 28, 2011 4:31 pm

Off the top of my head (and sorry if I'm maybe misunderstanding the question...), I would personally use Private Variables.

I would give every object a Private Variable like 'myLayer', and set up a few events that change this value when you move to a new layer. Then, whenever I was doing a check for collision or what-not, I'd simply add a condition to check for the Private Variable. You can even check to see if 'Player1.'myLayer'' is equal to 'Enemy1.'myLayer''... so if the player collides with the enemy AND their layers are the same, then the action can be performed.
B
3
G
3
Posts: 8
Reputation: 916


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest