score resets after first jump

This commit is contained in:
dhain 2023-01-10 10:35:52 +01:00
parent 6927ba9e85
commit 5f517c1a47
2 changed files with 20 additions and 8 deletions

View file

@ -4,8 +4,8 @@ class Raspberry extends Entity {
private _velocity: number = 0;
private _image: any;
private static position: Position;
private static readonly maxVelocity: number = 100;
private static POSITION: Position;
private static readonly WIDTH: number = 180;
private static readonly HEIGHT: number = 70;
private static readonly FILL: number = 0;
@ -33,8 +33,8 @@ class Raspberry extends Entity {
* Constructs the Raspberry with fixed sizes
*/
constructor(image: string) {
Raspberry.POSITION = new Position(width / 6, height / 2)
super(Raspberry.POSITION, Raspberry.WIDTH, Raspberry.HEIGHT, Raspberry.FILL);
Raspberry.position = new Position(width / 6, height / 2);
super(Raspberry.position, Raspberry.WIDTH, Raspberry.HEIGHT, Raspberry.FILL);
this.image = image;
}