diff --git a/assets/bomb.png b/assets/bomb.png new file mode 100644 index 0000000..28a0fbb Binary files /dev/null and b/assets/bomb.png differ diff --git a/assets/dude.png b/assets/dude.png new file mode 100644 index 0000000..6b35f4b Binary files /dev/null and b/assets/dude.png differ diff --git a/assets/platform.png b/assets/platform.png new file mode 100644 index 0000000..1e4a3f8 Binary files /dev/null and b/assets/platform.png differ diff --git a/assets/sky.png b/assets/sky.png new file mode 100644 index 0000000..5972639 Binary files /dev/null and b/assets/sky.png differ diff --git a/assets/star.png b/assets/star.png new file mode 100644 index 0000000..bfc2d29 Binary files /dev/null and b/assets/star.png differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..dda5e0e --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + Minesdeep + + + + + + + + \ No newline at end of file diff --git a/index.js b/index.js new file mode 100644 index 0000000..4ef0a1b --- /dev/null +++ b/index.js @@ -0,0 +1,25 @@ +import { MainScene } from "./src/MainScene"; + +// font size +const FONT = 32; +// map dimensions +const ROWS = 20; +const COLS = 20; +// number of actors per level, including player +const ACTORS = 10; + +const CONFIG = { + type: Phaser.AUTO, + width: COLS * FONT * 0.6, + height: ROWS * FONT, + backgroundColor: "#0a0a0a", + scale: { + mode: Phaser.Scale.FIT, + autoCenter: Phaser.Scale.CENTER_BOTH + }, + scene: [ MainScene ] +}; + +var game = new Phaser.Game(CONFIG); + +// https://code.tutsplus.com/how-to-make-your-first-roguelike--gamedev-13677t diff --git a/src/MainScene.js b/src/MainScene.js new file mode 100644 index 0000000..bbe4fde --- /dev/null +++ b/src/MainScene.js @@ -0,0 +1,27 @@ +export class MainScene extends Phaser.Scene { + cursors; + + constructor() { + super({ key: "MainScene" }); + } + + preload() { + // + } + + create() { + this.cursors = this.input.keyboard.createCursorKeys(); + } + + update(time) { + if (this.cursors.left.isDown) { + // + } else if (this.cursors.up.isDown) { + // + } else if (this.cursors.right.isDown) { + // + } else if (this.cursors.down.isDown) { + // + } + } +} \ No newline at end of file