From 876d8ffa61c33c53868e8cb0062bfcf05d22f99e Mon Sep 17 00:00:00 2001 From: Tim Martin Date: Thu, 25 Jan 2018 23:00:31 -0500 Subject: [PATCH] Update docs to use Move instead of Moved --- src/spatial/collision.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/spatial/collision.js b/src/spatial/collision.js index f8a9746a..87eb092f 100644 --- a/src/spatial/collision.js +++ b/src/spatial/collision.js @@ -480,7 +480,7 @@ Crafty.c("Collision", { * .attr({x: 32, y: 32, w: 32, h: 32}) * .collision([0, 16, 16, 0, 32, 16, 16, 32]) * .fourway() - * .bind('Moved', function(evt) { // after player moved + * .bind('Move', function(evt) { // after player moved * var hitDatas, hitData; * if ((hitDatas = this.hit('wall'))) { // check for collision with walls * hitData = hitDatas[0]; // resolving collision for just one collider @@ -489,8 +489,9 @@ Crafty.c("Collision", { * this.x -= hitData.overlap * hitData.nx; * this.y -= hitData.overlap * hitData.ny; * } else { // MBR, simple collision resolution - * // move player to position before he moved (on respective axis) - * this[evt.axis] = evt.oldValue; + * // move player to previous position + * this.x = evt._x; + * this.y = evt._y; * } * } * });