serveur de jeu - work in progress

This commit is contained in:
batche
2022-12-14 10:45:10 +01:00
parent 6ca35ccaa7
commit f1f94cb9bc
125 changed files with 3947 additions and 719 deletions

35
jeu/src/client/draw.js Normal file
View File

@@ -0,0 +1,35 @@
import { pong, gc } from "./global.js";
import { gridDisplay } from "./handleInput.js";
export function drawLoop() {
pong.clear();
if (gridDisplay) {
drawGrid();
}
drawStatic();
gc.text1.update();
gc.text2.update();
gc.text3.update();
drawDynamic();
}
function drawDynamic() {
gc.scoreLeft.update();
gc.scoreRight.update();
gc.playerLeft.update();
gc.playerRight.update();
gc.ballsArr.forEach((ball) => {
ball.update();
});
}
function drawStatic() {
gc.midLine.update();
gc.wallTop.update();
gc.wallBottom.update();
}
function drawGrid() {
gc.w_grid_mid.update();
gc.w_grid_u1.update();
gc.w_grid_d1.update();
gc.h_grid_mid.update();
gc.h_grid_u1.update();
gc.h_grid_d1.update();
}