Skip to content
Browse files

Adding some sounds

  • Loading branch information...
1 parent 37ef2cd commit 482bff9b3a617de6e0dad48ba4c00e313f2f44b8 @fadookie fadookie committed Apr 1, 2012
View
BIN Assets/Sounds/tear_in_case.wav
Binary file not shown.
View
4 Maestro.xcodeproj/project.pbxproj
@@ -272,6 +272,7 @@
73733C5815292D3000992747 /* teardrop_2.wav in Resources */ = {isa = PBXBuildFile; fileRef = 73733C4F15292D3000992747 /* teardrop_2.wav */; };
73733C5C15292D3800992747 /* Death_Theme.wav in Resources */ = {isa = PBXBuildFile; fileRef = 73733C5A15292D3800992747 /* Death_Theme.wav */; };
73733C5D15292D3800992747 /* win_theme.wav in Resources */ = {isa = PBXBuildFile; fileRef = 73733C5B15292D3800992747 /* win_theme.wav */; };
+ 73733C8A1529429200992747 /* tear_in_case.wav in Resources */ = {isa = PBXBuildFile; fileRef = 73733C891529429200992747 /* tear_in_case.wav */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@@ -723,6 +724,7 @@
73733C4F15292D3000992747 /* teardrop_2.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = teardrop_2.wav; sourceTree = "<group>"; };
73733C5A15292D3800992747 /* Death_Theme.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = Death_Theme.wav; sourceTree = "<group>"; };
73733C5B15292D3800992747 /* win_theme.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = win_theme.wav; sourceTree = "<group>"; };
+ 73733C891529429200992747 /* tear_in_case.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = tear_in_case.wav; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -841,6 +843,7 @@
0B1A470D1527A0F70062DECC /* Sounds */ = {
isa = PBXGroup;
children = (
+ 73733C891529429200992747 /* tear_in_case.wav */,
0B89115615293C3900067C96 /* teardrop_1.wav */,
73733C4715292D3000992747 /* menu_1.wav */,
73733C4815292D3000992747 /* menu_2.wav */,
@@ -1618,6 +1621,7 @@
0B8911531529385100067C96 /* Title-Card.png in Resources */,
0B89115715293C3900067C96 /* teardrop_1.wav in Resources */,
0B89116815293FE600067C96 /* Intro-Card.png in Resources */,
+ 73733C8A1529429200992747 /* tear_in_case.wav in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
4 Maestro/GameLayer.m
@@ -147,9 +147,7 @@ -(void)update:(ccTime) delta
cpShape *shape = cpSpacePointQueryFirst([Physics sharedInstance].space, vect, CP_ALL_LAYERS, CP_NO_GROUP);
if ((NULL != shape) && (NULL != shape->body)) {
-#warning test sound play
- //[[GameSoundManager sharedInstance].soundEngine playEffect:@"zap.wav"];
- [[GameSoundManager sharedInstance].soundEngine playEffect:@"teardrop_1.wav"];
+ [[GameSoundManager sharedInstance].soundEngine playEffect:SOUND_TEAR1];
//Get a vector from the shape to the touch point and use that as the start for our physics impulse
cpVect j = cpvsub(cpBodyGetPos(shape->body), vect);
View
2 Maestro/GameScene.m
@@ -124,7 +124,7 @@ -(void) update:(ccTime) delta
if (!_maestroAudioStarted &&
[[GameClock sharedInstance] currentTime] > _maestroAudioStartTime) {
NSLog(@"Starting Maestro music.");
- //[[GameSoundManager sharedInstance] playMaestro];
+ [[GameSoundManager sharedInstance] playMaestro];
_maestroAudioStarted = YES;
}
}
View
5 Maestro/GameSoundManager.h
@@ -2,6 +2,11 @@
//#define SOUND_CRASH @"crash.wav"
//#define SOUND_DEFEAT @"defeat.wav"
+#define SOUND_TEAR1 @"teardrop_1.wav"
+#define SOUND_TEAR2 @"teardrop_2.wav"
+#define SOUND_TEAR_CASE @"tear_in_case.wav"
+#define SOUND_STORE_REGISTER @"store_register.wav"
+#define SOUND_MENU_1 @"menu_1.wav"
typedef enum {
kGSUninitialised,
View
12 Maestro/GameSoundManager.m
@@ -14,15 +14,15 @@ @implementation GameSoundManager
//If you don't preload your sounds there will be a delay before they are played the first time while the sound data
//is loaded to the playback buffer
-(void) preload {
-
-// [soundEngine_ preloadEffect:SOUND_CRASH];
-// [soundEngine_ preloadEffect:SOUND_DEFEAT];
- [soundEngine_ preloadEffect:@"store_register.wav"];
-
+ [soundEngine_ preloadEffect:SOUND_TEAR1];
+ [soundEngine_ preloadEffect:SOUND_TEAR2];
+ [soundEngine_ preloadEffect:SOUND_TEAR_CASE];
+ [soundEngine_ preloadEffect:SOUND_STORE_REGISTER];
+ [soundEngine_ preloadEffect:SOUND_MENU_1];
+
//Preload the background music too but there is no point in preloading multiple background music files so only
//preload the first one you will play
[soundEngine_ preloadBackgroundMusic:@"title.wav"];
- [soundEngine_ preloadEffect:@"teardrop_1.wav"];
}
//TODO: modify these parameters to your own taste, e.g you may want a longer fade out or a different type of curve
View
4 Maestro/StoreLayer.m
@@ -145,8 +145,7 @@ - (void)buyStoreItem:(StoreItem *)item
gameManager.tearsCollectedTotal = gameManager.tearsCollectedTotal - item.price;
[gameManager.purchasedItems addObject:item];
- [[GameSoundManager sharedInstance].soundEngine playEffect:@"store_register.wav"];
-
+ [[GameSoundManager sharedInstance].soundEngine playEffect:SOUND_STORE_REGISTER];
[self updateMenu];
[self.devil animateForPurchase];
@@ -177,6 +176,7 @@ - (void)updateMenu
- (void)doneStore
{
+ [[GameSoundManager sharedInstance].soundEngine playEffect:SOUND_MENU_1];
GameManager *gameManager = [GameManager sharedInstance];
NSInteger nextLevelNum = gameManager.currentLevelNum + 1;
[[CCDirector sharedDirector] replaceScene:[CCTransitionCrossFade transitionWithDuration:0.5f scene:[GameScene nodeWithLevelNum:nextLevelNum]]];
View
2 Maestro/Tear.m
@@ -11,6 +11,7 @@
#import "GameUtils.h"
#import "Physics.h"
#import "Tear.h"
+#import "GameSoundManager.h"
#define MIN_LIFE 4.0
#define MAX_LIFE 10.0
@@ -98,6 +99,7 @@ - (void)die
- (void)hitBin
{
if (!self.isDead) {
+ [[GameSoundManager sharedInstance].soundEngine playEffect:SOUND_TEAR_CASE];
GameManager *manager = [GameManager sharedInstance];
[manager playerCollectedTear];
[self die];

0 comments on commit 482bff9

Please sign in to comment.
Something went wrong with that request. Please try again.