public class HandleSoundFx
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
java.applet.AudioClip |
bgMusicClip
The background music clip
|
boolean |
playOnlyOnce
Identifies if a sound effect should only be played once
|
GameObject |
sonic
The game object that triggers the sound effects
|
boolean |
startedBGM
Identifies if the background music has already started playing
|
| Constructor and Description |
|---|
HandleSoundFx()
The default constructor
|
HandleSoundFx(GameObject sonic)
The general constructor used to create the object
|
| Modifier and Type | Method and Description |
|---|---|
void |
playMusic(java.lang.String musicLocation)
Playing the background music
|
void |
playSoundFx(java.lang.String soundFxLocation)
Playing the sound effects
|
void |
stopMuisc()
Stopping the music
|
void |
update()
Updating the music and sound effects
|
public boolean startedBGM
public boolean playOnlyOnce
public GameObject sonic
public java.applet.AudioClip bgMusicClip
public HandleSoundFx()
public HandleSoundFx(GameObject sonic)
sonic - The game object that triggers the sound effectspublic void update()
public void playSoundFx(java.lang.String soundFxLocation)
soundFxLocation - The file of the sound effectpublic void playMusic(java.lang.String musicLocation)
musicLocation - The file of the musicpublic void stopMuisc()