What I am trying to do, is to spawn a sprite (explosion decal) when the enemy dies on a parallaxed layer.
The parallaxed layer is the wall and the decal is the smoke effect that is impregnated on the wall.
The problem is that since the layer has parallax, the decal is not spawned in the point where the enemy dies.
Is it possible to solve this ? Thanks.
Here is a example I've made. The left side is about what I explained above:
https://www.dropbox.com/s/9djcgjkl23mb1 ... .capx?dl=0
Enemy|Spawn ExplosionDecal on layer("BG")
System|Create object ExplosionDecal on layer("BG") at (enemy.X + ViewportLeft(0) - ViewportLeft(1), enemy.Y + ViewportTop(0) - ViewportTop(1))
with the layer: BG
X-coordinates: enemy.X + ViewportLeft(0) - ViewportLeft(1)
Y-coordinates :enemy.Y + ViewportTop(0) - ViewportTop(1)
I think there a commands for that like CanvasToLayer or LayerToCanvas but I don't get it to work. Maybe someone with more experience can help with that commands.
You need to convert from your Player layer to the Canvas, then from the Canvas to the BG layer.
Develop games in your browser. Powerful, performant & highly capable.
Ah, now it makes sense. Thanks blackhornet for the explanation.
Thanks a lot guys !