Skip to content
Marc Sluiter edited this page Aug 3, 2014 · 5 revisions

Webracer

Webracer is a demo project by Marc Sluiter aka slintes. It makes use of several interesting technologies and frameworks like Gradle, OSGi, Jetty, Docker and the Quintus Game Engine.

The requirements were:

  • Write a web based “real time” racing game, where a number of cars have to drive a configurable number of laps (default 3) around a track. It is a 2 dimensional, top down game and each car is controlled by a user sending “commands” that are processed every time interval or turn.
  • When a person joins, he needs to enter his name. He then gets assigned a car (color). A race starts 10 seconds after the last person joined, with a minimum of 2 people. A race ends when all cars have either finished or crashed, or 5 minutes after the leader has finished, or 15 minutes after the start of the race. When the race has ended, the results are displayed for 30 seconds, persisted to some file or database and then signup for the next race starts.
  • The car has three speeds (stopped, slow, fast) and a steering wheel that can either go straight, left or right. In every time interval only one command can be received, and a command can only change either the speed or the steering, and only change it in one step (so from “stopped” to “slow” or from “left” to “straight” but not from “left” to “right” or “stopped” to “fast”. The car moves ahead N (N being zero, some number and 2 * some number) meters and might turn left or right R degrees (R being -some number, 0 or +some number).
  • The track is made out of asphalt, with a strip of grass on both sides and at the end of the grass is a wall. A car can only go “fast” on asphalt, on the grass it can either be stopped or going slow. If a car hits the wall, it crashes and cannot continue. Cars cannot hit each other.

This Wiki documents the design of the Webracer project and provides instruction for building and running it.

Design

Building and running

Clone this wiki locally