diff --git a/README.md b/README.md index 2095e8d41c8e8b776fa95b9c8a8f1b1223131473..0a8f0fb9f7105d0c5d69a43b6f56ab37d808bfb8 100644 --- a/README.md +++ b/README.md @@ -5,5 +5,7 @@ This project uses some code from [herebefrogs/gamejam-boilerplate](https://github.com/herebefrogs/gamejam-boilerplate). The following files use this code, under MIT: -- src/index.html -- src/js/keyboard.js \ No newline at end of file +- `src/index.html` +- `src/js/keyboard.js` +- All of `scripts/` +- Build & dev scripts in `package.json` \ No newline at end of file diff --git a/assets/island.ase b/assets/island.ase new file mode 100644 index 0000000000000000000000000000000000000000..a244e348e70e435d563df2e58b28f6ba40783f7c Binary files /dev/null and b/assets/island.ase differ diff --git a/assets/scoop.ase b/assets/scoop.ase new file mode 100644 index 0000000000000000000000000000000000000000..339d7e4ae20473d54c4515ad46049c935a22dc11 Binary files /dev/null and b/assets/scoop.ase differ diff --git a/src/img/hampsterfont.webp b/src/img/hampsterfont.webp index e90999eb673f6ae56434899a04c48a89ba5cb4a7..db6f2ca70715e11c14cbf34caef65168eb797703 100644 Binary files a/src/img/hampsterfont.webp and b/src/img/hampsterfont.webp differ diff --git a/src/index.html b/src/index.html index 12f261209c2f2ea40590f7d6f04396b682fd518b..ccdc6410bb6c639dff228f08e65cf3e58240dbf2 100644 --- a/src/index.html +++ b/src/index.html @@ -11,8 +11,8 @@ user-select: none; } canvas { - width: 100%; - max-height: 100vh; + width: calc(256px * 3); + height: calc(240px * 3); object-fit: contain; image-rendering: pixelated; margin: auto; diff --git a/src/js/objects.js b/src/js/objects.js index 0db9387ef2fd3d3339c7621b2b4aaf06ce471e7c..d215bb0dc571aa03d6b56c2a3799b42b86accaf5 100644 --- a/src/js/objects.js +++ b/src/js/objects.js @@ -1,10 +1,10 @@ -class Object { +class GameObject { draw() {} step() {} } -class Room extends Object { +class Room extends GameObject { constructor(name="") { super(); this.objects = []; @@ -33,6 +33,10 @@ class Room extends Object { keyUp(key) { } + onclick(pos){ + + } + step() { @@ -44,4 +48,4 @@ class Room extends Object { -export { Object, Room }; \ No newline at end of file +export { GameObject, Room }; \ No newline at end of file diff --git a/src/js/text.js b/src/js/text.js index c881cc8f504aeeadb170fe9a4fdb81a5d1569d1c..b21050143aca983938e7a0dc6aff65071009097e 100644 --- a/src/js/text.js +++ b/src/js/text.js @@ -8,7 +8,7 @@ class TextRenderer { this.spacing = 1; this.charWidth = this.fontWidth + this.spacing; this.charHeight = this.fontHeight + this.spacing; - this.fontChars = "abcdefghijklmnopqrstuvwxyz1234567890.,!?:;)(~>"; + this.fontChars = "abcdefghijklmnopqrstuvwxyz1234567890.,!?:;)(~>_-"; this.canvas = canvas; } @@ -18,7 +18,7 @@ class TextRenderer { let index = this.fontChars.indexOf(letter.toLowerCase()); if (index === -1) { if (!substituteOK) return; - canvas.drawText(letter, x, y, "#ffffff", 5, "monospace"); + canvas.drawText(letter, x+canvas.cX, y+ canvas.cY, "#ffffff", 5, "monospace"); } let sx = index * fontWidth; let sy = 0;