Hi All,
I have been experimenting with a Dungeon Raid style engine. This is a game where you match items by dragging your finger over a chain of similar items and you make the longest match possible. I am using a mouse on the HTML 5 version.
I have made a grid of 10x10 tiles and assigned random values between 1 and 4. The problem I am having is that I need it to only assign a match when the mouse is moved to the same value on an adjacent tile. I have been messing with this code for hours and changed lots of things around. It continues counting the values even if I drag over a different value. I have written debugging info at the bottom. I have experimented and commented out multiple things and tried different ways and I just can't get it to work.
Any help would be greatly appreciated. I feel it has to be something simple that I am missing, but I have wasted hours on this. Thanks in advance!
|