Skip to content

Commit

Permalink
feat: 🎸 Extend walking functionality to use a and d keys
Browse files Browse the repository at this point in the history
✅ Closes: #167
  • Loading branch information
MadejaMaciej committed May 4, 2024
1 parent 39695e5 commit e71a294
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 32 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,5 @@ out/
dist/

package-lock.json
yarn.lock
yarn.lock
*.code-workspace
19 changes: 7 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
Lost Dutchman Mine Change Log
=============================
# Lost Dutchman Mine Change Log

0.2.3 May 5, 2024
-------------------
## 0.2.3 May 5, 2024

- Bug #154: Fix size of windows build (MadejaMaciej)

- Enh #167: Extend walking functionality to use additional keys (MadejaMaciej)
- Enh #159: Force device orientation on mobile apps to landscape (MadejaMaciej)
- Enh #153: Specify email and homepage fields in package.json (MadejaMaciej)
- Enh #20: Tweak mobile code to make it to work (MadejaMaciej)

0.2.2 April 21, 2024
-------------------
## 0.2.2 April 21, 2024

- Ref #151: Run linter and formatter on codebases (MadejaMaciej)

Expand All @@ -34,8 +32,7 @@ Lost Dutchman Mine Change Log
- Enh #23: Implement changing city map to terrain map when reaching bands (MadejaMaciej)
- Enh #18: Transfer code to mobile version (MadejaMaciej)

0.2.1 March 25, 2024
-------------------
## 0.2.1 March 25, 2024

- Opt #100: Optimization of player script and animation frames (MadejaMaciej)

Expand All @@ -57,8 +54,7 @@ Lost Dutchman Mine Change Log
- Enh #50: Detect system default language (MadejaMaciej)
- Enh #44: Change country codes to flags (MadejaMaciej)

0.0.2 March 19, 2024
-------------------
## 0.0.2 March 19, 2024

- Bug #66: Fix player moving in menu and pause screen (MadejaMaciej)
- Bug #40: Fix player resizing with change of window height (MadejaMaciej)
Expand All @@ -72,8 +68,7 @@ Lost Dutchman Mine Change Log
- Enh #16: Added load game possibility (MadejaMaciej)
- Enh #15: Added save game possibility (MadejaMaciej)

0.0.1 March 10, 2024
-------------------
## 0.0.1 March 10, 2024

- Bug #8: Get rid off type errors in native app (MadejaMaciej)
- Bug #6: Get rid off file is not a module error (MadejaMaciej)
Expand Down
16 changes: 0 additions & 16 deletions ldm.code-workspace

This file was deleted.

11 changes: 8 additions & 3 deletions src/classes/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,20 @@ class Player extends Character {
const lastAnimation = tick - lastAnimationPlayed;
lastTick = tick;
let dir = directions.NONE;
if (this.keyPressed === "ArrowLeft") {
if (this.keyPressed === "ArrowLeft" || this.keyPressed === "a") {
dir = directions.LEFT;
}

if (this.keyPressed === "ArrowRight") {
if (this.keyPressed === "ArrowRight" || this.keyPressed === "d") {
dir = directions.RIGHT;
}

if (this.keyPressed === "ArrowRight" || this.keyPressed === "ArrowLeft") {
if (
this.keyPressed === "ArrowRight" ||
this.keyPressed === "ArrowLeft" ||
this.keyPressed === "a" ||
this.keyPressed === "d"
) {
this.handleArrowMovement(delta, dir, tick, lastAnimation);
} else {
if (this.traveling) {
Expand Down

0 comments on commit e71a294

Please sign in to comment.