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 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/highscores.js (limited to 'src/highscores.js') 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 -- cgit v1.2.3