Android Open Source - Space.Sprint Sound Manager






From Project

Back to project page Space.Sprint.

License

The source code is released under:

GNU General Public License

If you think the Android project Space.Sprint listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.obisapps.spacerun;
/*ww  w .  j  a  v a2s  .c o m*/
import java.util.Random;





import android.content.Context;
import android.media.MediaPlayer;

public class SoundManager {

  private Context context;
  
  MediaPlayer musicMPlayer;
  MediaPlayer jumpMPlayer;

  Random musicChoose = new Random();
  
  public SoundManager(Context aContext) {
    context = aContext;

  }
    
  public void init() {
        
    
    musicMPlayer = MediaPlayer.create(context, R.raw.calm);
    
    musicMPlayer.setLooping(true);
    
    jumpMPlayer = MediaPlayer.create(context, R.raw.jump);

        
  }
  
  
  
  public void jumpSound() {
    
    jumpMPlayer.start();
    
  }
  
  public void playMusic() {
    
    musicMPlayer.start();
    
  }
  
  public void stopMusic() {
    
    musicMPlayer.stop();
  }
  


  
}




Java Source Code List

com.obisapps.spacerun.GameActivity.java
com.obisapps.spacerun.GameEngine.java
com.obisapps.spacerun.GameView.java
com.obisapps.spacerun.HighScoreDBAdapter.java
com.obisapps.spacerun.HighScoreDatabaseHelper.java
com.obisapps.spacerun.LevelCharacter.java
com.obisapps.spacerun.PhysicsEngine.java
com.obisapps.spacerun.PickUpManager.java
com.obisapps.spacerun.PlayerCharacter.java
com.obisapps.spacerun.RenderThread.java
com.obisapps.spacerun.SoundManager.java
com.obisapps.spacerun.SpaceBackground.java
com.obisapps.spacerun.SpaceSprint.java