Implements game mechanics.