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
37
app/Game/Core/GameObjects/SpectatorDoll.js
Normal file
37
app/Game/Core/GameObjects/SpectatorDoll.js
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
define([
|
||||
"Game/" + GLOBALS.context + "/GameObjects/GameObject",
|
||||
"Lib/Vendor/Box2D"
|
||||
],
|
||||
|
||||
function (Parent, Box2D) {
|
||||
|
||||
function SpectatorDoll(physicsEngine, uid, player) {
|
||||
Parent.call(this, physicsEngine, uid);
|
||||
}
|
||||
|
||||
SpectatorDoll.prototype = Object.create(Parent.prototype);
|
||||
|
||||
SpectatorDoll.prototype.getBodyDef = function() {
|
||||
var bodyDef = new Box2D.Dynamics.b2BodyDef();
|
||||
bodyDef.type = Box2D.Dynamics.b2Body.b2_dynamicBody;
|
||||
bodyDef.position.x = this.getPosition().x;
|
||||
bodyDef.position.y = this.getPosition().y;
|
||||
bodyDef.angle = 0;
|
||||
|
||||
return bodyDef;
|
||||
};
|
||||
|
||||
SpectatorDoll.prototype.getPosition = function() {
|
||||
return {x: 10, y: 10};
|
||||
}
|
||||
|
||||
SpectatorDoll.prototype.getHeadPosition = function() {
|
||||
return {x: 10, y: 10};
|
||||
}
|
||||
|
||||
SpectatorDoll.prototype.update = function() {
|
||||
};
|
||||
|
||||
return SpectatorDoll;
|
||||
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue