|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvooga.engine.util.SoundPlayer
public class SoundPlayer
Singleton class designed to allow the ability to play sounds and music from anywhere in the game. The game must be set first, after that calling SoundPlayer.playMusic() or SoundPlayer.playSound will be the equivalent of calling those methods in your game.
Constructor Summary | |
---|---|
SoundPlayer()
|
Method Summary | |
---|---|
static void |
playMusic(java.lang.String audioFilePath)
Plays background music for your game. |
static void |
playSound(java.lang.String audioFilePath)
Play a sound effect for your game. |
static void |
setGame(Game game)
Sets the game for playing music. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SoundPlayer()
Method Detail |
---|
public static void setGame(Game game)
game
- the current game which you would like to play sounds inpublic static void playMusic(java.lang.String audioFilePath)
audioFilePath
- File path to the music file. Resources supplies the filepath.public static void playSound(java.lang.String audioFilePath)
audioFilePath
- File path to the music file. Resources supplies the filepath.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |