lib/units/thing.rb in gosu_extensions-0.1.7 vs lib/units/thing.rb in gosu_extensions-0.1.8

- old
+ new

@@ -90,13 +90,14 @@ end end # Plays a random sound of the given sounds. # - def plays *paths + def plays paths, options = {} + paths = [*paths] InitializerHooks.register self do sound = Gosu::Sample.new self.window, File.join(Resources.root, paths[rand(paths.size)]) - sound.play + sound.play options[:volume] || 1.0 end end end \ No newline at end of file