Permalink
Browse files

Merge pull request #21 from tobiastom/master

Removing functions from Constants and Settings.
  • Loading branch information...
2 parents 5077050 + 46fa3f0 commit b02f169fc9694a325616aeeafe1c3294d7f672fd Jeena Paradies committed Jul 19, 2012
Showing with 56 additions and 71 deletions.
  1. +7 −13 lib/Chuck/Constants.js
  2. +49 −58 lib/Chuck/Settings.js
View
@@ -1,15 +1,9 @@
-define(function() {
+define({
+ COLLISION_IDENTIFIER_PLAYER: 'player',
+ COLLISION_IDENTIFIER_PLAYER_HEAD: 'head',
+ COLLISION_IDENTIFIER_PLAYER_CHEST: 'chest',
+ COLLISION_IDENTIFIER_PLAYER_LEGS: 'legs',
+ COLLISION_IDENTIFIER_PLAYER_FOOT_SENSOR: 'footsensor',
- var Constants = {
- COLLISION_IDENTIFIER_PLAYER: 'player',
- COLLISION_IDENTIFIER_PLAYER_HEAD: 'head',
- COLLISION_IDENTIFIER_PLAYER_CHEST: 'chest',
- COLLISION_IDENTIFIER_PLAYER_LEGS: 'legs',
- COLLISION_IDENTIFIER_PLAYER_FOOT_SENSOR: 'footsensor',
-
- COLLISION_IDENTIFIER_TILE: 'tile'
- }
-
- return Constants;
-
+ COLLISION_IDENTIFIER_TILE: 'tile'
});
View
@@ -1,59 +1,50 @@
-define(function() {
-
- var Settings = {
- STAGE_WIDTH: 600,
- STAGE_HEIGHT: 400,
-
- // BOX2D INITIALATORS
- RATIO: 35,
- BOX2D_WORLD_AABB_SIZE: 3000,
- BOX2D_ALLOW_SLEEP: true,
- BOX2D_GRAVITY: 16,
- BOX2D_VELOCITY_ITERATIONS: 5,
- BOX2D_POSITION_ITERATIONS: 5,
- BOX2D_TIME_STEP: 1 / 60,
-
- // GRAPHIC PATHS
- GRAPHICS_PATH: 'static/img/',
- GRAPHICS_SUBPATH_ITEMS: 'items/',
- GRAPHICS_SUBPATH_CHARACTERS: 'characters/',
-
- TILE_SIZE: 15,
-
- // GAME PLAY
- WALK_SPEED: 2.5,
- RUN_SPEED: 4.0,
- FLY_SPEED: 3.2,
- JUMP_SPEED: 3.0,
- JUMP_UPLIFT: 0.05,
-
- // restitution: bouncyness, friction: rubbing, density: mass
- TILE_FRICTION: 0.99,
- TILE_RESTITUTION: 0.1,
-
- PLAYER_DENSITY: 0.96,
- PLAYER_FRICTION: 5,
- PLAYER_MOTION_FRICTION: 0.1,
- PLAYER_RESTITUTION: 0.0,
- PLAYER_LINEAR_DAMPING: .5,
-
-
- ITEM_DENSITY: 0.9,
- ITEM_FRICTION: 0.99,
- ITEM_RESTITUTION: 0.02,
-
- // BROWSER
- CANVAS_DOM_ID: 'canvasContainer',
- IS_BROWSER_ENVIRONMENT: isBrowserEnvironment(),
- DEBUG_MODE: true,
-
- // NETWORKING
- WORLD_UPDATE_BROADCAST_INTERVAL: 15
- };
-
- function isBrowserEnvironment(){
- return typeof window !== 'undefined';
- }
-
- return Settings;
+define({
+ STAGE_WIDTH: 600,
+ STAGE_HEIGHT: 400,
+
+ // BOX2D INITIALATORS
+ RATIO: 35,
+ BOX2D_WORLD_AABB_SIZE: 3000,
+ BOX2D_ALLOW_SLEEP: true,
+ BOX2D_GRAVITY: 16,
+ BOX2D_VELOCITY_ITERATIONS: 5,
+ BOX2D_POSITION_ITERATIONS: 5,
+ BOX2D_TIME_STEP: 1 / 60,
+
+ // GRAPHIC PATHS
+ GRAPHICS_PATH: 'static/img/',
+ GRAPHICS_SUBPATH_ITEMS: 'items/',
+ GRAPHICS_SUBPATH_CHARACTERS: 'characters/',
+
+ TILE_SIZE: 15,
+
+ // GAME PLAY
+ WALK_SPEED: 2.5,
+ RUN_SPEED: 4.0,
+ FLY_SPEED: 3.2,
+ JUMP_SPEED: 3.0,
+ JUMP_UPLIFT: 0.05,
+
+ // restitution: bouncyness, friction: rubbing, density: mass
+ TILE_FRICTION: 0.99,
+ TILE_RESTITUTION: 0.1,
+
+ PLAYER_DENSITY: 0.96,
+ PLAYER_FRICTION: 5,
+ PLAYER_MOTION_FRICTION: 0.1,
+ PLAYER_RESTITUTION: 0.0,
+ PLAYER_LINEAR_DAMPING: .5,
+
+ ITEM_DENSITY: 0.9,
+ ITEM_FRICTION: 0.99,
+ ITEM_RESTITUTION: 0.02,
+
+ // BROWSER
+ CANVAS_DOM_ID: 'canvasContainer',
+ IS_BROWSER_ENVIRONMENT: typeof window !== 'undefined',
+
+ DEBUG_MODE: true,
+
+ // NETWORKING
+ WORLD_UPDATE_BROADCAST_INTERVAL: 15
})

0 comments on commit b02f169

Please sign in to comment.