Skip to content

Commit

Permalink
inc
Browse files Browse the repository at this point in the history
  • Loading branch information
LiprikON2 committed Aug 18, 2023
1 parent 792fb55 commit 8f845b3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions client/src/game/scripts/objects/DebugInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export class DebugInfo extends Phaser.GameObjects.Text {
else this.showHitboxes();
}

// TODO use circular buffer
getSpriteInfo(sprite: any) {
if (!sprite) return "";
const textLines = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -508,8 +508,7 @@ export class Spaceship extends Sprite {
const { rotation, velocityPercentage } = this.#thrust;
const speed = this.status.maxSpeed * velocityPercentage;

// const gravity = { rotation: 0, magnitude: 40, accelerationMultiplier: 1 };

// TODO tweak magnitude and acceleration multipliers
const gravity = { ...this.scene.getGravity(this), accelerationMultiplier: 10 };

this.move([{ rotation, magnitude: speed, accelerationMultiplier: 7 }, gravity]);
Expand Down
1 change: 1 addition & 0 deletions client/src/game/scripts/scenes/core/BaseScene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ export class BaseScene extends Phaser.Scene {
return [originPoint.x, originPoint.y];
}

// TODO make magnitude nonlinear
getGravity(entity: Phaser.GameObjects.Sprite, magnitudeMultiplier = 0.1) {
const [closestX, closestY] = this.getClosestPointInsideWorldBorder({
x: entity.x,
Expand Down

0 comments on commit 8f845b3

Please sign in to comment.