Skip to content

Commit b664942

Browse files
committed
Merge branch 'develop' into testing
2 parents be20742 + f4a79d7 commit b664942

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/inputs/touch.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ Crafty.extend({
1919
*
2020
* If this is set to true, it is expected that your entities have the `Touch` component instead of the `Mouse` component.
2121
* If false (default), then only entities with the Mouse component will respond to touch.
22-
* It's recommended to add the `Button` component instead, which requires the proper component depending on this feature.
22+
* For simple use cases, tt's recommended to add the `Button` component instead, which requires the proper component depending on this feature.
2323
*
2424
* @note The multitouch feature is currently incompatible with the `Draggable` component and `Crafty.viewport.mouselook`.
25+
* @note When multitouch is not enabled, Crafty will cancel touch events when forwarding them to the mouse system.
2526
*
2627
* @example
2728
* ~~~
@@ -97,6 +98,7 @@ Crafty.extend({
9798
first.target.dispatchEvent(simulatedEvent);
9899
}
99100
}
101+
e.preventDefault();
100102
}
101103

102104
return function(e) {

src/spatial/collision.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ Crafty.c("Collision", {
480480
* .attr({x: 32, y: 32, w: 32, h: 32})
481481
* .collision([0, 16, 16, 0, 32, 16, 16, 32])
482482
* .fourway()
483-
* .bind('Moved', function(evt) { // after player moved
483+
* .bind('Move', function(evt) { // after player moved
484484
* var hitDatas, hitData;
485485
* if ((hitDatas = this.hit('wall'))) { // check for collision with walls
486486
* hitData = hitDatas[0]; // resolving collision for just one collider
@@ -489,8 +489,9 @@ Crafty.c("Collision", {
489489
* this.x -= hitData.overlap * hitData.nx;
490490
* this.y -= hitData.overlap * hitData.ny;
491491
* } else { // MBR, simple collision resolution
492-
* // move player to position before he moved (on respective axis)
493-
* this[evt.axis] = evt.oldValue;
492+
* // move player to previous position
493+
* this.x = evt._x;
494+
* this.y = evt._y;
494495
* }
495496
* }
496497
* });

0 commit comments

Comments
 (0)