Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Commit

Permalink
trying to add ui things
Browse files Browse the repository at this point in the history
  • Loading branch information
log-lot committed Aug 20, 2024
1 parent af392fd commit 8882f4e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
3 changes: 2 additions & 1 deletion imports/import.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions system/variousParts/GameDisplayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
19 changes: 19 additions & 0 deletions system/variousParts/UIUtills.js
Original file line number Diff line number Diff line change
@@ -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){

}
}

0 comments on commit 8882f4e

Please sign in to comment.