WIP, tout est en chantier, très content :)
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user