some UI fixes
This commit is contained in:
parent
798da5aae7
commit
86ac33bcae
2 changed files with 7 additions and 4 deletions
2
game.js
2
game.js
|
@ -59,6 +59,8 @@ class Game extends GameBasic {
|
||||||
message = message.join('\n');
|
message = message.join('\n');
|
||||||
console.log(message);
|
console.log(message);
|
||||||
|
|
||||||
|
if (!process.env.HOOK) return;
|
||||||
|
|
||||||
let h = await fetch(
|
let h = await fetch(
|
||||||
process.env.HOOK,
|
process.env.HOOK,
|
||||||
{
|
{
|
||||||
|
|
|
@ -85,7 +85,7 @@ class Game extends GameBasic {
|
||||||
|
|
||||||
if (ent.type != 'Player') return;
|
if (ent.type != 'Player') return;
|
||||||
|
|
||||||
Object.assign(textArgs, [`HP: ${ent.health} PT: ${ent.headCount}`, ent.pos.x, ent.pos.y - 64 / 2]);
|
Object.assign(textArgs, [`HP: ${ent.health}`, ent.pos.x, ent.pos.y - 64 / 2]);
|
||||||
|
|
||||||
ctx.strokeText(...textArgs);
|
ctx.strokeText(...textArgs);
|
||||||
ctx.fillText(...textArgs);
|
ctx.fillText(...textArgs);
|
||||||
|
@ -107,7 +107,7 @@ class Game extends GameBasic {
|
||||||
ctx.textBaseline = "bottom";
|
ctx.textBaseline = "bottom";
|
||||||
ctx.lineCap = "round";
|
ctx.lineCap = "round";
|
||||||
ctx.lineJoin = "round";
|
ctx.lineJoin = "round";
|
||||||
ctx.font = "bold 16px sans-serif";
|
ctx.font = "bold 32px sans-serif";
|
||||||
|
|
||||||
ctx.save();
|
ctx.save();
|
||||||
|
|
||||||
|
@ -125,7 +125,8 @@ class Game extends GameBasic {
|
||||||
|
|
||||||
ctx.textAlign = "start";
|
ctx.textAlign = "start";
|
||||||
ctx.textBaseline = "top";
|
ctx.textBaseline = "top";
|
||||||
ctx.font = "bold 32px sans-serif";
|
ctx.font = "bold 48px sans-serif";
|
||||||
|
ctx.fillStyle = "rgb(0,0,0)";
|
||||||
|
|
||||||
textArgs = [`XY: ${-Math.round(player.camera.x)}, ${-Math.round(player.camera.y)}`, 25, 25];
|
textArgs = [`XY: ${-Math.round(player.camera.x)}, ${-Math.round(player.camera.y)}`, 25, 25];
|
||||||
ctx.strokeText(...textArgs);
|
ctx.strokeText(...textArgs);
|
||||||
|
@ -148,7 +149,7 @@ class Game extends GameBasic {
|
||||||
if (player.isMenu) {
|
if (player.isMenu) {
|
||||||
let r = Math.floor(Math.abs(player.rot / 1.2) % emojis.length);
|
let r = Math.floor(Math.abs(player.rot / 1.2) % emojis.length);
|
||||||
ctx.fillText(`Click to react ${emojis[r]}`, cs / 2, cs / 2)
|
ctx.fillText(`Click to react ${emojis[r]}`, cs / 2, cs / 2)
|
||||||
ctx.font = "bold 16px sans-serif";
|
ctx.font = "bold 32px sans-serif";
|
||||||
ctx.fillText(`Wait for emojis ${emojis.join(', ')}`, cs / 2, cs / 2 + 50)
|
ctx.fillText(`Wait for emojis ${emojis.join(', ')}`, cs / 2, cs / 2 + 50)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue