summaryrefslogtreecommitdiff
path: root/src/engine/entities
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/entities')
-rw-r--r--src/engine/entities/Curry.ts10
-rw-r--r--src/engine/entities/FunctionApplication.ts18
-rw-r--r--src/engine/entities/FunctionBox.ts14
-rw-r--r--src/engine/entities/Grass.ts4
-rw-r--r--src/engine/entities/Key.ts10
-rw-r--r--src/engine/entities/LambdaFactory.ts22
-rw-r--r--src/engine/entities/LockedDoor.ts10
-rw-r--r--src/engine/entities/Particles.ts16
-rw-r--r--src/engine/entities/Player.ts10
-rw-r--r--src/engine/entities/Portal.ts8
-rw-r--r--src/engine/entities/Wall.ts10
11 files changed, 66 insertions, 66 deletions
diff --git a/src/engine/entities/Curry.ts b/src/engine/entities/Curry.ts
index 19c5b91..583b9b8 100644
--- a/src/engine/entities/Curry.ts
+++ b/src/engine/entities/Curry.ts
@@ -8,7 +8,7 @@ import { Level, SystemNames } from "../systems";
export class Curry extends Entity {
private static spriteSpec: SpriteSpec = SPRITE_SPECS.get(
- Sprites.CURRY,
+ Sprites.CURRY
) as SpriteSpec;
constructor(gridPosition: Coord2D) {
@@ -28,8 +28,8 @@ export class Curry extends Entity {
width: Curry.spriteSpec.width,
height: Curry.spriteSpec.height,
},
- 0,
- ),
+ 0
+ )
);
this.addComponent(
@@ -41,8 +41,8 @@ export class Curry extends Entity {
height: Curry.spriteSpec.height,
},
Curry.spriteSpec.msPerFrame,
- Curry.spriteSpec.frames,
- ),
+ Curry.spriteSpec.frames
+ )
);
}
diff --git a/src/engine/entities/FunctionApplication.ts b/src/engine/entities/FunctionApplication.ts
index 24e4eec..d907eca 100644
--- a/src/engine/entities/FunctionApplication.ts
+++ b/src/engine/entities/FunctionApplication.ts
@@ -56,8 +56,8 @@ export class FunctionApplication extends Entity {
y: 0,
},
dimension,
- 0,
- ),
+ 0
+ )
);
this.addComponent(new Grid(gridPosition));
@@ -70,8 +70,8 @@ export class FunctionApplication extends Entity {
{ x: 0, y: 0 },
dimension,
FunctionApplication.spriteSpec.msPerFrame,
- FunctionApplication.spriteSpec.frames,
- ),
+ FunctionApplication.spriteSpec.frames
+ )
);
this.addComponent(new Colliding(this.handleCollision.bind(this)));
@@ -94,7 +94,7 @@ export class FunctionApplication extends Entity {
const gridSystem = game.getSystem<GridSystem>(SystemNames.Grid);
const fail = () => {
entityGrid.movingDirection = gridSystem.oppositeDirection(
- entityGrid.previousDirection,
+ entityGrid.previousDirection
);
entity.addComponent(entityGrid);
@@ -103,10 +103,10 @@ export class FunctionApplication extends Entity {
};
const applicationTerm = this.getComponent<LambdaTerm>(
- ComponentNames.LambdaTerm,
+ ComponentNames.LambdaTerm
);
const functionTerm = entity.getComponent<LambdaTerm>(
- ComponentNames.LambdaTerm,
+ ComponentNames.LambdaTerm
);
const newCode = applicationTerm.code.replace("_INPUT", functionTerm.code);
let result: DebrujinifiedLambdaTerm | null = null;
@@ -121,7 +121,7 @@ export class FunctionApplication extends Entity {
const { dimension } = gridSystem;
const nextPosition = gridSystem.getNewGridPosition(
grid.gridPosition,
- entityGrid.previousDirection,
+ entityGrid.previousDirection
);
let applicationResultingEntity: Entity | null = null; // this should be its own function
@@ -142,7 +142,7 @@ export class FunctionApplication extends Entity {
game.removeEntity(entity.id);
if (applicationResultingEntity) {
const grid = applicationResultingEntity.getComponent<Grid>(
- ComponentNames.Grid,
+ ComponentNames.Grid
);
grid.movingDirection = entityGrid.previousDirection;
applicationResultingEntity.addComponent(grid);
diff --git a/src/engine/entities/FunctionBox.ts b/src/engine/entities/FunctionBox.ts
index 0c9123e..dac2174 100644
--- a/src/engine/entities/FunctionBox.ts
+++ b/src/engine/entities/FunctionBox.ts
@@ -24,7 +24,7 @@ import { openModal, closeModal } from "../utils";
export class FunctionBox extends Entity {
private static spriteSpec: SpriteSpec = SPRITE_SPECS.get(
- Sprites.FUNCTION_BOX,
+ Sprites.FUNCTION_BOX
) as SpriteSpec;
constructor(gridPosition: Coord2D, code: string) {
@@ -40,8 +40,8 @@ export class FunctionBox extends Entity {
width: FunctionBox.spriteSpec.width,
height: FunctionBox.spriteSpec.height,
},
- 0,
- ),
+ 0
+ )
);
this.addComponent(new Pushable());
@@ -57,8 +57,8 @@ export class FunctionBox extends Entity {
height: FunctionBox.spriteSpec.height,
},
FunctionBox.spriteSpec.msPerFrame,
- FunctionBox.spriteSpec.frames,
- ),
+ FunctionBox.spriteSpec.frames
+ )
);
this.addComponent(new LambdaTerm(code));
@@ -88,10 +88,10 @@ export const makeLambdaTermHighlightComponent = (entity: Entity) => {
}
const code = entity.getComponent<LambdaTerm>(
- ComponentNames.LambdaTerm,
+ ComponentNames.LambdaTerm
)!.code;
openModal(
- `<div style="text-align:center"><p>${code}</p> <br> <button id="close">Close</button></div>`,
+ `<div style="text-align:center"><p>${code}</p> <br> <button id="close">Close</button></div>`
);
modalOpen = true;
SOUNDS.get(ModalOpen.name)!.play();
diff --git a/src/engine/entities/Grass.ts b/src/engine/entities/Grass.ts
index 70fd601..4fdf1bc 100644
--- a/src/engine/entities/Grass.ts
+++ b/src/engine/entities/Grass.ts
@@ -20,8 +20,8 @@ export class Grass extends Entity {
height: Grass.spriteSpec.height,
},
Grass.spriteSpec.msPerFrame,
- Grass.spriteSpec.frames,
- ),
+ Grass.spriteSpec.frames
+ )
);
}
}
diff --git a/src/engine/entities/Key.ts b/src/engine/entities/Key.ts
index 7168ee8..ec86d0a 100644
--- a/src/engine/entities/Key.ts
+++ b/src/engine/entities/Key.ts
@@ -5,7 +5,7 @@ import { Coord2D } from "../interfaces";
export class Key extends Entity {
private static spriteSpec: SpriteSpec = SPRITE_SPECS.get(
- Sprites.KEY,
+ Sprites.KEY
) as SpriteSpec;
constructor(gridPosition: Coord2D) {
@@ -25,8 +25,8 @@ export class Key extends Entity {
width: Key.spriteSpec.width,
height: Key.spriteSpec.height,
},
- 0,
- ),
+ 0
+ )
);
this.addComponent(
@@ -38,8 +38,8 @@ export class Key extends Entity {
height: Key.spriteSpec.height,
},
Key.spriteSpec.msPerFrame,
- Key.spriteSpec.frames,
- ),
+ Key.spriteSpec.frames
+ )
);
}
}
diff --git a/src/engine/entities/LambdaFactory.ts b/src/engine/entities/LambdaFactory.ts
index 770c096..6f75e90 100644
--- a/src/engine/entities/LambdaFactory.ts
+++ b/src/engine/entities/LambdaFactory.ts
@@ -75,7 +75,7 @@ const syntaxErrorDecoration = Decoration.mark({
export class LambdaFactory extends Entity {
private static spriteSpec: SpriteSpec = SPRITE_SPECS.get(
- Sprites.LAMBDA_FACTORY,
+ Sprites.LAMBDA_FACTORY
) as SpriteSpec;
private codeEditorState: CodeEditorState | null;
@@ -99,8 +99,8 @@ export class LambdaFactory extends Entity {
width: LambdaFactory.spriteSpec.width,
height: LambdaFactory.spriteSpec.height,
},
- 0,
- ),
+ 0
+ )
);
this.addComponent(new Text(spawns.toString()));
@@ -110,8 +110,8 @@ export class LambdaFactory extends Entity {
this.addComponent(
new GridSpawn(
this.spawns,
- () => new FunctionBox({ x: 0, y: 0 }, this.code),
- ),
+ () => new FunctionBox({ x: 0, y: 0 }, this.code)
+ )
);
this.addComponent(new Grid(gridPosition));
@@ -125,15 +125,15 @@ export class LambdaFactory extends Entity {
height: LambdaFactory.spriteSpec.height,
},
LambdaFactory.spriteSpec.msPerFrame,
- LambdaFactory.spriteSpec.frames,
- ),
+ LambdaFactory.spriteSpec.frames
+ )
);
this.addComponent(
new Highlight(
(direction) => this.onHighlight(direction),
- () => this.onUnhighlight(),
- ),
+ () => this.onUnhighlight()
+ )
);
}
@@ -179,10 +179,10 @@ export class LambdaFactory extends Entity {
const codeBox = document.getElementById("code")!;
const syntaxError = document.getElementById("syntax-error")!;
const canvas = document.getElementById(
- Miscellaneous.CANVAS_ID,
+ Miscellaneous.CANVAS_ID
) as HTMLCanvasElement;
const closeButton = document.getElementById(
- "close-modal",
+ "close-modal"
) as HTMLButtonElement;
closeButton.addEventListener("click", () => this.saveAndCloseCodeEditor());
diff --git a/src/engine/entities/LockedDoor.ts b/src/engine/entities/LockedDoor.ts
index aa1f328..3d1fbbe 100644
--- a/src/engine/entities/LockedDoor.ts
+++ b/src/engine/entities/LockedDoor.ts
@@ -21,7 +21,7 @@ import { colors } from "../utils";
export class LockedDoor extends Entity {
private static spriteSpec: SpriteSpec = SPRITE_SPECS.get(
- Sprites.LOCKED_DOOR,
+ Sprites.LOCKED_DOOR
) as SpriteSpec;
constructor(gridPosition: Coord2D) {
@@ -41,8 +41,8 @@ export class LockedDoor extends Entity {
width: LockedDoor.spriteSpec.width,
height: LockedDoor.spriteSpec.height,
},
- 0,
- ),
+ 0
+ )
);
this.addComponent(
@@ -54,8 +54,8 @@ export class LockedDoor extends Entity {
height: LockedDoor.spriteSpec.height,
},
LockedDoor.spriteSpec.msPerFrame,
- LockedDoor.spriteSpec.frames,
- ),
+ LockedDoor.spriteSpec.frames
+ )
);
}
diff --git a/src/engine/entities/Particles.ts b/src/engine/entities/Particles.ts
index 5381b23..d2d4dbb 100644
--- a/src/engine/entities/Particles.ts
+++ b/src/engine/entities/Particles.ts
@@ -86,7 +86,7 @@ class ParticleRenderer extends Component implements Renderable {
particle.dimension.height / 2,
0,
0,
- Math.PI * 2,
+ Math.PI * 2
);
ctx.fill();
} else {
@@ -94,7 +94,7 @@ class ParticleRenderer extends Component implements Renderable {
particle.position.x - particle.dimension.width / 2,
particle.position.y - particle.dimension.height / 2,
particle.dimension.width,
- particle.dimension.height,
+ particle.dimension.height
);
}
}
@@ -119,7 +119,7 @@ export class Particles extends Entity {
const life = this.getComponent<Life>(ComponentNames.Life);
life.alive = false;
this.addComponent(life);
- }),
+ })
);
this.addComponent(
@@ -132,8 +132,8 @@ export class Particles extends Entity {
width: spawnOptions.spawnerDimensions.width,
height: spawnOptions.spawnerDimensions.height,
},
- 0,
- ),
+ 0
+ )
);
}
@@ -141,15 +141,15 @@ export class Particles extends Entity {
const angle = Math.random() * Math.PI * 2;
const speed = normalRandom(
options.particleMeanSpeed,
- options.particleSpeedVariance,
+ options.particleSpeedVariance
);
const life = normalRandom(
options.particleMeanLife,
- options.particleLifeVariance,
+ options.particleLifeVariance
);
const size = normalRandom(
options.particleMeanSize,
- options.particleSizeVariance,
+ options.particleSizeVariance
);
const color =
options.particleColors[
diff --git a/src/engine/entities/Player.ts b/src/engine/entities/Player.ts
index 9e2e1cb..ec88a90 100644
--- a/src/engine/entities/Player.ts
+++ b/src/engine/entities/Player.ts
@@ -12,7 +12,7 @@ import { Coord2D, Direction } from "../interfaces/";
export class Player extends Entity {
private static spriteSpec: SpriteSpec = SPRITE_SPECS.get(
- Sprites.PLAYER,
+ Sprites.PLAYER
) as SpriteSpec;
constructor(gridPosition: Coord2D) {
@@ -25,8 +25,8 @@ export class Player extends Entity {
y: 0,
},
{ width: Player.spriteSpec.width, height: Player.spriteSpec.height },
- 0,
- ),
+ 0
+ )
);
this.addComponent(new Pushable());
@@ -51,14 +51,14 @@ export class Player extends Entity {
{ x: 0, y: 0 },
{ width: Player.spriteSpec.width, height: Player.spriteSpec.height },
Player.spriteSpec.msPerFrame,
- Player.spriteSpec.frames,
+ Player.spriteSpec.frames
);
facingDirectionComponent.directionSprites.set(direction, sprite);
});
this.addComponent(facingDirectionComponent);
this.addComponent(
- facingDirectionComponent.directionSprites.get(Direction.NONE)!,
+ facingDirectionComponent.directionSprites.get(Direction.NONE)!
); // face no direction by default
}
}
diff --git a/src/engine/entities/Portal.ts b/src/engine/entities/Portal.ts
index a747aa9..221004c 100644
--- a/src/engine/entities/Portal.ts
+++ b/src/engine/entities/Portal.ts
@@ -25,8 +25,8 @@ export class Portal extends Entity {
width: Portal.spriteSpec.width,
height: Portal.spriteSpec.height,
},
- 0,
- ),
+ 0
+ )
);
this.addComponent(
@@ -38,8 +38,8 @@ export class Portal extends Entity {
height: Portal.spriteSpec.height,
},
Portal.spriteSpec.msPerFrame,
- Portal.spriteSpec.frames,
- ),
+ Portal.spriteSpec.frames
+ )
);
this.addComponent(new Colliding(this.handleCollision.bind(this)));
diff --git a/src/engine/entities/Wall.ts b/src/engine/entities/Wall.ts
index 621a569..f5beb9c 100644
--- a/src/engine/entities/Wall.ts
+++ b/src/engine/entities/Wall.ts
@@ -5,7 +5,7 @@ import { Coord2D } from "../interfaces";
export class Wall extends Entity {
private static spriteSpec: SpriteSpec = SPRITE_SPECS.get(
- Sprites.WALL,
+ Sprites.WALL
) as SpriteSpec;
constructor(gridPosition: Coord2D) {
@@ -25,8 +25,8 @@ export class Wall extends Entity {
width: Wall.spriteSpec.width,
height: Wall.spriteSpec.height,
},
- 0,
- ),
+ 0
+ )
);
this.addComponent(
@@ -38,8 +38,8 @@ export class Wall extends Entity {
height: Wall.spriteSpec.height,
},
Wall.spriteSpec.msPerFrame,
- Wall.spriteSpec.frames,
- ),
+ Wall.spriteSpec.frames
+ )
);
}
}