Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs to use Move instead of Moved #1173

Merged
merged 1 commit into from
Jan 27, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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