module Scar::Music
Overview
This module provides simple methods to manage music playback.
It utilizes a stack to enable simple continuation of previous music. This behaviour can be used to e. g. play pause music and continue playing the game music easily after unpausing the game.
Example usage:
Scar::Music.play "music/menu.ogg"
# Game starts
Scar::Music.play "music/overworld.ogg"
# Player returns to menu
Scar::Music.pop_continue
Extended Modules
Defined in:
scar/music.crInstance Method Summary
-
#current
Returns the song that is currently playing / on top of the song stack
-
#current?
Returns the song that is currently playing / on top of the song stack, or nil if the song stack is empty
-
#play(asset_name : String)
Pauses the current song, pushes the new song onto the song stack and starts playing it
-
#pop
Stops current music and removes it from the stack
-
#pop_continue
Stops current song, removes it from the stack and continues playing the previous music (if present)
Instance Method Detail
Returns the song that is currently playing / on top of the song stack, or nil if the song stack is empty
Pauses the current song, pushes the new song onto the song stack and starts playing it
Stops current song, removes it from the stack and continues playing the previous music (if present)