Skip to content

Commit

Permalink
sized up animation + souinds
Browse files Browse the repository at this point in the history
  • Loading branch information
NightLightLumie committed Nov 19, 2023
1 parent f20c844 commit 3ece002
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/assets/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const images: Image[] = [

/* Spritesheets */
const spritesheets: SpriteSheet[] = [
spritesheet('effects/dustyexplosion', 'dust', 128, 128),
spritesheet('effects/dustyexplosion', 'dust', 256, 256),
];

/* Audios */
Expand Down
Binary file modified src/assets/images/effects/dustyexplosion.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 9 additions & 1 deletion src/components/Turtle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ export class Turtle extends Button {
private walkTarget: Phaser.Geom.Point;
private walkTimer: number;

//Scor
private baseScore: number;
private multiplier: number;

// Jumping
private trampoline: Trampoline;
private feetOffset: number;
Expand Down Expand Up @@ -94,6 +98,8 @@ export class Turtle extends Button {
this.newJumpTarget();
this.maxJumpSpeed = Phaser.Math.RND.between(27, 31);
this.bounceCount = 0;
this.baseScore = 50+(Math.random()*100);
this.multiplier = 1.0;

/* Input */
this.dragOffset = new Phaser.Math.Vector2();
Expand Down Expand Up @@ -121,6 +127,8 @@ export class Turtle extends Button {

if (jumpSpeed > maxSpeed - 10) {
this.bounceCount += 1;
this.multiplier += 0.05;
this.scene.sound.play("t_rustle",{ volume: 0.5 });
this.emit("bounce");
}
}
Expand Down Expand Up @@ -166,7 +174,7 @@ export class Turtle extends Button {
this.physicsPosition.y = this.border.bottom - this.feetOffset;
if (this.lostBalance && !this.hasCrashed) {
this.hasCrashed = true;
this.scene.addDust(this.x+this.sprite.x, this.y+this.sprite.y);
this.scene.addDust(this.x+this.sprite.x, this.y+this.sprite.y-75);
this.emit("crashed");
}
}
Expand Down

0 comments on commit 3ece002

Please sign in to comment.