2D Plain/layer Shift Game Play Mechanics

Started by
6 comments, last by wp81 7 years, 8 months ago

Hi there,

I am a seasoned C/C++/C# programmer who wants to try out new things, but never made a game before.
I am playing around with different ideas and game engines for a while now and made some bits as proof of concept to find the game I really want to make.

One thing that bugs me is how to make a plain shift effect as seen in Xeodrifter in this video here: The hero sprite is jumping then switches to the background plain to work up his way *and switching back to the foreground to get along.)

I would like to know, if and how it is possible to achieve the same 2D plain/layer shift game play mechanics with a common game engine like melonJS/HTL5/JS, cococs2dx, or Unity3D (this are the engines I have tried so far) in 2D tile based game (e.g. using Tiled, this is the only tile editor I know until now)?
Or would game mechanics like this require to make your own engine?

Best, wp81

Advertisement

Hi

This just looks like there are two tilemaps at play, so using one for a forground, and one for a background.

forground[10][20];

background[20][40];

player_position_forgroundX = player_postionX / 20;

player_position_backgroundX = player_postionX / 40;

player_position_forgroundY = player_postionY / 10;

player_position_backgroundY = player_postionY / 20;

and when the witch occurs you are just using a smaller image / scaled image, and display it on the toggled map.

This is an overly basic explanation, as im just finished work now and about to run out the door :)

Either McGrane solution or, if your engine allows, simply use the actual 3D coord, it will save you a big headache and there are many 2D engines that allow it.

PS: There is http://overlap2d.com/ for level editing as well.

Currently working on a scene editor for ORX (http://orx-project.org), using kivy (http://kivy.org).

Thanks for the hints McGrane.

Had this in mind, but still fall short to translate ideas into practice.
I tried this with melonJS, but that engine cannot load multiple tilemaps AFAIK; but PhaserJS can do the trick as it looks like.

It's a good thing to hit the wall early, to avoid more pain later! Thanks again.

Thank you KnolanCross. I will have to investigate further on this.

Any engine suggestion for a 2d platformer scenario like shown in the vid?

Thank you KnolanCross. I will have to investigate further on this.

Any engine suggestion for a 2d platformer scenario like shown in the vid?

I use orx (http://orx-project.org/), but it has a huge learning curve and few tools available.

I personally don't like Unity3D, because I don't like the way you use it, I would rather control everything via code.

That being said, if you don't have any problem with it, it is probably your best bet as it is the most popular one between indies meaning it has a lot of resources and docs.

Currently working on a scene editor for ORX (http://orx-project.org), using kivy (http://kivy.org).

Unfortunate timing of me reading this post.. I need to stop killing the end of my day with this forum :)

Ive never used melonJS, but from looking at the homepage, it mentions 'Multiple layers with parallax scrolling' I also see mentions of z sorting

This would suggest there is someway to set up multiple layers - ie one layer for each map, and even if there was a restriction on how many tilemaps you could load - you could always store the background map in the first half of the array, and the background map in the second half. Obviously not the most ideal solution, but something that may work as a quick suggestion

It might just be easier to use another one of the engines you have mentioned - but just thought id mention the above if you felt like melonJS is something you like, as to not prematurely drop it

Many thanks again McGrane.

MelonJS was my first love - and the first thing I was able to get something worthwhile up and running.

More and more I feel that engine is lacking compared to others, but it's still a nice pack for learning.

So highly appreciated!

This topic is closed to new replies.

Advertisement