Sfoglia il codice sorgente

screen shake tweaks

master
mort 10 anni fa
parent
commit
57b09e4142
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3
    1
      es/game.js

+ 3
- 1
es/game.js Vedi File

@@ -235,7 +235,7 @@ class Player extends Entity {
}

draw(ctx, selfId) {
let h = 255-((100-this.health) * 2);
let h = Math.round((this.health * 2.4) + 15);

if (selfId == this.id) {
ctx.fillStyle = "rgb("+h+", "+h+", "+h+")";
@@ -254,6 +254,8 @@ class Player extends Entity {

if (this.keys.sprint) {
this.thrustAnim.dheight = 100;
if (this.id == selfId)
this.game.screenShake(10);
} else {
this.thrustAnim.dheight = 64;
}

Loading…
Annulla
Salva