aboutsummaryrefslogtreecommitdiffstats
path: root/public/js
diff options
context:
space:
mode:
Diffstat (limited to 'public/js')
-rw-r--r--public/js/rogue.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/public/js/rogue.js b/public/js/rogue.js
new file mode 100644
index 0000000..f88be4f
--- /dev/null
+++ b/public/js/rogue.js
@@ -0,0 +1,22 @@
+/*
+ * rogue.js
+ *
+ * Web client for rogue.js multiplayer roguelike game
+ *
+ * Matt Kohls
+ * 2019
+ */
+
+const canvas = document.getElementById('gameboard');
+const context = canvas.getContext('2d');
+const spritemap = new Image(128, 104);
+spritemap.onload = drawInitialBoard;
+spritemap.src = 'minirogue-all.png';
+
+function drawInitialBoard() {
+ for (var i = 0; i < 4; i++) {
+ for (var j = 0; j < 4; j++) {
+ context.drawImage(this, j*128, i*104);
+ }
+ }
+}