public/js-roguelike-skeleton/src/game.js
function Game() {

        // un-populated instance of Array2d
        this.map = new RL.Map(this);
        this.entityManager = new RL.ObjectManager(this, RL.Entity);
        this.renderer = new RL.Renderer(this);
        this.console = new RL.Console(this);
        this.lighting = new RL.LightingROT(this);

        // player purposefully not added to entity manager (matter of preference)
        this.player = new RL.Player(this);

        // make sure "this" is this instance of Game when this.onKeyAction is called
        this.onKeyAction = this.onKeyAction.bind(this);
        this.onClick = this.onClick.bind(this);
        this.onHover = this.onHover.bind(this);

        this.input = new RL.Input(this.onKeyAction);
        this.mouse = new RL.Mouse(this.onClick, this.onHover);

        var el = this.renderer.canvas;
        this.mouse.startListening(el);
    }
function Game() {

        // un-populated instance of Array2d
        this.map = new RL.Map(this);
        this.entityManager = new RL.ObjectManager(this, RL.Entity);
        this.renderer = new RL.Renderer(this);
        this.console = new RL.Console(this);
        this.lighting = new RL.LightingROT(this);

        // player purposefully not added to entity manager (matter of preference)
        this.player = new RL.Player(this);

        // make sure "this" is this instance of Game when this.onKeyAction is called
        this.onKeyAction = this.onKeyAction.bind(this);
        this.onClick = this.onClick.bind(this);
        this.onHover = this.onHover.bind(this);

        this.input = new RL.Input(this.onKeyAction);
        this.mouse = new RL.Mouse(this.onClick, this.onHover);

        var el = this.renderer.canvas;
        this.mouse.startListening(el);
    }
function Game ( ) { // un-populated instance of Array2d this . map = new RL . Map ( this ) ; this . entityManager = new RL . ObjectManager ( this , RL . Entity ) ; this . renderer = new RL . Renderer ( this ) ; this . console = new RL . Console ( this ) ; this . lighting = new RL . LightingROT ( this ) ; // player purposefully not added to entity manager (matter of preference) this . player = new RL . Player ( this ) ; // make sure "this" is this instance of Game when this.onKeyAction is called this . onKeyAction = this . onKeyAction . bind ( this ) ; this . onClick = this . onClick . bind ( this ) ; this . onHover = this . onHover . bind ( this ) ; this . input = new RL . Input ( this . onKeyAction ) ; this . mouse = new RL . Mouse ( this . onClick , this . onHover ) ; var el = this . renderer . canvas ; this . mouse . startListening ( el ) ; }
Container for all game objects.
Handles updating the state of game objects each turn.
Listens for player input to trigger and resolve new turns.
@class Game
@constructor
Container for all game objects . Handles updating the state of game objects each turn . Listens for player input to trigger and resolve new turns .