Game Development Reference
In-Depth Information
We only added couple of things over previous example.
72
@music
=
Gosu
::
Song
.
new(
73
self
, media_path(
'menu_music.mp3'
))
74
@music
.
volume
= 0.5
75
@music
.
play(
true
)
a little more quiet and starts playing in a loop.
16
def
self
.
load_sound
(window)
17
Gosu
::
Sample
.
new(
window, media_path(
'explosion.mp3'
))
18
19
end
Explosion
has now got
load_sound
method that loads
explosion.mp3
sound
and passed into every new
Explosion
, where it simply starts playing.