Skip to content
This repository
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 140 lines (107 sloc) 3.258 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
TURRET_WIDTH = 100
TURRET_HEIGHT = 50
CANVAS_WIDTH = 600
CANVAS_HEIGHT = 600
PLAYER_CENTER_OFFSET_X = 100
PLAYER_CENTER_OFFSET_Y = 100

FPS = 50

config =
  # Used for animations etc
  fps: FPS

  # Upper limit for processing mouse move events
  mouse_move_fps: 30

  ball_kinds:
    player: 0
    powerup: 1

  # Powerup effects, when you add a new one increase powerup_count below
  powerup_kinds:
    shield: 0
    health: 1

  # TODO is there a better way to do this
  powerup_count: 2

  powerup_messages:
    shield: "Shield powerup!\nPress space to activate."
    health: "Full health powerup!\nPress space to activate."

  # Probability of spawning a powerup
  powerup_probability: 0.5

  # Game Information
  player_ids: [0..3]

  arena_size:
    x: CANVAS_WIDTH
    y: CANVAS_HEIGHT

  balls_enabled: true

  ball_size: 40

  crosshair_size: 64
  pull_radius: 20
  pull_time_ms: 300
  shoot_time_ms: 300

  turret_width: TURRET_WIDTH
  turret_height: TURRET_HEIGHT

  # The offset of the turret picture for the corners.
  turret_offset:
    x: 30
    y: TURRET_HEIGHT/2

  # Max health for each player
  max_health: 1
  health_decimal_places: 2 # Number of decimal places player health is allowed

  lag_limit: 50

  #TODO: rename these to something better
  # radius of circle balls allowed within
  dist_between_balls: 60

  # Number of different levels in 'orbit'
  ball_levels: 3
  rotation_interval: 1000 # Milliseconds between ball rotations
  rotation_time: 500 # Milliseconds to rotate balls

  # Time for game rounds in seconds
  game_time_s: 180

  # Milliseconds between ticks (i.e. 1 second)
  clock_interval: 1000

  # Player Centers, used for ball pulling, turret rotation etc
  player_centers:
    0: { x: PLAYER_CENTER_OFFSET_X, y: PLAYER_CENTER_OFFSET_Y }
    1: { x: CANVAS_WIDTH - PLAYER_CENTER_OFFSET_X, y: PLAYER_CENTER_OFFSET_Y }
    2: { x: CANVAS_WIDTH - PLAYER_CENTER_OFFSET_X, y: CANVAS_HEIGHT - PLAYER_CENTER_OFFSET_Y }
    3: { x: PLAYER_CENTER_OFFSET_X, y: CANVAS_HEIGHT - PLAYER_CENTER_OFFSET_Y }

  turret_pulse_interval: 3000
  collision_check_interval: FPS

  shield_radius: 80
  shield_damage_speed: 500
  survivable_hits: 3
  hit_damage: 0.1

  outcome:
    win: 0
    loss: 1
    draw: 2

  post_game_wait: 3000 # Time to pause after a game

  player_colours:
    0: "#00a2ff"
    1: "#72ff00"
    2: "#fc00ff"
    3: "#fcff00"

  warning_colour: "#ff0000"

  # Default users with passwords
  default_users:
    niklas:
      pass: 'niklas'
      avatar: 'https://dl.dropbox.com/u/5718548/gravitas_profiles/niklas.png'
    lukasz:
      pass: 'lukasz'
      avatar: 'https://dl.dropbox.com/u/5718548/gravitas_profiles/lucas.png'
    peter:
      pass: 'peter'
      avatar: 'https://dl.dropbox.com/u/5718548/gravitas_profiles/pete.png'
    sarah:
      pass: 'sarah'
      avatar: 'https://dl.dropbox.com/u/5718548/gravitas_profiles/sarah.png'
    mark:
      pass: 'mark'
      avatar: 'https://dl.dropbox.com/u/5718548/gravitas_profiles/mark.png'
    x:
      pass: 'x'
      avatar: 'http://amix.dk/uploads/coffeescript.jpg'

  # Length of countdown between a lobby room becoming full and the start of the game
  ready_time_ms: 3000


if exports?
  exports.config = config
else
  @config = config
Something went wrong with that request. Please try again.