Can someone show me an example? I could not to make the "right way", the block are not in the same Tile position.
Obs: I'm using the Ninja Tileset from superpowers. Tile positions are: 1040,1041,1068,1069, how I make a property with this?
I guess you should to make something like this:
//{Wall Script} //Verify the collision let collide = Sup.ArcadePhysics2D.collides( Sup.getActor('Car').arcadeBody2D, Sup.getActor('Wall').arcadeBody2D);
if (collide) {
console.log('Bateu!');
//Call Animation Sup.getActor('Car').spriteRenderer.setAnimation('Collision');
} else {
console.log('Driver Safe!');
}
I put my collision's scripts in the static actors (e.g. wall) when they start the event (collision), I just pick the actor in the scene that "hit" the my static actor and animate. Hope it helps :)
After the explanation from scriptMapBoy I did understand what uheartbeast want says. The answer was in Z axis all time. But my map had 5 in Z axis, so my PlayerActor had 2 or 3, so it never appear x).
So, I have one script for two Scenes (SceneA, SceneB). I want to do something like this:
if (Sup.getScene() === 'SceneA') { //doSomething } else if (Sup.getScene() === 'SceneB') { //doOtherStuff } else { //doNothing }
The point is: I want to get the current scene running. Is it Possible?
I tried this: Scene Detection by LukeLanFaust answer, but my Log was: >> activeScene content: undefined