Skip to content

Commit

Permalink
Add skull sound
Browse files Browse the repository at this point in the history
  • Loading branch information
rinrab committed Aug 1, 2023
1 parent 9ce80c0 commit 1f33afb
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 1 deletion.
9 changes: 8 additions & 1 deletion UWP/Content/Content.mgcb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@


#----------------------------- Global Properties ----------------------------#

/outputDir:bin/$(Platform)
Expand Down Expand Up @@ -697,6 +697,12 @@
/processorParam:Quality=Best
/build:../../www/sound/sac.wav;sound/sac.wav

#begin ../../www/sound/skull.wav
/importer:WavImporter
/processor:SoundEffectProcessor
/processorParam:Quality=Best
/build:../../www/sound/skull.wav;sound/skull.wav

#begin ../../www/sound/time_end.wav
/importer:WavImporter
/processor:SoundEffectProcessor
Expand All @@ -720,3 +726,4 @@
/processorParam:MakeSquare=False
/processorParam:TextureFormat=Color
/build:CONTROLS.png

1 change: 1 addition & 0 deletions UWP/GameScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ private void PlaySounds(Sound soundsToPlay)
if (soundsToPlay.HasFlag(Sound.Draw)) soundAssets.Draw.Play();
if (soundsToPlay.HasFlag(Sound.Clock)) soundAssets.Clock.Play();
if (soundsToPlay.HasFlag(Sound.TimeEnd)) soundAssets.TimeEnd.Play();
if (soundsToPlay.HasFlag(Sound.Skull)) soundAssets.Skull.Play();
}
}
}
1 change: 1 addition & 0 deletions UWP/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ public override void Update()
}
else if (powerUpType == PowerUpType.Skull)
{
terrain.PlaySound(Sound.Skull);
skullIndex = 600;
SkullType = (SkullType)Terrain.Random.Next(5);
}
Expand Down
3 changes: 3 additions & 0 deletions UWP/Sound.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public void Play()
public Sound Draw;
public Sound Clock;
public Sound TimeEnd;
public Sound Skull;
public Music[] Musics;

public static SoundAssets Load(ContentManager content)
Expand Down Expand Up @@ -77,6 +78,7 @@ Music loadMusic(string name)
Draw = loadSound("draw"),
Clock = loadSound("clock"),
TimeEnd = loadSound("time_end"),
Skull = loadSound("skull"),
Musics = new Music[]
{
loadMusic("anar11"),
Expand Down Expand Up @@ -107,5 +109,6 @@ public enum Sound
Draw = 2 << 9,
Clock = 2 << 10,
TimeEnd = 2 << 11,
Skull = 2 << 12
}
}
Binary file added www/sound/kick.wav
Binary file not shown.
Binary file added www/sound/skull.wav
Binary file not shown.

0 comments on commit 1f33afb

Please sign in to comment.