This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
play_sound [2017/04/26 14:59] – justin | play_sound [2024/01/31 21:49] – justin | ||
---|---|---|---|
Line 2: | Line 2: | ||
---- | ---- | ||
- | Plays the specified sound effect once. | + | Plays the specified |
+ | ====Signature: | ||
<code python> | <code python> | ||
- | play_sound(sound_name) | + | play_sound(sound_name, loop, interval) |
</ | </ | ||
^Argument^Description^Type^Required^ | ^Argument^Description^Type^Required^ | ||
- | |sound_name|Name of the sound effect to play.|[[String]]|Yes| | + | |sound_name|Name of the [[sound effect]] to play.|[[String]]|Yes| |
+ | |loop|Whether or not the [[sound effect]] will loop or play only once. When true, it will loop until stopped via the [[Stop Sound]] function.|[[Boolean]]|No| | ||
+ | |interval|Interval of time to wait between each playing of the [[sound effect]] (only applicable when the " | ||
+ | |||
+ | ^Return Value^Description^Type^ | ||
+ | |Sound ID|Returns a unique numeric ID that can be stored for later reference (e.g. to stop a looping sound via the [[Stop Sound]] function).|[[Number]]| | ||
+ | |||
+ | <WRAP center round info 100%> | ||
+ | The built-in [[Sound FX Generator]], | ||
+ | </ | ||
====Example: | ====Example: | ||
- | < | + | < |
- | play_sound(" | + | play_sound(" |
</ | </ | ||
- | // | + | // |
<WRAP center round tip 100%> | <WRAP center round tip 100%> | ||
- | Use the **Play Sound** function to trigger a sound effect when the player opens a door or a treasure chest, or some event occurs that you'd like the player to hear regardless of where they are. | + | Use the **Play Sound** function to trigger a [[sound|sound effect]] when the player opens a door or a treasure chest, or an event occurs that you'd like the player to hear regardless of their location. |
</ | </ | ||
Line 26: | Line 36: | ||
<WRAP half column> | <WRAP half column> | ||
====Editor Node:==== | ====Editor Node:==== | ||
- | {{:wiki: | + | {{: |
</ | </ | ||