• Advertisement
Sign in to follow this  

Unity 2D Plain/layer Shift Game Play Mechanics

This topic is 629 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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 :)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement