Skip to content

Commit

Permalink
fix(race): replace broken onInitialize after update
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathieu Hermann committed Nov 18, 2024
1 parent bdd2423 commit 4b11ad0
Show file tree
Hide file tree
Showing 4 changed files with 187 additions and 191 deletions.
2 changes: 0 additions & 2 deletions src/app/game/actors/gate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ export class Gate extends Actor {
if (this.isFinalGate) {
this.graphics.use(Resources.FinalGate.toSprite());
}
}

override onInitialize() {
this.on('passed', () => this.onGatePassed());
this.on('exitviewport', () => {
if (this.isBehind()) {
Expand Down
4 changes: 1 addition & 3 deletions src/app/game/actors/skier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ export class Skier extends Actor {
});
this.skierName = skierName;
this.skierConfig = skierConfig;
}

override onInitialize() {
this.particlesEmitter = ParticlesBuilder.getParticlesEmitter();
this.addChild(this.particlesEmitter);
}
Expand Down Expand Up @@ -249,7 +247,7 @@ export class Skier extends Actor {
this.particlesEmitter.maxAngle = 1;
this.particlesEmitter.minAngle = 1;
this.particlesEmitter.pos.x = skierAction === SkierActions.CARVE_LEFT ? 8 : -8;
this.particlesEmitter.emitParticles(speedPercentage * carvingIntensity * 15);
this.particlesEmitter.emitParticles(speedPercentage * carvingIntensity * 25);
}

private emitBrakingParticles(speedPercentage: number): void {
Expand Down
16 changes: 8 additions & 8 deletions src/app/game/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,42 +62,42 @@ export class Config {
static ROTATION_RECENTER_RATE = 0.2;

// SLOPE
static INITIAL_SLOPE = 0.1;
static INITIAL_SLOPE = 0.115;

// SKIER
static ACCELERATION_RATE = 3;
static BRAKING_RATE = 1;
static CARVING_ADHERENCE_RATE = 0.9;
static CARVING_BRAKING_RATE = 0.01;
static SLIDING_ADHERENCE_RATE = 0.6;
static SLIDING_BRAKING_RATE = 0.9;
static SLIDING_ADHERENCE_RATE = 0.65;
static SLIDING_BRAKING_RATE = 0.8;
// SKIER SPECIFIC STYLE DYNAMIC
static SL_SKIER_CONFIG = {
windFrictionRate: 0.0025,
carvingRotationRate: 3.2,
carvingOptimalSpeed: 50,
slidingRotationRate: 4.2,
slidingRotationRate: 3.7,
slidingOptimalSpeed: 35
};
static GS_SKIER_CONFIG = {
windFrictionRate: 0.0022,
carvingRotationRate: 3.1,
carvingOptimalSpeed: 60,
slidingRotationRate: 4.1,
slidingRotationRate: 3.6,
slidingOptimalSpeed: 45
};
static SG_SKIER_CONFIG = {
windFrictionRate: 0.002,
carvingRotationRate: 2.6,
carvingRotationRate: 2.5,
carvingOptimalSpeed: 70,
slidingRotationRate: 3.2,
slidingRotationRate: 3.0,
slidingOptimalSpeed: 50
};
static DH_SKIER_CONFIG = {
windFrictionRate: 0.0018,
carvingRotationRate: 2.2,
carvingOptimalSpeed: 75,
slidingRotationRate: 3.1,
slidingRotationRate: 2.7,
slidingOptimalSpeed: 60
};

Expand Down
Loading

0 comments on commit 4b11ad0

Please sign in to comment.