From a4a968c4088e3cefbd157a32b4f9f492a865b3bf Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Sat, 17 Jun 2023 01:19:17 -0400 Subject: [PATCH] delete compiled js --- client/js/main.js | 59 ----------------------------------------------- 1 file changed, 59 deletions(-) delete mode 100644 client/js/main.js diff --git a/client/js/main.js b/client/js/main.js deleted file mode 100644 index 7e97bcb..0000000 --- a/client/js/main.js +++ /dev/null @@ -1,59 +0,0 @@ -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -import { Game } from "./net/game.js"; -import { InitialState, onLogic } from "./logic/logic.js"; -import { startGraphicsUpdater } from "./renderer.js"; -import { GameKeyMap, Key } from "./types.js"; -const join = document.getElementById("join"); -const lobby = document.getElementById("lobby"); -lobby.style.display = "none"; -join.onsubmit = function (event) { - return __awaiter(this, void 0, void 0, function* () { - event.preventDefault(); - const room_code = document.getElementById("room_code").value; - const player_name = document.getElementById("player_name").value; - if (room_code == '') { - alert('Please enter a room code'); - return; - } - if (player_name == '') { - alert('Please enter a player name'); - return; - } - join.style.display = "none"; - startGame(room_code, player_name); - }); -}; -const updateGraphics = startGraphicsUpdater(); -const onLoad = (startData) => { - if (startData.data.started) { - alert('Room has already started'); - return false; - } - let players = Object.values(startData.data.players).filter(p => { return p !== null && p.name !== undefined; }); - if (players.length >= 4) { - alert('Room is full'); - return false; - } - lobby.style.display = ""; - return true; -}; -const onFrame = (data, frame) => { - updateGraphics(data ? data.data : InitialState, frame); -}; -const startGame = (code, name) => { - const game = new Game(3000); - game.start(code, GameKeyMap, onLoad, onFrame, onLogic, { - start: false, - key: Key.NOTHING, - name - }); -}; -//# sourceMappingURL=main.js.map \ No newline at end of file