diff --git a/html/static/styles.css b/html/static/styles.css index 29f71c5..7626369 100644 --- a/html/static/styles.css +++ b/html/static/styles.css @@ -1,10 +1,12 @@ #game { - width: 500px; + width: 1000px; height: 500px; background-color: red; + position: relative; } .banner { margin: 1px; + position: absolute; } \ No newline at end of file diff --git a/src/game/Banner.ts b/src/game/Banner.ts index bdce7d8..bed4359 100644 --- a/src/game/Banner.ts +++ b/src/game/Banner.ts @@ -14,6 +14,8 @@ export class Banner { this.element = document.createElement("img"); this.element.classList.add("banner"); + this.element.style.top = this.position.y + "px"; + this.element.style.left = this.position.x + "px"; } public load(): Promise<void> { diff --git a/src/game/Position.ts b/src/game/Position.ts index afc78f8..eb4cb5e 100644 --- a/src/game/Position.ts +++ b/src/game/Position.ts @@ -7,4 +7,12 @@ export class Position { this._x = x; this._y = y; } + + get x(): number { + return this._x; + } + + get y(): number { + return this._y; + } } \ No newline at end of file