Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by Aristy

Hi,

I have a small problem with Impact. 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
Entity
Front Objects
Collision
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.
Have a look at it:
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!

1 decade ago by stillen

You could use this plugin to adjust your layers on the fly:
https://github.com/amadeus/impact-layers

Or you need to adjust entity layering, you can use the zindex
http://impactjs.com/documentation/class-reference/entity#zindex
Page 1 of 1
« first « previous next › last »