Hi
I need help with adding sound off/on button to my game. In global variable lua file, I have the following:
local sounds = {} sounds["select"] = audio.loadSound("sounds/select.mp3") sounds["score"] = audio.loadSound("sounds/score.mp3") G.playSound = function(name) if sounds[name] ~= nil then audio.play(sounds[name]) end end
In games.lua file, I call the function as:
utils.playSound("score")
I have a soundon.png and soundoff.png files both in a sprite sheet ( not sure if that is a good idea ) and I want to integrate it into the game. Any help would be appreciated.