summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--public/assets/sound/move_2.wavbin12524 -> 4312 bytes
-rw-r--r--public/assets/sound/move_3.wavbin4136 -> 0 bytes
-rw-r--r--public/assets/sound/move_4.wavbin4312 -> 0 bytes
-rw-r--r--public/assets/sound/music/home.mp3bin0 -> 6910102 bytes
-rw-r--r--src/App.tsx6
-rw-r--r--src/components/Title.tsx11
-rw-r--r--src/engine/config/sounds.ts12
-rw-r--r--src/engine/systems/Grid.ts7
8 files changed, 27 insertions, 9 deletions
diff --git a/public/assets/sound/move_2.wav b/public/assets/sound/move_2.wav
index d69e5e5..0407d8a 100644
--- a/public/assets/sound/move_2.wav
+++ b/public/assets/sound/move_2.wav
Binary files differ
diff --git a/public/assets/sound/move_3.wav b/public/assets/sound/move_3.wav
deleted file mode 100644
index 3ade3bc..0000000
--- a/public/assets/sound/move_3.wav
+++ /dev/null
Binary files differ
diff --git a/public/assets/sound/move_4.wav b/public/assets/sound/move_4.wav
deleted file mode 100644
index 0407d8a..0000000
--- a/public/assets/sound/move_4.wav
+++ /dev/null
Binary files differ
diff --git a/public/assets/sound/music/home.mp3 b/public/assets/sound/music/home.mp3
new file mode 100644
index 0000000..5f51659
--- /dev/null
+++ b/public/assets/sound/music/home.mp3
Binary files differ
diff --git a/src/App.tsx b/src/App.tsx
index 295b01b..6bd26b9 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -22,11 +22,7 @@ export const App = () => {
<div className="footer">
<span>
built by{" "}
- <a
- href="https://git.simponic.xyz/simponic"
- target="_blank"
- className="tf"
- >
+ <a href="https://github.com/simponic" target="_blank" className="tf">
simponic
</a>{" "}
| inspired by{" "}
diff --git a/src/components/Title.tsx b/src/components/Title.tsx
index 99c7584..1736cba 100644
--- a/src/components/Title.tsx
+++ b/src/components/Title.tsx
@@ -7,6 +7,17 @@ export const Title = ({ setReady }: TitleProps) => {
<div style={{ textAlign: "center" }}>
<h1>the abstraction engine</h1>
<p>a game based on the lambda calculus</p>
+ <p>
+ engine{" "}
+ <a
+ href="https://git.simponic.xyz/the-abstraction-engine"
+ target="_blank"
+ >
+ from scratch
+ </a>
+ </p>
+ <br />
+ <p>WASD/arrow keys to move, space/enter to interact</p>
<br />
<hr />
diff --git a/src/engine/config/sounds.ts b/src/engine/config/sounds.ts
index b182c86..d6c564f 100644
--- a/src/engine/config/sounds.ts
+++ b/src/engine/config/sounds.ts
@@ -9,9 +9,7 @@ export const MovingSound: SoundSpec = {
name: "moving",
states: new Map([
[1, { name: "moving_1", url: "/assets/sound/move_1.wav" }],
- // [2, { name: "moving_2", url: "/assets/sound/move_2.wav" }],
- // [3, { name: "moving_3", url: "/assets/sound/move_3.wav" }],
- [4, { name: "moving_4", url: "/assets/sound/move_4.wav" }],
+ [2, { name: "moving_2", url: "/assets/sound/move_2.wav" }],
]),
};
@@ -69,6 +67,14 @@ export const Music: SoundSpec = {
volume: 0.5,
},
],
+ [
+ "home",
+ {
+ name: "home",
+ url: "/assets/sound/music/home.mp3",
+ volume: 0.5,
+ },
+ ],
]),
};
diff --git a/src/engine/systems/Grid.ts b/src/engine/systems/Grid.ts
index 9ab28e3..1ec8ed9 100644
--- a/src/engine/systems/Grid.ts
+++ b/src/engine/systems/Grid.ts
@@ -116,7 +116,12 @@ export class Grid extends System {
const moving = new Set<string>();
moving.add(entity.id);
- while (!this.isOutOfBounds(nextGridPosition)) {
+ while (true) {
+ if (this.isOutOfBounds(nextGridPosition)) {
+ moving.clear();
+ break;
+ }
+
const { x, y } = nextGridPosition;
const entities = Array.from(this.grid[y][x]).map(
(id) => game.getEntity(id)!,