player.bind('Move', function(from) {
if(this.hit('Tree')){
player.x = from._x
player.y = from._y
// Here player.x and player.y have right value but not renderered here.
}
}
)
I debugged that program enters here and from._x and from._y have good values. But player remains "behind" the Tree.
I'm don't have a lot of CraftyJS experience yet, so don't take this as the best way to do it, but...
Some references I found in the API documentation:
Here's an example -- when the entity tagged with "Player" component collides with any component tagged "Tree", will back the player object's x position off by the amount it is overlapping with the tree.