Fix issues
This commit is contained in:
parent
7cf33b9f1a
commit
a4bab29d84
7 changed files with 30 additions and 14 deletions
|
|
@ -8,6 +8,7 @@ import { Id } from '../../communication/id';
|
|||
@serializable
|
||||
export class PlanetBase extends GameObject {
|
||||
public readonly center: vec2;
|
||||
public readonly radius: number;
|
||||
|
||||
constructor(
|
||||
id: Id,
|
||||
|
|
@ -17,6 +18,9 @@ export class PlanetBase extends GameObject {
|
|||
super(id);
|
||||
this.center = vertices.reduce((sum, v) => vec2.add(sum, sum, v), vec2.create());
|
||||
vec2.scale(this.center, this.center, 1 / vertices.length);
|
||||
this.radius =
|
||||
vertices.reduce((sum, v) => sum + vec2.distance(this.center, v), 0) /
|
||||
this.vertices.length;
|
||||
}
|
||||
|
||||
public generatedPoints(value: number) {}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ export const settings = {
|
|||
maxGravityQ: 5000,
|
||||
planetControlThreshold: 0.2,
|
||||
playerMaxHealth: 100,
|
||||
maxGravityStrength: 10000,
|
||||
maxGravityStrength: 50000,
|
||||
maxAcceleration: 120000,
|
||||
playerMaxStrength: 80,
|
||||
endGameDeltaScaling: 2,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue