Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Important fixes to the library #21

Merged
merged 3 commits into from Jul 19, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 7 additions & 13 deletions 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_TILE: 'tile'
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;

}); });
107 changes: 49 additions & 58 deletions lib/Chuck/Settings.js
@@ -1,59 +1,50 @@
define(function() { define({

STAGE_WIDTH: 600,
var Settings = { STAGE_HEIGHT: 400,
STAGE_WIDTH: 600,
STAGE_HEIGHT: 400, // BOX2D INITIALATORS

RATIO: 35,
// BOX2D INITIALATORS BOX2D_WORLD_AABB_SIZE: 3000,
RATIO: 35, BOX2D_ALLOW_SLEEP: true,
BOX2D_WORLD_AABB_SIZE: 3000, BOX2D_GRAVITY: 16,
BOX2D_ALLOW_SLEEP: true, BOX2D_VELOCITY_ITERATIONS: 5,
BOX2D_GRAVITY: 16, BOX2D_POSITION_ITERATIONS: 5,
BOX2D_VELOCITY_ITERATIONS: 5, BOX2D_TIME_STEP: 1 / 60,
BOX2D_POSITION_ITERATIONS: 5,
BOX2D_TIME_STEP: 1 / 60, // GRAPHIC PATHS

GRAPHICS_PATH: 'static/img/',
// GRAPHIC PATHS GRAPHICS_SUBPATH_ITEMS: 'items/',
GRAPHICS_PATH: 'static/img/', GRAPHICS_SUBPATH_CHARACTERS: 'characters/',
GRAPHICS_SUBPATH_ITEMS: 'items/',
GRAPHICS_SUBPATH_CHARACTERS: 'characters/', TILE_SIZE: 15,


TILE_SIZE: 15, // GAME PLAY

WALK_SPEED: 2.5,
// GAME PLAY RUN_SPEED: 4.0,
WALK_SPEED: 2.5, FLY_SPEED: 3.2,
RUN_SPEED: 4.0, JUMP_SPEED: 3.0,
FLY_SPEED: 3.2, JUMP_UPLIFT: 0.05,
JUMP_SPEED: 3.0,
JUMP_UPLIFT: 0.05, // restitution: bouncyness, friction: rubbing, density: mass

TILE_FRICTION: 0.99,
// restitution: bouncyness, friction: rubbing, density: mass TILE_RESTITUTION: 0.1,
TILE_FRICTION: 0.99,
TILE_RESTITUTION: 0.1, PLAYER_DENSITY: 0.96,

PLAYER_FRICTION: 5,
PLAYER_DENSITY: 0.96, PLAYER_MOTION_FRICTION: 0.1,
PLAYER_FRICTION: 5, PLAYER_RESTITUTION: 0.0,
PLAYER_MOTION_FRICTION: 0.1, PLAYER_LINEAR_DAMPING: .5,
PLAYER_RESTITUTION: 0.0,
PLAYER_LINEAR_DAMPING: .5, ITEM_DENSITY: 0.9,

ITEM_FRICTION: 0.99,

ITEM_RESTITUTION: 0.02,
ITEM_DENSITY: 0.9,
ITEM_FRICTION: 0.99, // BROWSER
ITEM_RESTITUTION: 0.02, CANVAS_DOM_ID: 'canvasContainer',

IS_BROWSER_ENVIRONMENT: typeof window !== 'undefined',
// BROWSER
CANVAS_DOM_ID: 'canvasContainer', DEBUG_MODE: true,
IS_BROWSER_ENVIRONMENT: isBrowserEnvironment(),
DEBUG_MODE: true, // NETWORKING

WORLD_UPDATE_BROADCAST_INTERVAL: 15
// NETWORKING
WORLD_UPDATE_BROADCAST_INTERVAL: 15
};

function isBrowserEnvironment(){
return typeof window !== 'undefined';
}

return Settings;
}) })