local pong done, start multiplayer implementation

This commit is contained in:
LuckyLaszlo
2022-10-26 22:21:55 +02:00
parent a831b7954c
commit d7aa2b633b
14 changed files with 350 additions and 323 deletions

40
src/client/draw.ts Normal file
View File

@@ -0,0 +1,40 @@
import * as g from "./pong.js"
import {gridDisplay} from "./handleInput.js";
function draw()
{
if (gridDisplay) {
drawGrid();
}
g.midLine.update();
g.score1.update();
g.score2.update();
}
function drawStatic()
{
g.wall_top.update();
g.wall_bottom.update();
g.midLine.update();
}
function drawInit()
{
g.pong.clear();
drawStatic();
g.player1.update();
g.player2.update();
}
function drawGrid()
{
g.w_grid_mid.update();
g.w_grid_u1.update();
g.w_grid_d1.update();
g.h_grid_mid.update();
g.h_grid_u1.update();
g.h_grid_d1.update();
}
export {draw, drawStatic, drawInit, drawGrid}