updated scoreboard.
This commit is contained in:
parent
8180088b3b
commit
4ce5f5f2de
@ -191,13 +191,13 @@ export class Scoreboard {
|
|||||||
const _afterRender = scene.onAfterRenderObservable.add(() => {
|
const _afterRender = scene.onAfterRenderObservable.add(() => {
|
||||||
if (i++ % 10 !== 0) return;
|
if (i++ % 10 !== 0) return;
|
||||||
|
|
||||||
scoreText.text = `Score: ${this.calculateScore()}`;
|
scoreText.text = `Destroyed: ${this.calculateScore()}`;
|
||||||
remainingText.text = `Remaining: ${this._remaining}`;
|
remainingText.text = `Remaining: ${this._remaining}`;
|
||||||
|
|
||||||
// Update velocity from ship if available
|
// Update velocity from ship if available
|
||||||
if (this._ship && this._ship.velocity) {
|
if (this._ship && this._ship.velocity) {
|
||||||
const velocityMagnitude = this._ship.velocity.length();
|
const velocityMagnitude = this._ship.velocity.length();
|
||||||
velocityText.text = `Velocity: ${velocityMagnitude.toFixed(1)} m/s`;
|
velocityText.text = `Velocity: ${velocityMagnitude.toFixed(1)} km/hr`;
|
||||||
} else {
|
} else {
|
||||||
velocityText.text = `Velocity: 0.0 m/s`;
|
velocityText.text = `Velocity: 0.0 m/s`;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user