Skip to content

Commit

Permalink
Minor clean-ups
Browse files Browse the repository at this point in the history
  • Loading branch information
ndorfin committed Mar 15, 2024
1 parent 0e7df38 commit b4927a9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions assets/mjs/wc/game-engine.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,11 @@ export default class GameEngine extends GameElement {
}

handleLanderKeyboardInupts(event) {
this.#manualControl = false;
let keyName = event.key;
let eventType = event.type;
let item = this.#keyMap[keyName];
let item = this.#keyMap[event.key];

if (item) {
item.active = (eventType === 'keydown') ? true : false;
this.#manualControl = false;
item.active = (event.type === 'keydown') ? true : false;
}
}

Expand All @@ -229,7 +228,8 @@ export default class GameEngine extends GameElement {
// Go through the batched inputs and change the lander's position
Object.keys(this.#keyMap).forEach(keyName => {
let keyItem = this.#keyMap[keyName];
let landerProperty = this.#keyMap[keyName].affects;
let landerProperty = keyItem.affects;

if (keyItem.active) {
this.modelLander[landerProperty] = this.modelLander[landerProperty] + keyItem.change;
}
Expand Down

0 comments on commit b4927a9

Please sign in to comment.