Commits

stqn committed d6c030b

Added sounds for jump, checkpoint, explosion and level start.

Comments (0)

Files changed (19)

data/checkpoint.ogg

Binary file added.

data/explosion.ogg

Binary file added.

data/jump.ogg

Binary file added.

data/start.ogg

Binary file added.

datasrc/checkpoint.sfs

Binary file added.

datasrc/checkpoint.wav

Binary file added.

datasrc/explosion.sfs

Binary file added.

datasrc/explosion.wav

Binary file added.

datasrc/jump.sfs

Binary file added.

datasrc/jump.wav

Binary file added.

datasrc/start.sfs

Binary file added.

datasrc/start.wav

Binary file added.
 				mMenu = null;
 				switch( mState ) {
 					case GameState.MENU_MAP:
-						new Chrono;
+						new Chrono;
+						gSoundManager.play( gSoundManager.get("start.ogg"), MIX_MAX_VOLUME/2 );
 						break;
 					case GameState.MENU_PAUSE:
 						mMenu = null;

src/gameobjects/boss.d

 import gameobjects.projectile;
 import gameobjects.updatedgameobject;
 import map;
+import soundmanager;
 import anim;
 import time;
 
 			mMoveSpeed += 4;
 			mShootDelay -= SHOOT_DELAY_DELTA;
 			if( mLifePoints == 0 ) {
+				playSound( gSoundManager.get( "explosion.ogg" ) );
 				destroySelf();
 			}
 		}

src/gameobjects/checkpoint.d

 import gameobject;
 import gameobjects.hero;
 import gameobjects.updatedgameobject;
+import soundmanager;
 import texturemanager;
 
 
 	static Checkpoint mCurrentlyActive;
 	static Anim mAnimBase;
 	AnimInstance mAnim;
+	Mix_Chunk* mSound;
 
 
 	this( float x, float y ) {
 		}
 		mAnim = new AnimInstance( mAnimBase );
 		mSurface = mAnim.getFrame();
+		mSound = gSoundManager.get( "checkpoint.ogg" );
 	}
 
 
 		if( mCurrentlyActive !is this && o.mType == Type.HERO ) {
 			mCurrentlyActive = this;
 			(cast(Hero) o).storeCheckpointPosition( mX, mY );
+			playSound( mSound );
 		}
 	}
 

src/gameobjects/enemy1.d

 import gameobjectmanager;
 import gameobjects.updatedgameobject;
 import map;
+import soundmanager;
 import anim;
 import time;
 
 			reverse();
 			mLifePoints--;
 			if( mLifePoints == 0 ) {
+				playSound( gSoundManager.get( "explosion.ogg" ) );
 				destroySelf();
 			}
 		}

src/gameobjects/enemy2.d

 import gameobjectmanager;
 import gameobjects.updatedgameobject;
 import map;
+import soundmanager;
 import anim;
 import time;
 
 
 	void hit( GameObject o ) {
 		if( o.mType == Type.PROJECTILE_HERO || o.mType == Type.MISSILE ) {
+			playSound( gSoundManager.get( "explosion.ogg" ) );
 			destroySelf();
 		}
 	}

src/gameobjects/enemy3.d

-
-
 
 module gameobjects.enemy3;
 
-
+import anim;
 import gameobject;
+import gameobjects.projectile;
 import gameobjects.updatedgameobject;
-import anim;
+import soundmanager;
 import time;
-import gameobjects.projectile;
 
 class Enemy3 : UpdatedGameObject {
 
 
 		mSurface = mAnim.getFrame();
 		makeCollBoxFromSurface();
-
 	}
 
 
 		if( o.mType == Type.PROJECTILE_HERO || o.mType == Type.MISSILE ) {
 			mLifePoints--;
 			if( mLifePoints == 0 || o.mType == Type.MISSILE ) {
+				playSound( gSoundManager.get( "explosion.ogg" ) );
 				destroySelf();
 			}
 		}

src/gameobjects/hero.d

 	Mix_Chunk* mSoundDead;
 	Mix_Chunk* mSoundMissile;
 	Mix_Chunk* mSoundRocket;
+	Mix_Chunk* mSoundJump;
 
 	/*
 	 * Rocket horizontal, dans RWK:
 		mSoundMissile = gSoundManager.get("missile.ogg");
 		mSoundDead = gSoundManager.get("hero_dead.ogg");
 		mSoundRocket = gSoundManager.get("rocket.ogg");
+		mSoundJump = gSoundManager.get("jump.ogg");
 	}
 
 
 	void jump() {
 		mVy = -JUMP_SPEED;
 		mJumpsCount++;
+		gSoundManager.play( mSoundJump, MIX_MAX_VOLUME*3/4 );
 	}