added dash sound

This commit is contained in:
OfficialCHenry 2022-04-25 23:20:49 -04:00
parent 555d5538a8
commit 3cc714b7c2
5 changed files with 8 additions and 0 deletions

Binary file not shown.

View File

@ -3,6 +3,7 @@ import AnimatedSprite from "../../../Wolfie2D/Nodes/Sprites/AnimatedSprite";
import InAir from "./InAir"; import InAir from "./InAir";
import InputWrapper from "../../Tools/InputWrapper"; import InputWrapper from "../../Tools/InputWrapper";
import PlayerState from "./PlayerState"; import PlayerState from "./PlayerState";
import { GameEventType } from "../../../Wolfie2D/Events/GameEventType";
export default class Fall extends InAir { export default class Fall extends InAir {
owner: AnimatedSprite; owner: AnimatedSprite;
@ -13,6 +14,7 @@ export default class Fall extends InAir {
update(deltaT: number): void { update(deltaT: number): void {
if (!PlayerState.dashTimer.isStopped()) { if (!PlayerState.dashTimer.isStopped()) {
this.emitter.fireEvent(GameEventType.PLAY_SOUND, {key: "dash", loop: false, holdReference: false});
this.owner.animation.playIfNotAlready("DASH"); this.owner.animation.playIfNotAlready("DASH");
} }
else { else {

View File

@ -19,6 +19,7 @@ export default class Jump extends InAir {
update(deltaT: number): void { update(deltaT: number): void {
if (!PlayerState.dashTimer.isStopped()) { if (!PlayerState.dashTimer.isStopped()) {
this.emitter.fireEvent(GameEventType.PLAY_SOUND, {key: "dash", loop: false, holdReference: false});
this.owner.animation.playIfNotAlready("DASH"); this.owner.animation.playIfNotAlready("DASH");
} }
else { else {

View File

@ -4,6 +4,7 @@ import InputWrapper from "../../Tools/InputWrapper";
import { PlayerStates } from "../PlayerController"; import { PlayerStates } from "../PlayerController";
import OnGround from "./OnGround"; import OnGround from "./OnGround";
import PlayerState from "./PlayerState"; import PlayerState from "./PlayerState";
import { GameEventType } from "../../../Wolfie2D/Events/GameEventType";
export default class Walk extends OnGround { export default class Walk extends OnGround {
owner: AnimatedSprite; owner: AnimatedSprite;
@ -16,6 +17,7 @@ export default class Walk extends OnGround {
update(deltaT: number): void { update(deltaT: number): void {
if (!PlayerState.dashTimer.isStopped()) { if (!PlayerState.dashTimer.isStopped()) {
this.emitter.fireEvent(GameEventType.PLAY_SOUND, {key: "dash", loop: false, holdReference: false});
this.owner.animation.playIfNotAlready("DASH"); this.owner.animation.playIfNotAlready("DASH");
} }
else { else {

View File

@ -159,11 +159,14 @@ export default class GameLevel extends Scene {
this.load.audio("jump", "shattered_sword_assets/sounds/jump2.wav"); this.load.audio("jump", "shattered_sword_assets/sounds/jump2.wav");
this.load.audio("hurt", "shattered_sword_assets/sounds/hurt.wav"); this.load.audio("hurt", "shattered_sword_assets/sounds/hurt.wav");
this.load.audio("die", "shattered_sword_assets/sounds/die.wav"); this.load.audio("die", "shattered_sword_assets/sounds/die.wav");
this.load.audio("dash", "shattered_sword_assets/sounds/dash.wav");
this.load.audio("level_up","shattered_sword_assets/sounds/level_up.wav"); this.load.audio("level_up","shattered_sword_assets/sounds/level_up.wav");
//神社じんじゃまつり by Second Dimension Imagination Group //神社じんじゃまつり by Second Dimension Imagination Group
this.load.audio("level_music","shattered_sword_assets/sounds/bgm1.mp3"); this.load.audio("level_music","shattered_sword_assets/sounds/bgm1.mp3");
this.load.audio("sword","shattered_sword_assets/sounds/sword_ding.m4a"); this.load.audio("sword","shattered_sword_assets/sounds/sword_ding.m4a");
this.load.image("knife", "shattered_sword_assets/sprites/knife.png"); this.load.image("knife", "shattered_sword_assets/sprites/knife.png");
this.load.image("inventorySlot", "shattered_sword_assets/sprites/inventory.png"); this.load.image("inventorySlot", "shattered_sword_assets/sprites/inventory.png");
this.load.image("black", "shattered_sword_assets/images/black.png"); this.load.image("black", "shattered_sword_assets/images/black.png");