Dynamic layer levels with ImpactJS?
Posted: Thu Dec 19, 2013 3:23 pm
Hi,
I have a small problem with ImpactJS. I need to make my entity lower level when he is behind objects and higher level when he is front of objects.
To solve this, I did a small workaround.
- Applied collision area to the feet of my player entity
- Updated my Layers to look in this order
1. Behind Objects
2. Entity
3. Front Objects
4 . Collision
5.Terrain
Right now it works and I'm pretty happy with it. Like in this picture: http://i.imgur.com/jclslIu.png
However, this workaround is not possible with the following tileset. (or when the tileset is a single cell one)
Have a look at: http://i.imgur.com/QRZXygu.png
So I need a small script to do something like this:
- The tileset 1 level below my entity object should automatically get a higher level layer position.
For example, if I go behind the rope, rope should be 1 level higher than my entity layer so I will look like I am behind it. Also, if I am in front of rope, my entity should be 1 level higher than rope layer so I will look like I am in front.
Anyone knows how can I do this?
Thanks in advance!
I have a small problem with ImpactJS. I need to make my entity lower level when he is behind objects and higher level when he is front of objects.
To solve this, I did a small workaround.
- Applied collision area to the feet of my player entity
- Updated my Layers to look in this order
1. Behind Objects
2. Entity
3. Front Objects
4 . Collision
5.Terrain
Right now it works and I'm pretty happy with it. Like in this picture: http://i.imgur.com/jclslIu.png
However, this workaround is not possible with the following tileset. (or when the tileset is a single cell one)
Have a look at: http://i.imgur.com/QRZXygu.png
So I need a small script to do something like this:
- The tileset 1 level below my entity object should automatically get a higher level layer position.
For example, if I go behind the rope, rope should be 1 level higher than my entity layer so I will look like I am behind it. Also, if I am in front of rope, my entity should be 1 level higher than rope layer so I will look like I am in front.
Anyone knows how can I do this?
Thanks in advance!