mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
fixes #98 revisit throwing
This commit is contained in:
parent
21f948e2b4
commit
b6d67a0581
3 changed files with 166 additions and 116 deletions
|
|
@ -13,6 +13,7 @@ function (Parent, KeyboardInput, DomController, Settings, Swiper) {
|
|||
|
||||
this.x = 0;
|
||||
this.y = 0;
|
||||
this.mousePosition = {x:0,y:0};
|
||||
this.modifier = false;
|
||||
this.swiper = null;
|
||||
this.lastLookDirection = 1;
|
||||
|
|
@ -104,6 +105,8 @@ function (Parent, KeyboardInput, DomController, Settings, Swiper) {
|
|||
var self = this;
|
||||
|
||||
canvas.onmousedown = function(e) {
|
||||
self.mousePosition = {x:0,y:0};
|
||||
|
||||
if(!self.playerController.player.isHoldingSomething()) {
|
||||
var options = {
|
||||
x: self.x,
|
||||
|
|
@ -112,6 +115,7 @@ function (Parent, KeyboardInput, DomController, Settings, Swiper) {
|
|||
self.playerController.handActionRequest(options);
|
||||
} else {
|
||||
self.swiper = new Swiper();
|
||||
self.swiper.draw(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -178,7 +182,9 @@ function (Parent, KeyboardInput, DomController, Settings, Swiper) {
|
|||
e.webkitMovementY ||
|
||||
0;
|
||||
|
||||
this.swiper.swipe(movementX, -movementY);
|
||||
this.mousePosition.x += movementX;
|
||||
this.mousePosition.y += movementY;
|
||||
this.swiper.swipe(this.mousePosition.x, -this.mousePosition.y);
|
||||
};
|
||||
|
||||
KeyboardAndMouse.prototype.activateModifier = function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue