How would I make a multi-lane platformer like LBP?

0 favourites
  • 7 posts
From the Asset Store
10 Retro songs ideal for platformers or farming games
  • (LBP = Little Big Planet, which uses a system where you can switch between a foreground,middleground, and background "lane".)

    So for a personal project I am making a beat-em' up, but I want to use lanes to sidestep the issue of players not quite lining up on the Y axis with their intended target. This is what the beat-em' up Viking Squad does and you can see it in action here as an example.

    This will (hopefully) also give me the ability to do some multi-lane platforming.

    Initially I had considered doing this by simply giving the player object the platform behavior and then moving a small, invisible platform under them to the lanes Y positions when switching lanes, but this would create a slew of issues where the player would accidentally interact with enemy platforms and vice-versa.

    I think the best bet would be to create the platforms for each lane and then have a lane value for the player/enemies that determines which lanes platforms they can interact with. I'm not actually sure how to do this though as I don't think there's anything in the platform behavior that would support that.

    Any suggestions? Thanks!

  • so, while theres probably a completely proper way to do this, one idea would be to make a global variable named layers. If layer = front, set size to 3, if layer = middle, set size to 2, if layer = back, set size to 1. this wouldnt create actual physical layers so to speak, but would change the characters size to look like they were on a different layer. after all, games are just a bunch of smoke and mirrors. used in conjunction with a sort of hopping animation could look like youre switching layers. then you would need a second global variable, determining what layer objects are on, and what layers enemies are on. If Player Layer = Object/Enemy layer, Turn collisions ON. else, turn collision Off. Hopefully that makes sense for you. -tsh

  • also, being as youve multiple objects to go on multiple layers, you could replace said global variables with an Array, however, im not very well versed with arrays, other than the fact that they can act as mass global variables.

  • I don't see any of that being very helpful.

    My major issue is still making sure that all platform-behavior objects (players, enemies, etc) only interact with the platforms in their lane. Sizing is not a concern, nor is the actual transition between these lanes.

    Effectively every lane needs to have it's own platforms, and characters should only interact with their lanes platforms. But disabling platforms is not an option because different characters (players, enemies, etc) can be in different lanes.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • the sizing is just for the lane effect. to make it look closer or further away. if you need each sprite to be on a specific layer, try instance variables. maybe something along the lines of , On Collision, If Player Layer is not = to Object Layer, turn collision/solid behavior off. its not a one click fix, but it'll do what you're looking for

  • ok so ive just done it and it works. you give your player and your ground instance variables,and then if ground layer = sprite layer enable collisions. if layers dont = disable collisions. do the same for your enemies. if they have projectiles, make sure to set on created to set the layer properly to its sources layer. in 6 events i can toggle layers via number keys, and only land on platforms if that layers active. however, all of the platforms look the same. it would take little graphical work to make them look like theyre on different planes, but its all 2d.

  • Unless I am completely mistaken on what you are doing your solution will not work the moment you introduce more than one character or object that needs to interact with platforms. When you disable collisions for an object you disable collisions for ALL interactions with that object, so when the player moves layers, all the objects on other layers will fall straight through them.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)