Skip to content

Instantly share code, notes, and snippets.

@spolu
Created October 10, 2012 12:08
Show Gist options
  • Save spolu/3865205 to your computer and use it in GitHub Desktop.
Save spolu/3865205 to your computer and use it in GitHub Desktop.
[Project] Fl0ck ReadMe

Fl0ck

Fl0ck is a programming game in which two or more programs control one or more spaceships in a SpaceWar-like environment with the goal of eliminating every other enemy ships and survive as long as possible.

Since it is a SpaceWar-like environment, there is a physical simulation going on. Physics are simulated by simple newtonian integration with a predefined step.

Knwon as fl0cks, the programs are written in JavaScript and interfaced with the simulation through a unique function control called at each step of the simulation.

Fl0cks must be entirely contained within a single file when submitted to the engine. Each call to the control function should take no longer than 100ms. Additionally the memory used at any time should not exceed 100MB.

Simulation and Data Model

/**
 * Control handler called at each step of the simulation
 * @param sim { t, { DELTA, MAX_SPEED, MAX_THRUST, MAX_ROTATION } }
 * @param ship { p, v, owner }
 * @param ships [ { p, v, owner, friendly } ]
 * @param missiles [ { p, v, owner, friendly } ]
 * @param cb(thrust, rotation, shoot) 
 *    thrust in [0, MAX_THRUST]
 *    rotation in [0, MAX_ROTATION]
 *    shoot boolean
 */

function control(sim, ship, ships, missiles, cb) {}

Usage

fl0ck signup
fl0ck login
fl0ck challenge new user path
fl0ck challenge list
fl0ck challenge accept index path
fl0ck train path1 path2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment