Selecting a gem
Now the player must be able to select gems since he's supposed to swap them to form streaks.
The idea: When the player clicks, we can detect mouse coordinates, check if he clicked inside the game area and know which gem he selected.
The development: You already drew the selector, so it's just a matter of placing the selector in the proper tile when the player clicks the mouse.
First we need a new class level variable to create a
private var jewels:Array=new Array(); private var gemsContainer:Sprite=new Sprite(); private var gem:gem_mc; private var selector:selector_mc=new selector_mc();
Notice how I already used the constructor
new selector_mc() to have it ready to be used.
Main constructor function, ...