Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Important fixes to the library #21

Merged
merged 3 commits into from

2 participants

@tobiastom

Stealing contributership with what will be known as the two best commits in chucks history!

@jeena
Collaborator

@tobiastom nice one but IS_BROWSER_ENVIRONMENT is broken, so we can not pull it this time.

@jeena jeena merged commit b02f169 into logsol:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 56 additions and 71 deletions.
  1. +7 −13 lib/Chuck/Constants.js
  2. +49 −58 lib/Chuck/Settings.js
View
20 lib/Chuck/Constants.js
@@ -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
107 lib/Chuck/Settings.js
@@ -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
})
Something went wrong with that request. Please try again.