mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
replaced killed doll with ragdoll - fixes #50
This commit is contained in:
parent
aa6fdaa2df
commit
413254bfa4
19 changed files with 330 additions and 88 deletions
|
|
@ -25,6 +25,7 @@ function (Parent, KeyboardInput, MouseInput, NotificationCenter) {
|
|||
|
||||
f:70,
|
||||
g:71,
|
||||
k:75,
|
||||
|
||||
up: 38,
|
||||
left: 37,
|
||||
|
|
@ -49,14 +50,16 @@ function (Parent, KeyboardInput, MouseInput, NotificationCenter) {
|
|||
this.keyboardInput.registerKey(keys.d, 'moveRight', 'stop');
|
||||
this.keyboardInput.registerKey(keys.right, 'moveRight', 'stop');
|
||||
|
||||
this.keyboardInput.registerKey(keys.w, 'jump');
|
||||
this.keyboardInput.registerKey(keys.up, 'jump');
|
||||
this.keyboardInput.registerKey(keys.space, 'jump');
|
||||
this.keyboardInput.registerKey(keys.w, 'jump', 'jumpStop');
|
||||
this.keyboardInput.registerKey(keys.up, 'jump', 'jumpStop');
|
||||
this.keyboardInput.registerKey(keys.space, 'jump', 'jumpStop');
|
||||
|
||||
this.keyboardInput.registerKey(keys.tab, 'showInfo', 'hideInfo');
|
||||
|
||||
this.keyboardInput.registerKey(keys.f, 'handActionLeft');
|
||||
this.keyboardInput.registerKey(keys.g, 'handActionRight');
|
||||
|
||||
this.keyboardInput.registerKey(keys.k, 'suicide');
|
||||
}
|
||||
|
||||
PlayerController.prototype.moveLeft = function () {
|
||||
|
|
@ -79,6 +82,11 @@ function (Parent, KeyboardInput, MouseInput, NotificationCenter) {
|
|||
NotificationCenter.trigger('sendGameCommand', 'jump');
|
||||
}
|
||||
|
||||
PlayerController.prototype.jumpStop = function () {
|
||||
Parent.prototype.jumpStop.call(this);
|
||||
NotificationCenter.trigger('sendGameCommand', 'jumpStop');
|
||||
}
|
||||
|
||||
PlayerController.prototype.setXY = function(x, y) {
|
||||
var options = {x:x, y:y};
|
||||
Parent.prototype.lookAt.call(this, options);
|
||||
|
|
@ -93,6 +101,10 @@ function (Parent, KeyboardInput, MouseInput, NotificationCenter) {
|
|||
this.handActionRequest(0.5, 0.5);
|
||||
};
|
||||
|
||||
PlayerController.prototype.suicide = function() {
|
||||
NotificationCenter.trigger("sendGameCommand", "suicide");
|
||||
};
|
||||
|
||||
PlayerController.prototype.handActionRequest = function(x, y) {
|
||||
var options = {x:x, y:y};
|
||||
NotificationCenter.trigger("sendGameCommand", "handActionRequest", options);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue