From 82699642ca6c49a97c1872dded2642a114ce254c Mon Sep 17 00:00:00 2001 From: ZGrandison <73369239+ZGrandison@users.noreply.github.com> Date: Tue, 15 Feb 2022 16:11:33 -0500 Subject: [PATCH] Misc fixes --- src/Wolfie2D/DataTypes/State/StateMachine.ts | 2 +- src/Wolfie2D/Nodes/Graphics/Particle.ts | 2 +- src/Wolfie2D/Nodes/Graphics/Point.ts | 4 ++-- src/Wolfie2D/Scene/Factories/CanvasNodeFactory.ts | 3 +-- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Wolfie2D/DataTypes/State/StateMachine.ts b/src/Wolfie2D/DataTypes/State/StateMachine.ts index 1537490..323c9c5 100644 --- a/src/Wolfie2D/DataTypes/State/StateMachine.ts +++ b/src/Wolfie2D/DataTypes/State/StateMachine.ts @@ -67,7 +67,7 @@ export default class StateMachine implements Updateable { * Initializes this state machine with an initial state and sets it running * @param initialState The name of initial state of the state machine */ - initialize(initialState: string, options: Record): void { + initialize(initialState: string, options?: Record): void { this.stack.push(this.stateMap.get(initialState)); this.currentState = this.stack.peek(); this.currentState.onEnter(options); diff --git a/src/Wolfie2D/Nodes/Graphics/Particle.ts b/src/Wolfie2D/Nodes/Graphics/Particle.ts index bb0fb87..08b275f 100644 --- a/src/Wolfie2D/Nodes/Graphics/Particle.ts +++ b/src/Wolfie2D/Nodes/Graphics/Particle.ts @@ -24,7 +24,7 @@ export default class Particle extends Point { constructor(position: Vec2, size: Vec2, mass: number) { // Are we making this a circle? - super(position, size); + super(position); this.inUse = false; this.mass = mass; } diff --git a/src/Wolfie2D/Nodes/Graphics/Point.ts b/src/Wolfie2D/Nodes/Graphics/Point.ts index 5da7a24..ba2b1e5 100644 --- a/src/Wolfie2D/Nodes/Graphics/Point.ts +++ b/src/Wolfie2D/Nodes/Graphics/Point.ts @@ -4,10 +4,10 @@ import Vec2 from "../../DataTypes/Vec2"; /** A basic point to be drawn on the screen. */ export default class Point extends Graphic { - constructor(position: Vec2, size: Vec2) { + constructor(position: Vec2) { // Are we making this a circle? super(); this.position = position; - this.size.set(size.x, size.y); + this.size.set(5, 5); } } \ No newline at end of file diff --git a/src/Wolfie2D/Scene/Factories/CanvasNodeFactory.ts b/src/Wolfie2D/Scene/Factories/CanvasNodeFactory.ts index 267dc1d..b92012a 100644 --- a/src/Wolfie2D/Scene/Factories/CanvasNodeFactory.ts +++ b/src/Wolfie2D/Scene/Factories/CanvasNodeFactory.ts @@ -200,9 +200,8 @@ export default class CanvasNodeFactory { buildPoint(options?: Record): Point { this.checkIfPropExists("Point", options, "position", Vec2, "Vec2"); - this.checkIfPropExists("Point", options, "size", Vec2, "Vec2"); - return new Point(options.position, options.size); + return new Point(options.position); } buildParticle(options?: Record): Point {