+
the abstraction engine
+
a game based on the lambda calculus
+
+
+
+
+
+
+ );
+};
diff --git a/src/css/style.css b/src/css/style.css
index 35fdc31..1b98555 100644
--- a/src/css/style.css
+++ b/src/css/style.css
@@ -12,7 +12,6 @@
padding: 0;
margin: 0;
font-family: "scientifica", monospace;
- transition: background 0.2s ease-in-out;
font-smooth: never;
}
@@ -21,10 +20,13 @@ body {
margin: 0;
width: 100%;
height: 100%;
+ background: radial-gradient(ellipse at top, var(--bg), transparent),
+ radial-gradient(ellipse at left, var(--blue), transparent),
+ radial-gradient(ellipse at right, var(--purple), transparent),
+ radial-gradient(ellipse at bottom, var(--bg), transparent);
}
body {
- background-color: var(--bg);
color: var(--text);
}
@@ -51,17 +53,20 @@ a:visited {
justify-content: space-around;
padding-top: 1rem;
padding-bottom: 1rem;
+ border-bottom: 2px solid var(--yellow);
+ border-radius: 0.5rem;
}
.content {
- border-top: 1px solid var(--yellow);
- border-bottom: 1px solid var(--yellow);
max-height: 90vh;
}
.footer {
+ border-top: 2px solid var(--yellow);
+ border-radius: 0.5rem;
padding-top: 1rem;
padding-bottom: 1rem;
+ text-align: center;
}
.nav {
@@ -88,12 +93,13 @@ a:visited {
.centered-game canvas {
display: block;
- max-height: 90%;
+ max-height: 100%;
width: auto;
max-width: 100%;
border: 1px solid var(--yellow);
border-radius: 0.5rem;
- margin: 0;
+ margin-bottom: 2rem;
+ background-color: var(--bg);
}
button {
diff --git a/src/engine/TheAbstractionEngine.ts b/src/engine/TheAbstractionEngine.ts
index 20ff6cc..93684ef 100644
--- a/src/engine/TheAbstractionEngine.ts
+++ b/src/engine/TheAbstractionEngine.ts
@@ -7,6 +7,7 @@ import {
Key,
LockedDoor,
Curry,
+ FunctionApplication,
} from "./entities";
import {
Grid,
@@ -16,6 +17,7 @@ import {
Collision,
GridSpawner,
Life,
+ Music,
} from "./systems";
export class TheAbstractionEngine {
@@ -49,8 +51,9 @@ export class TheAbstractionEngine {
),
new GridSpawner(),
new Collision(),
- new Render(this.ctx),
new Life(),
+ new Music(),
+ new Render(this.ctx),
].forEach((system) => this.game.addSystem(system));
const player = new Player();
@@ -70,6 +73,9 @@ export class TheAbstractionEngine {
const curry = new Curry({ x: 9, y: 8 });
this.game.addEntity(curry);
+
+ const application = new FunctionApplication({ x: 5, y: 5 }, "(_INPUT key)");
+ this.game.addEntity(application);
}
public play() {
diff --git a/src/engine/components/Grid.ts b/src/engine/components/Grid.ts
index a62cc7b..9fad5ce 100644
--- a/src/engine/components/Grid.ts
+++ b/src/engine/components/Grid.ts
@@ -6,6 +6,7 @@ export class Grid extends Component {
public gridPosition: Coord2D;
public movingDirection: Direction;
+ public previousDirection: Direction;
constructor(position: Coord2D = { x: 0, y: 0 }) {
super(ComponentNames.Grid);
@@ -13,5 +14,6 @@ export class Grid extends Component {
this.initialized = false;
this.gridPosition = position;
this.movingDirection = Direction.NONE;
+ this.previousDirection = this.movingDirection;
}
}
diff --git a/src/engine/config/assets.ts b/src/engine/config/assets.ts
index 5ce13e8..fbfab2f 100644
--- a/src/engine/config/assets.ts
+++ b/src/engine/config/assets.ts
@@ -1,4 +1,5 @@
import { type SpriteSpec, SPRITE_SPECS } from ".";
+import { SOUND_SPECS, SoundSpec } from "./sounds";
export const FONT = new FontFace("scientifica", "url(/fonts/scientifica.ttf)");
FONT.load().then((font) => {
@@ -6,6 +7,7 @@ FONT.load().then((font) => {
});
export const IMAGES = new Map