From 474a7253b6b67e2ed33936f6b633587d5d304b66 Mon Sep 17 00:00:00 2001 From: niliara-edu Date: Thu, 26 Dec 2024 14:24:53 +0100 Subject: hello kitty stage 1 and 2 done --- src/entities/entity.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/entities/entity.js') diff --git a/src/entities/entity.js b/src/entities/entity.js index 9d27508..0dbe00c 100644 --- a/src/entities/entity.js +++ b/src/entities/entity.js @@ -3,16 +3,20 @@ import { Engine } from "../engine.js" import { entities } from "../main.js" export class Entity { + rotation = 0 + constructor({ size, hitbox = size, sprite, position = new Vector(0,0), pixelated = false, + degrees = 0, }) { this.size = size this.hitbox = hitbox this.position = position + this.rotation = degrees this.span = document.createElement("img") this.span.src = sprite @@ -25,7 +29,7 @@ export class Entity { update() {} draw() { - Engine.screen.draw(this.span, this.position, this.size) + Engine.screen.draw(this.span, this.position, this.size, this.rotation) } -- cgit v1.2.3