Hi, I'm new to C2, and apologize if this is a noob question. I have a series of sounds effects, and I would like to play a particular sound effect when a magic wand of particular color (sprite) is dragged onto another sprite. The magic wand sprite has an instance variable of type int that indicates which color it is, and I was wondering if it is possible to save the sound effects in an array object, then depending on which instance variable of the magic wand, play a particular sound effect?
For instance, if I were to do this in javascript, the code would look something like below. Is there any easy way to replicate this in C2?
var arrSounds = ['1.ogg', '2.ogg', '3.ogg'];
objToDetectDrop.addEventListener('dragover' function(e) {
//blah blah blah
arrSounds[e.dataTransfer.getData('color')].play();
});