Skip to content

Commit

Permalink
fix: camera shake only when controlled
Browse files Browse the repository at this point in the history
  • Loading branch information
vinceh121 committed Sep 28, 2023
1 parent a03e3a7 commit d848d43
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@ public void fire() {
}

this.fireSoundEmitter.play();
this.fireTimeout = 0.085f;
this.fireTimeout = 0.085f; // FIXME should be in meta

this.game.shakeCamera(0.5f, 0.25f);
if (this.isControlled()) {
this.game.shakeCamera(0.5f, 0.25f);
}
}

private void fireTurret(final MachineGunTurret turret) {
Expand Down
4 changes: 1 addition & 3 deletions core/src/me/vinceh121/wanderer/math/EllipsePath.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ public Vector2 valueAt(Vector2 out, float t) {
}

public Vector2 valueAtRad(Vector2 out, float rad) {
out.set(this.width * MathUtils.cos(rad), this.height * MathUtils.sin(rad));
out.add(this.x, this.y);

out.set(this.width * MathUtils.cos(rad) + this.x, this.height * MathUtils.sin(rad) + this.y);
return out;
}

Expand Down

0 comments on commit d848d43

Please sign in to comment.