Audio
Controls audio and sfx in the game
Constructor Summary
Public Constructor | ||
public |
constructor(instance: Game) Default constructor |
Member Summary
Public Members | ||
public |
An object with all of the music and sfxs |
|
public |
Whether or not music is on in the game |
|
public |
The format of the audibles |
|
public |
An instance of the game |
|
public |
All the music in the game |
|
public |
All the SFX in the game |
|
public |
An instance of the song |
|
public |
The name of the song |
Method Summary
Public Methods | ||
public |
Clear the fade in interval |
|
public |
Clears the fade out interval |
|
public |
Fade in the active song |
|
public |
Fade out the active song |
|
public |
Triggers the song to fade out and then resets it |
|
public |
fileExists(name: String): Boolean checks to see if this song file exists in the music list |
|
public |
Return the song |
|
public |
Returns an object with the sound and the name of the sound |
|
public |
Return the music volume |
|
public |
Return the SFX volume |
|
public |
Returns true if the users sound is enabled |
|
public |
Loads the music and sfx in the game |
|
public |
Default constructor |
|
public |
Play a specific audio file |
|
public |
Resets a song so that it's ready to play from the beginning again |
|
public |
setSongVolume(volume: Number): Boolean Set the volume level on the sound |
|
public |
Stop playing a song |
|
public |
Update a song to replay, fade in, fade out or reset |
Public Constructors
Public Members
Public Methods
public fadeOut(callback: Function): Boolean source
Fade out the active song
Params:
Name | Type | Attribute | Description |
callback | Function | trigger this callback when the fade out is done |
public fileExists(name: String): Boolean source
checks to see if this song file exists in the music list
Params:
Name | Type | Attribute | Description |
name | String | the name of the song |
public get(name: String): Boolean source
Return the song
Params:
Name | Type | Attribute | Description |
name | String | the name of the song |
public getMusic(name: String): {sound: HTMLAudioElement, name: String} source
Returns an object with the sound and the name of the sound
Params:
Name | Type | Attribute | Description |
name | String | the name of the music |
public parse(path: String, name: String, channels: Array, callback: Function) source
Default constructor
public reset(song: *): Boolean source
Resets a song so that it's ready to play from the beginning again
Params:
Name | Type | Attribute | Description |
song | * |