mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 18:47:35 +00:00
missing commits from last commit 7eb3d0b8b0
This commit is contained in:
parent
7eb3d0b8b0
commit
039213cf50
11 changed files with 257 additions and 430 deletions
|
|
@ -2,14 +2,17 @@ define([
|
|||
"Game/" + GLOBALS.context + "/GameObjects/GameObject",
|
||||
"Lib/Vendor/Box2D",
|
||||
"Lib/Utilities/Options",
|
||||
"Game/Config/Settings"
|
||||
"Game/Config/Settings",
|
||||
"Lib/Utilities/Exception"
|
||||
],
|
||||
|
||||
function (Parent, Box2D, Options, Settings) {
|
||||
function (Parent, Box2D, Options, Settings, Exception) {
|
||||
|
||||
function Item(physicsEngine, uid, options) {
|
||||
|
||||
var floatOptions = {
|
||||
grabAngle: parseFloat(options.grabAngle),
|
||||
danger: parseFloat(options.danger),
|
||||
weight: parseFloat(options.weight),
|
||||
width: parseFloat(options.width),
|
||||
height: parseFloat(options.height),
|
||||
|
|
@ -21,6 +24,11 @@ function (Parent, Box2D, Options, Settings) {
|
|||
|
||||
this.options = Options.merge(floatOptions, options);
|
||||
|
||||
if(!this.options.category) {
|
||||
// FIXME add more validation
|
||||
console.warn('item category empty (' + this.options.name + ')' );
|
||||
}
|
||||
|
||||
Parent.call(this, physicsEngine, uid);
|
||||
this.createFixture();
|
||||
this.body.ResetMassData();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue