Misc fixes

This commit is contained in:
ZGrandison 2022-02-15 16:11:33 -05:00
parent ff51b6911d
commit 82699642ca
4 changed files with 5 additions and 6 deletions

View File

@ -67,7 +67,7 @@ export default class StateMachine implements Updateable {
* Initializes this state machine with an initial state and sets it running * Initializes this state machine with an initial state and sets it running
* @param initialState The name of initial state of the state machine * @param initialState The name of initial state of the state machine
*/ */
initialize(initialState: string, options: Record<string, any>): void { initialize(initialState: string, options?: Record<string, any>): void {
this.stack.push(this.stateMap.get(initialState)); this.stack.push(this.stateMap.get(initialState));
this.currentState = this.stack.peek(); this.currentState = this.stack.peek();
this.currentState.onEnter(options); this.currentState.onEnter(options);

View File

@ -24,7 +24,7 @@ export default class Particle extends Point {
constructor(position: Vec2, size: Vec2, mass: number) { constructor(position: Vec2, size: Vec2, mass: number) {
// Are we making this a circle? // Are we making this a circle?
super(position, size); super(position);
this.inUse = false; this.inUse = false;
this.mass = mass; this.mass = mass;
} }

View File

@ -4,10 +4,10 @@ import Vec2 from "../../DataTypes/Vec2";
/** A basic point to be drawn on the screen. */ /** A basic point to be drawn on the screen. */
export default class Point extends Graphic { export default class Point extends Graphic {
constructor(position: Vec2, size: Vec2) { constructor(position: Vec2) {
// Are we making this a circle? // Are we making this a circle?
super(); super();
this.position = position; this.position = position;
this.size.set(size.x, size.y); this.size.set(5, 5);
} }
} }

View File

@ -200,9 +200,8 @@ export default class CanvasNodeFactory {
buildPoint(options?: Record<string, any>): Point { buildPoint(options?: Record<string, any>): Point {
this.checkIfPropExists("Point", options, "position", Vec2, "Vec2"); 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<string, any>): Point { buildParticle(options?: Record<string, any>): Point {