Skip to content

Commit

Permalink
Merge pull request #1173 from starwed/remove-moved-from-docs
Browse files Browse the repository at this point in the history
Update docs to use Move instead of Moved
  • Loading branch information
starwed committed Jan 27, 2018
2 parents 69762bc + 876d8ff commit f4a79d7
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 f4a79d7

Please sign in to comment.