drawing now seperate from gameLoop

+ refactoring
+ added soundMutedFlag
This commit is contained in:
LuckyLaszlo
2022-11-24 13:56:51 +01:00
parent 7d5895a6cc
commit 3474d54a2b
22 changed files with 105 additions and 106 deletions

View File

@@ -1,7 +1,8 @@
import {pong, gc, clientInfo} from "./global.js"
import {gridDisplay} from "./handleInput.js";
function draw()
import { pong, gc } from "./global.js"
import { gridDisplay } from "./handleInput.js";
function drawLoop()
{
pong.clear();
@@ -10,6 +11,12 @@ function draw()
if (gridDisplay) {
drawGrid();
}
drawDynamic();
}
function drawDynamic()
{
gc.scoreLeft.update();
gc.scoreRight.update();
gc.playerLeft.update();
@@ -35,4 +42,4 @@ function drawGrid()
gc.h_grid_d1.update();
}
export {draw, drawStatic, drawGrid}
export {drawLoop}