WIP, tout est en chantier, très content :)

This commit is contained in:
LuckyLaszlo
2022-11-20 15:46:45 +01:00
parent 023b5ed485
commit 48665cfe30
22 changed files with 580 additions and 302 deletions

View File

@@ -2,24 +2,28 @@
import {GameArea} from "./class/GameArea.js";
import * as d from "./draw.js";
import {gameLoop, newRound} from "./gameLoop.js"
// import {random} from "../shared_js/utils.js";
// import {socket} from "./ws.js";
// import * as c from "./constants.js"
import {initGame} from "../shared_js/initGame.js";
import {initGameClientOnly} from "./initGameClientOnly.js";
import { GameComponentsClient } from "./class/GameComponentsClient.js";
import {countdown} from "./utils.js";
/* Keys
Player 1: W/S
Player 2: Up/Down
Racket 1: W/S
Racket 2: Up/Down
Grid On-Off: G
*/
export const pong = new GameArea();
export const gc = new GameComponentsClient(pong.ctx);
function init()
function matchmaking()
{
initGame(pong.ctx);
initGameClientOnly(pong.ctx);
console.log("Searching an opponent..."); // PLACEHOLDER, todo draw
}
function matchmakingComplete()
{
console.log("Match Found !"); // PLACEHOLDER, TODO draw on canvas
countdown(3, startGame);
}
function startGame()
@@ -39,6 +43,4 @@ function startGame()
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
init();
export {startGame}
export {matchmaking, matchmakingComplete}