]> git.cworth.org Git - empires-server/commitdiff
Add initial shell of a game for Empathy
authorCarl Worth <cworth@cworth.org>
Sun, 7 Jun 2020 18:55:32 +0000 (11:55 -0700)
committerCarl Worth <cworth@cworth.org>
Sun, 7 Jun 2020 18:56:05 +0000 (11:56 -0700)
No real functionality here yet.

empathy.js [new file with mode: 0644]
lmno.js
templates/empathy-game.html [new file with mode: 0644]

diff --git a/empathy.js b/empathy.js
new file mode 100644 (file)
index 0000000..12a743e
--- /dev/null
@@ -0,0 +1,17 @@
+const express = require("express");
+const Game = require("./game.js");
+
+class Empathy extends Game {
+  constructor(id) {
+    super(id);
+  }
+}
+
+Empathy.router = express.Router();
+
+Empathy.meta = {
+  name: "Empathy",
+  identifier: "empathy",
+};
+
+exports.Game = Empathy;
diff --git a/lmno.js b/lmno.js
index d01b3e9478543b20c9a51196677a30a02c30edef..de95aa417a390caa65d26579a54d7e61a3106978 100644 (file)
--- a/lmno.js
+++ b/lmno.js
@@ -91,7 +91,8 @@ nunjucks.configure("templates", {
 const engines = {
   empires: require("./empires").Game,
   tictactoe: require("./tictactoe").Game,
-  scribe: require("./scribe").Game
+  scribe: require("./scribe").Game,
+  empathy: require("./empathy").Game
 };
 
 class LMNO {
diff --git a/templates/empathy-game.html b/templates/empathy-game.html
new file mode 100644 (file)
index 0000000..d84266c
--- /dev/null
@@ -0,0 +1,16 @@
+{% extends "base.html" %}
+
+{% block head %}
+<link rel="stylesheet" href="/empathy/empathy.css" type="text/css" />
+
+<script src="/react.js"></script>
+<script src="/react-dom.js"></script>
+<script type="module" src="/empathy/empathy.js"></script>
+{% endblock %}
+
+{% block page %}
+<h1><a href="/empathy">Empathy</a></h1>
+
+<div id="empathy"></div>
+
+{% endblock %}