diff options
author | Matt Kohls <mattkohls13@gmail.com> | 2019-11-01 23:21:08 -0400 |
---|---|---|
committer | Matt Kohls <mattkohls13@gmail.com> | 2019-11-01 23:21:08 -0400 |
commit | 0a77eb29e9f64ecb3aa010dde965fbfcbfdd749a (patch) | |
tree | 39c81673289d697dc234bc6eee52e80e47e632f4 /public/js | |
parent | c6f4969b766c10674911d6fed034cc792333dc23 (diff) | |
download | rogue.js-0a77eb29e9f64ecb3aa010dde965fbfcbfdd749a.tar.gz rogue.js-0a77eb29e9f64ecb3aa010dde965fbfcbfdd749a.tar.bz2 rogue.js-0a77eb29e9f64ecb3aa010dde965fbfcbfdd749a.zip |
Starting bits for web client
Diffstat (limited to 'public/js')
-rw-r--r-- | public/js/rogue.js | 22 |
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); + } + } +} |