Skip to content

Overview

Tor edited this page May 16, 2017 · 1 revision
  • The game client in game.html initiates the game.
  • The game has a world which is a stack of layers, each with a 2d array of tiles. Empty tiles are null, and occupied ones have actors in them.
  • The game client in game.html handles passing keyboard input to the game.
  • The game runs by itself even without the renderer.
  • The renderer takes the game's world, iterates through its actors on all layers and draws them out every frame.
  • Every frame, the renderer also handles things like rendering the pause menu, drawing health, the minimap, and other UI elements based on the state of the game.
  • Every frame, the renderer also handles lighting by darkening fogged (fog of war) tiles and emulates lighting by using a falloff equation to determine how much black to mix into a sprites tint attribute.
Clone this wiki locally