mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
changed function( to function (
This commit is contained in:
parent
26f3d22db7
commit
7e5eeb0a27
36 changed files with 209 additions and 209 deletions
16
app/Game/Core/Loader/Level.js
Normal file → Executable file
16
app/Game/Core/Loader/Level.js
Normal file → Executable file
|
|
@ -1,4 +1,4 @@
|
|||
define(["Game/Config/Settings", "Lib/Vendor/Box2D", "Game/Core/Collision/Detector"], function(Settings, Box2D, CollisionDetector) {
|
||||
define(["Game/Config/Settings", "Lib/Vendor/Box2D", "Game/Core/Collision/Detector"], function (Settings, Box2D, CollisionDetector) {
|
||||
|
||||
// Public
|
||||
function Level(path, engine) {
|
||||
|
|
@ -7,12 +7,12 @@ define(["Game/Config/Settings", "Lib/Vendor/Box2D", "Game/Core/Collision/Detecto
|
|||
this.levelObject = null;
|
||||
}
|
||||
|
||||
Level.prototype.loadLevelInToEngine = function() {
|
||||
Level.prototype.loadLevelInToEngine = function () {
|
||||
this.loadLevelObjectFromPath(this.path);
|
||||
this.createPhysicTiles();
|
||||
}
|
||||
|
||||
Level.prototype.unload = function() {
|
||||
Level.prototype.unload = function () {
|
||||
// TODO unload level from engine if necessary
|
||||
// Perhaps just remove all bodies?
|
||||
}
|
||||
|
|
@ -30,7 +30,7 @@ define(["Game/Config/Settings", "Lib/Vendor/Box2D", "Game/Core/Collision/Detecto
|
|||
}
|
||||
}
|
||||
|
||||
Level.prototype.createPhysicTile = function(tile) {
|
||||
Level.prototype.createPhysicTile = function (tile) {
|
||||
tile.r = tile.r || 0;
|
||||
var vertices = this.createVertices(tile);
|
||||
|
||||
|
|
@ -55,7 +55,7 @@ define(["Game/Config/Settings", "Lib/Vendor/Box2D", "Game/Core/Collision/Detecto
|
|||
this.engine.createBody(bodyDef).CreateFixture(fixtureDef);
|
||||
}
|
||||
|
||||
Level.prototype.createVertices = function(tile) {
|
||||
Level.prototype.createVertices = function (tile) {
|
||||
var vs = [];
|
||||
|
||||
switch(tile.s) {
|
||||
|
|
@ -119,15 +119,15 @@ define(["Game/Config/Settings", "Lib/Vendor/Box2D", "Game/Core/Collision/Detecto
|
|||
return vs;
|
||||
}
|
||||
|
||||
Level.prototype.mkArg = function(multiplier) {
|
||||
Level.prototype.mkArg = function (multiplier) {
|
||||
return Settings.TILE_SIZE / 2 / Settings.RATIO * multiplier;
|
||||
}
|
||||
|
||||
Level.prototype.addVec = function(vs, m1, m2) {
|
||||
Level.prototype.addVec = function (vs, m1, m2) {
|
||||
return vs.push(new Box2D.Common.Math.b2Vec2(this.mkArg(m1), this.mkArg(m2)));
|
||||
}
|
||||
|
||||
Level.prototype.loadLevelObjectFromPath = function(path) {
|
||||
Level.prototype.loadLevelObjectFromPath = function (path) {
|
||||
|
||||
// TODO: load JSON levelObject from path
|
||||
// s: shape
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue