<commit_before>const Howler = require('howler');
const ClientEngine = require('incheon').ClientEngine;
const SpaaaceRenderer = require('../client/SpaaaceRenderer');

class SpaaaceClientEngine extends ClientEngine {
    constructor(gameEngine, options) {
        super(gameEngine, options);

        // initialize renderer
        this.renderer = new SpaaaceRenderer(gameEngine);

        this.serializer.registerClass(require('../common/Ship'));
        this.serializer.registerClass(require('../common/Missile'));

        this.gameEngine.on('client.preStep', this.preStep.bind(this));
    }

    start() {

        super.start();

        //  Game input
        // keep a reference for key press state
        this.pressedKeys = {};

        // add special handler for space key
        document.addEventListener('keydown', (e) => {
            if (e.keyCode=='32' && this.lastKeyPressed==null) {
                this.sendInput('space');
            }
        });

        document.addEventListener('keydown', (e) => { onKeyChange.call(this, e, true);});
        document.addEventListener('keyup', (e) => { onKeyChange.call(this, e, false);});

        // handle sounds
        this.sounds = {<commit_msg>clientEngine: fixed issue where fire key would not be responsive<commit_after>const Howler = require('howler');
const ClientEngine = require('incheon').ClientEngine;
const SpaaaceRenderer = require('../client/SpaaaceRenderer');

class SpaaaceClientEngine extends ClientEngine {
    constructor(gameEngine, options) {
        super(gameEngine, options);

        // initialize renderer
        this.renderer = new SpaaaceRenderer(gameEngine);

        this.serializer.registerClass(require('../common/Ship'));
        this.serializer.registerClass(require('../common/Missile'));

        this.gameEngine.on('client.preStep', this.preStep.bind(this));
    }

    start() {

        super.start();

        //  Game input
        // keep a reference for key press state
        this.pressedKeys = {};

        // add special handler for space key
        document.addEventListener('keydown', (e) => {
            if (e.keyCode=='32' && this.pressedKeys['space']==false) {
                this.sendInput('space');
            }
        });

        document.addEventListener('keydown', (e) => { onKeyChange.call(this, e, true);});
        document.addEventListener('keyup', (e) => { onKeyChange.call(this, e, false);});

        // handle sounds
        this.sounds = {
{'fraction_non_alphanumeric': 0.14441747572815533, 'fraction_numerical': 0.0016181229773462784, 'mean_word_length': 2.669139465875371, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1344728', 'n_tokens_mistral': 686, 'n_tokens_neox': 662, 'n_words': 135}