mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
Combines GLOBALS and Chuck namespace into App. Also increases number of stack trace steps to be printed when an error occurs. I experimented with the "replace" plugin from require.js, which works but it would mean that our context switchable "import-statements" would look like the example below, which I decided against at least for now, just because of the looks. The downside of not using the plugin is that we cannot use the "use strict" statement in the channel.js entry script and also cannot put a "var" in front of App variable there. For example: "replace!Game/:AppContext/Physics/Engine", Instead of: "Game/" + App.context + "/Physics/Engine", Fixes #86
42 lines
No EOL
983 B
JavaScript
42 lines
No EOL
983 B
JavaScript
define([
|
|
"Game/" + App.context + "/GameObjects/GameObject",
|
|
"Lib/Vendor/Box2D"
|
|
],
|
|
|
|
function (Parent, Box2D) {
|
|
|
|
"use strict";
|
|
|
|
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() {
|
|
};
|
|
|
|
SpectatorDoll.prototype.destroy = function() {
|
|
};
|
|
|
|
return SpectatorDoll;
|
|
|
|
}); |