diff --git a/imports/import.js b/imports/import.js index 5104c62..a0fb66c 100644 --- a/imports/import.js +++ b/imports/import.js @@ -20,6 +20,7 @@ import { Held } from "../system/map-player/player/heldItems/holdManager.js" import { Bazooka } from "../system/map-player/player/heldItems/Bazooka.js" import { Shotgun } from "../system/map-player/player/heldItems/Shotgun.js" import { Dash } from "../system/map-player/player/heldItems/dash.js" +import { UiUtills } from "../system/variousParts/UIUtills.js" export class Game{ // System @@ -28,7 +29,7 @@ export class Game{ enemy; // fields - + uitills = new UiUtills(this) shotgun = new Shotgun(this) dash = new Dash(this) keyManager = new KeyManager(this); diff --git a/system/variousParts/GameDisplayer.js b/system/variousParts/GameDisplayer.js index 40d6516..72148d5 100644 --- a/system/variousParts/GameDisplayer.js +++ b/system/variousParts/GameDisplayer.js @@ -76,6 +76,7 @@ export class GameDisplayer { this.resizeCanvasForWindowSize(ballEffect, bctx); this.resizeCanvasForWindowSize(postEffect, ppctx); + this.bgFade(this.targetR, this.targetG, this.targetB) this.r += this.rC this.g += this.gC @@ -92,6 +93,8 @@ export class GameDisplayer { ctx.drawImage(this.grid, 0, 0, this.originalWidth,625 * (this.originalWidth / 1000)) } + //this.game.uitills.draw() + for(let i = 0; i < this.game.shotgun.particles.length; i++) { ctx.globalAlpha = Math.max(0, Math.min(1,this.game.shotgun.particles[i].alpha)) console.log(this.game.shotgun.particles[i].alpha) diff --git a/system/variousParts/UIUtills.js b/system/variousParts/UIUtills.js new file mode 100644 index 0000000..a0af51e --- /dev/null +++ b/system/variousParts/UIUtills.js @@ -0,0 +1,19 @@ +const canvas = document.getElementById("UI") +const ctx = canvas.getContext("2d") + +import { DrawUtils } from "../../utils/DrawUtils.js" + +export class UiUtills { + tText = "" + tTime = 0 + tY = 500 + draw = new DrawUtils() + + draw(){ + //this.draw.Rect(500, 500, 500, 100, "#000000") + } + + toast(text, time){ + + } +}