cube-tube/app/util/sound.rb

26 lines
490 B
Ruby
Raw Normal View History

2023-03-23 05:16:35 +00:00
# frozen_string_literal: true
# Module for managing and interacting with sounds.
module Sound
class << self
def for(key)
SOUNDS.fetch(key)
end
def play(args, key, opts = {})
SOUNDS.fetch(key).play(args, opts) if args.state.setting.sfx
2023-03-23 05:16:35 +00:00
end
def stop(args, key)
SOUNDS.fetch(key).stop(args)
end
def pause(args, key)
SOUNDS.fetch(key).pause(args)
end
def resume(args, key)
SOUNDS.fetch(key).resume(args)
end
2023-03-08 03:06:29 +00:00
end
end