Skip to content
Snippets Groups Projects
Unverified Commit 420c5ab2 authored by Bye's avatar Bye
Browse files

change some stuff

parent 1436edfd
Branches
No related tags found
No related merge requests found
......@@ -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
File added
File added
src/img/hampsterfont.webp

200 B | W: | H:

src/img/hampsterfont.webp

206 B | W: | H:

src/img/hampsterfont.webp
src/img/hampsterfont.webp
src/img/hampsterfont.webp
src/img/hampsterfont.webp
  • 2-up
  • Swipe
  • Onion skin
......@@ -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;
......
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
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment