mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
parent
89c5e4a5d8
commit
ed23753c04
17 changed files with 286 additions and 224 deletions
|
|
@ -28,7 +28,9 @@ function (Parent, KeyboardInput, MouseInput, NotificationCenter) {
|
|||
down: 40,
|
||||
right: 39,
|
||||
|
||||
space: 32
|
||||
space: 32,
|
||||
|
||||
tab: 9
|
||||
}
|
||||
|
||||
this.init(keys);
|
||||
|
|
@ -47,6 +49,8 @@ function (Parent, KeyboardInput, MouseInput, NotificationCenter) {
|
|||
this.keyboardInput.registerKey(keys.w, 'jump');
|
||||
this.keyboardInput.registerKey(keys.up, 'jump');
|
||||
this.keyboardInput.registerKey(keys.space, 'jump');
|
||||
|
||||
this.keyboardInput.registerKey(keys.tab, 'showInfo', 'hideInfo');
|
||||
}
|
||||
|
||||
PlayerController.prototype.moveLeft = function () {
|
||||
|
|
@ -78,7 +82,16 @@ function (Parent, KeyboardInput, MouseInput, NotificationCenter) {
|
|||
PlayerController.prototype.handActionRequest = function(x, y) {
|
||||
var options = {x:x, y:y};
|
||||
NotificationCenter.trigger("sendGameCommand", "handActionRequest", options);
|
||||
};
|
||||
};
|
||||
|
||||
PlayerController.prototype.showInfo = function() {
|
||||
NotificationCenter.trigger("game/toggleInfo", true);
|
||||
};
|
||||
|
||||
PlayerController.prototype.hideInfo = function() {
|
||||
NotificationCenter.trigger("game/toggleInfo", false);
|
||||
};
|
||||
|
||||
|
||||
return PlayerController;
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue