public/js-roguelike-skeleton/src/game.js
function(action) {
            if(!this.gameOver){
                var result = this.player.update(action);
                if(result){

                    this.entityManager.update(this.player);
                    this.player.updateFov();

                    this.lighting.update();
                    this.renderer.setCenter(this.player.x, this.player.y);
                    this.renderer.draw();

                } else if(this.queueDraw){
                    this.renderer.draw();
                }
            }
            this.queueDraw = false;
        }
function(action) {
            if(!this.gameOver){
                var result = this.player.update(action);
                if(result){

                    this.entityManager.update(this.player);
                    this.player.updateFov();

                    this.lighting.update();
                    this.renderer.setCenter(this.player.x, this.player.y);
                    this.renderer.draw();

                } else if(this.queueDraw){
                    this.renderer.draw();
                }
            }
            this.queueDraw = false;
        }
function ( action ) { if ( ! this . gameOver ) { var result = this . player . update ( action ) ; if ( result ) { this . entityManager . update ( this . player ) ; this . player . updateFov ( ) ; this . lighting . update ( ) ; this . renderer . setCenter ( this . player . x , this . player . y ) ; this . renderer . draw ( ) ; } else if ( this . queueDraw ) { this . renderer . draw ( ) ; } } this . queueDraw = false ; }
Handles user input actions.
@method onKeyAction
@param {String} action - Action triggered by user input.
Handles user input actions .