local pong done, start multiplayer implementation
This commit is contained in:
40
src/client/draw.ts
Normal file
40
src/client/draw.ts
Normal 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}
|
||||
Reference in New Issue
Block a user