Need Help Please...

Monkey Forums/Monkey Programming/Need Help Please...

Why0Why(Posted 2012) [#1]
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!




muddy_shoes(Posted 2012) [#2]
It looks like you've hacked around with the code so much that you've kind of lost sight of things. It happens. The main issue is that you seem to think that GameGrid.GetCurrentCell() returns a value. It doesn't. It sets the internal CurrentCellValue field.

Try replacing your OnUpdate with this:



I'd then recommend taking a break before coming back and looking over the code again and doing a bit of a clean up.


AdamRedwoods(Posted 2012) [#3]
It looks like you've hacked around with the code so much that you've kind of lost sight of things. It happens.

coding "tilt"


Why0Why(Posted 2012) [#4]
Thanks very much! It was driving me crazy. I am taking a break until tomorrow :)