diff options
author | niliara-edu <nil.jimeno@estudiant.fjaverianas.com> | 2024-12-26 14:24:53 +0100 |
---|---|---|
committer | niliara-edu <nil.jimeno@estudiant.fjaverianas.com> | 2024-12-26 14:24:53 +0100 |
commit | 474a7253b6b67e2ed33936f6b633587d5d304b66 (patch) | |
tree | 456b9cef3cb59da8e0eb575b9425a1fedfe67e1e /src/entities/entity.js | |
parent | 1fc522bc8c4a96858223e597ced8fea94ba57874 (diff) |
hello kitty stage 1 and 2 done
Diffstat (limited to 'src/entities/entity.js')
-rw-r--r-- | src/entities/entity.js | 6 |
1 files changed, 5 insertions, 1 deletions
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) } |