58 lines
2.0 KiB
TypeScript
58 lines
2.0 KiB
TypeScript
// Rink dimensions (meters)
|
|
export const RINK_LENGTH = 60; // meters
|
|
export const RINK_WIDTH = 30; // meters
|
|
|
|
// Scale factor: 1 meter = 10 pixels
|
|
export const SCALE = 20;
|
|
|
|
// Rink corner radius
|
|
export const RINK_CORNER_RADIUS = 6; // meters
|
|
|
|
// Zone lines (meters from center)
|
|
export const BLUE_LINE_OFFSET = 9; // meters from center
|
|
export const GOAL_LINE_OFFSET = 26; // meters from center
|
|
|
|
// Goal dimensions
|
|
export const GOAL_WIDTH = 1.8; // meters
|
|
export const GOAL_DEPTH = 1.2; // meters
|
|
|
|
// Colors
|
|
export const COLOR_ICE = 0xf0f8ff;
|
|
export const COLOR_BOARDS = 0x8b4513;
|
|
export const COLOR_RED_LINE = 0xff0000;
|
|
export const COLOR_BLUE_LINE = 0x0000ff;
|
|
export const COLOR_GOAL_CREASE = 0x87ceeb;
|
|
|
|
// Game settings
|
|
export const FPS = 60;
|
|
export const DEBUG = true;
|
|
|
|
// Player constants
|
|
export const PLAYER_RADIUS_GOALIE = 12; // pixels
|
|
export const PLAYER_RADIUS_SKATER = 10; // pixels
|
|
export const PLAYER_ROTATION_SPEED = 1; // radians per second
|
|
export const SPEED_SCALE_FACTOR = 10; // speed attribute (0-100) / 10 = m/s
|
|
export const GOAL_DECELERATION_RATE = 0.9; // Speed multiplier reduction after goal
|
|
|
|
// Movement constants
|
|
export const MOVEMENT_STOP_THRESHOLD = 0.1; // meters - stop moving when this close to target
|
|
|
|
// Puck constants
|
|
export const PUCK_PICKUP_RADIUS = 1.5; // meters
|
|
export const PUCK_CARRY_DISTANCE = 1.0; // meters in front of player
|
|
export const MAX_PUCK_VELOCITY = 50; // m/s
|
|
export const SHOT_SPEED = 30; // m/s
|
|
|
|
// Goal constants
|
|
export const GOAL_POST_THICKNESS = 0.3; // meters
|
|
export const GOAL_BAR_THICKNESS = 0.4; // meters
|
|
|
|
// Rink visual constants
|
|
export const FACEOFF_CIRCLE_RADIUS = 4.5; // meters
|
|
export const CENTER_DOT_RADIUS = 5; // pixels
|
|
|
|
// AI/Behavior constants
|
|
export const SHOOTING_RANGE = 10; // meters - max distance to attempt shot
|
|
export const SHOOTING_ANGLE_THRESHOLD = Math.PI / 4; // radians (45 degrees)
|
|
export const GOALIE_RANGE = 3; // meters - how far goalie moves from center
|