From 7e6648902b262484bc0aac824c3784b1ae4b8591 Mon Sep 17 00:00:00 2001 From: Mark Powers Date: Sun, 12 Apr 2020 14:42:03 -0500 Subject: Update games, add scores --- src/highscores.js | 10 ++ src/index.html | 12 +- src/index.js | 15 +++ src/pinball/server.js | 3 - src/pp/server.js | 10 ++ src/pp/static/index.html | 35 ++++++ src/pp/static/main.js | 269 +++++++++++++++++++++++++++++++++++++++++++++ src/pp/static/templates.js | 18 +++ src/pp/tiles.png | Bin 0 -> 292183 bytes src/quadrowple/server.js | 3 +- src/scores.html | 51 +++++++++ src/server.js | 32 ++++-- src/snake/index.html | 211 ++++++++++++++++++++++------------- src/stacker/index.html | 95 ++++++++-------- 14 files changed, 624 insertions(+), 140 deletions(-) create mode 100644 src/highscores.js create mode 100644 src/pp/server.js create mode 100644 src/pp/static/index.html create mode 100644 src/pp/static/main.js create mode 100644 src/pp/static/templates.js create mode 100644 src/pp/tiles.png create mode 100644 src/scores.html (limited to 'src') diff --git a/src/highscores.js b/src/highscores.js new file mode 100644 index 0000000..e735eee --- /dev/null +++ b/src/highscores.js @@ -0,0 +1,10 @@ +function submitScore(game, score, username){ + if(username == undefined){ + username = prompt("Enter a name to submit score", ""); + } + if (!(username == null || username == "")) { + const request = new Request(`/setScore?game=${game}&username=${username}&score=${score}`); + fetch(request); + } + return username +} \ No newline at end of file diff --git a/src/index.html b/src/index.html index 21b2dd2..17b9655 100644 --- a/src/index.html +++ b/src/index.html @@ -10,17 +10,23 @@
- Arcade + High score list +
+ +
+

Games

+

Arcade

- Multiplayer +

Multiplayer