Skip to content

Commit

Permalink
Update docs to use Move instead of Moved
Browse files Browse the repository at this point in the history
  • Loading branch information
starwed committed Jan 26, 2018
1 parent 23bc903 commit 876d8ff
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/spatial/collision.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
* }
* }
* });
Expand Down

0 comments on commit 876d8ff

Please sign in to comment.