--- /dev/null
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8"/>
+ <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
+
+ <title>The Game of Empires</title>
+
+ <link rel="stylesheet" href="/reset.css" type="text/css" />
+ <link rel="stylesheet" href="/style.css" type="text/css" />
+ </head>
+ <body>
+
+ <script src="/lmno.js"></script>
+
+ <div id="page">
+
+ <h1>The Game of Empires</h1>
+
+ <p>
+ Can you remember all the characters in the game? Can you guess
+ who is who?
+ </p>
+
+ <div id="message-area">
+ </div>
+
+ <form onsubmit="lmno_new('empires'); return false;">
+ <button type="submit">
+ Host a new game
+ </button>
+ </form>
+
+ <h2>What is Empires?</h2>
+
+ <p>
+ Empires is a simple yet surprisingly entertaining party game
+ that will test your memory. Each player in the game secretly
+ chooses a "character" that they will play as. Once all players
+ have chosen their characters, each character name will be
+ revealed to all players who will have to try to memorize every
+ character. Gameplay consists of guessing the character name
+ that other plays chose. Successful guesses bring the guessed
+ player (and their entire "empire") into your own "empire". The
+ game will end with everyone in a single empire under the one
+ player whose character was never correctly guessed.
+ </p>
+
+ <h2>What do we need to play?</h2>
+
+ <p>
+ This website will assist you in hosting a game of empires by
+ doing the following:
+
+ <ul>
+ <li>
+ Allowing players to secretly select a character name
+ </li>
+ <li>
+ Revealing the character names to all players
+ </li>
+ <li>
+ Keeping track of which players have still not had their
+ characters identified, (the empires remaining to be
+ captured)
+ </li>
+ </ul>
+ </p>
+
+ <p>
+ Meanwhile, you are responsible for providing the following:
+
+ <ul>
+ <li>
+ An internet-capable device for each player. This is only
+ needed for the player to select their player, so a number
+ of people in the same room can pass a device around fot
+ this part.
+ </li>
+ <li>
+ At least one view of the game that every player can
+ see. This can be on individual devices, or by the game
+ host sharing their screen in some fashion, (such as
+ through a video call).
+ </li>
+ <li>
+ Some means for all players to communicate. This could be a
+ video call or some chat room or something else. Of course,
+ it's also possible to play with people in the same room
+ together. If you have the luxury to do that, it's also
+ convenient to have captured players move to sit with their
+ new empires to make it clear which empires remain.
+ </li>
+ </ul>
+ </p>
+ </div>
+ </body>
+</html>
form.reset();
}
+
+function new_loadend() {
+ if (this.status == 200) {
+ /* Response contains the game ID which we simply point the browser to. */
+ const game_id = JSON.parse(this.response);
+ window.location.href = ('/' + game_id);
+ return;
+ }
+
+ add_message("danger", `An error occured creating a new game (${this.status}).`);
+}
+
+function lmno_new(engine) {
+ console.log("In lmno_new");
+ const request = new XMLHttpRequest();
+ request.addEventListener("loadend", new_loadend);
+
+ request.open("POST", "/new/" + engine);
+ request.setRequestHeader("Content-Type", "application/json; charset=UTF-8");
+ request.send();
+
+ return false;
+}