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 Aitor

Hello there!
I wanted to know which properties the object res that is passed as a parameter to handleMovementTrace has. I've seen some properties like res.collision.slope or res.collision.x in code snippets from this forum, but I don't know what they mean.
Thanks in advance :)

1 decade ago by dominic

The trace result is returned by the CollisionMap&039;s #trace() method. See the documentation.

1 decade ago by Aitor

Thank you!

1 decade ago by Aitor

Another question, are res.tile.x and res.tile.y supposed to point at the colliding tile's position in the collision map? because if I put this code in the handleMovementTrace() method of an entity:
        handleMovementTrace:function(res)
        {
            this.parent(res);
            if (res.collision.x||res.collision.y)
            {
                console.log(res.tile.x+" "+res.tile.y);
            }
        }

it always prints 0 1 or 1 0
EDIT: Well, I've seen res.tile.x is 1 when res.collision.x is true and 0 otherwise, and res.tile.y acts similarly. Is there a way to know the position of the colliding tile?
Page 1 of 1
« first « previous next › last »