Skip to content

Commit

Permalink
Merge branch 'develop' into testing
Browse files Browse the repository at this point in the history
  • Loading branch information
starwed committed Jan 27, 2018
2 parents be20742 + f4a79d7 commit b664942
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/inputs/touch.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ Crafty.extend({
*
* If this is set to true, it is expected that your entities have the `Touch` component instead of the `Mouse` component.
* If false (default), then only entities with the Mouse component will respond to touch.
* It's recommended to add the `Button` component instead, which requires the proper component depending on this feature.
* For simple use cases, tt's recommended to add the `Button` component instead, which requires the proper component depending on this feature.
*
* @note The multitouch feature is currently incompatible with the `Draggable` component and `Crafty.viewport.mouselook`.
* @note When multitouch is not enabled, Crafty will cancel touch events when forwarding them to the mouse system.
*
* @example
* ~~~
Expand Down Expand Up @@ -97,6 +98,7 @@ Crafty.extend({
first.target.dispatchEvent(simulatedEvent);
}
}
e.preventDefault();
}

return function(e) {
Expand Down
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 b664942

Please sign in to comment.