Audio "play by name" not working if value provided through instance variable. It does work properly if I pass "cat_sound" in Audio file name input box. But instead if I use an instance variable of Cat sprite(Cat.sound) then it doesn't play.
Develop games in your browser. Powerful, performant & highly capable.
Sorry guys its mine mistake....I was storing variable value in double quotes(Cat.sound = "cat_sound"). After removing " ", its working fine.