random pipe position working

This commit is contained in:
dhain 2022-12-06 09:45:43 +01:00
parent 4a40175884
commit 8e19fb7cfb
5 changed files with 59 additions and 17 deletions

View file

@ -4,6 +4,7 @@ abstract class Entity {
private _height: number;
private _fill: number;
//region Getter & Setter
get position(): Position {
return this._position;
}
@ -27,6 +28,7 @@ abstract class Entity {
set height(value: number) {
this._height = value;
}
//endregion
constructor(position: Position, width: number, height: number, fill: number) {
this.position = position;
@ -36,6 +38,7 @@ abstract class Entity {
}
public abstract update(): void;
public draw() {
fill(this._fill);
rect(this.position.x, this.position.y, this.width, this.height);