From 0a77eb29e9f64ecb3aa010dde965fbfcbfdd749a Mon Sep 17 00:00:00 2001 From: Matt Kohls Date: Fri, 1 Nov 2019 23:21:08 -0400 Subject: Starting bits for web client --- public/js/rogue.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 public/js/rogue.js (limited to 'public/js') 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); + } + } +} -- cgit v1.2.3