Add minimap
This commit is contained in:
parent
fc9df09ee1
commit
73f5f45322
7 changed files with 184 additions and 122 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import { vec2 } from 'gl-matrix';
|
||||
import {
|
||||
Circle,
|
||||
Command,
|
||||
|
|
@ -84,6 +85,16 @@ export class GameObjectContainer extends CommandReceiver {
|
|||
super();
|
||||
}
|
||||
|
||||
// The local player's world position, but only while the body is alive. On
|
||||
// death the server deletes the character object (yet `player` keeps pointing
|
||||
// at the now-stale view), so gate on the object still being present — otherwise
|
||||
// the minimap would pin the "you" dot at the death spot for the whole respawn.
|
||||
public get localPlayerPosition(): vec2 | undefined {
|
||||
return this.player && this.objects.has(this.player.id)
|
||||
? this.player.position
|
||||
: undefined;
|
||||
}
|
||||
|
||||
public get planets(): Array<PlanetView> {
|
||||
const planets: Array<PlanetView> = [];
|
||||
this.objects.forEach((o) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue