The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.

1. ## stick

Hi see this game
http://www.tallhat.com/matches/

Now what they have used to check the ans is they had store the x(say x=200)and y(say y= 300) value of solutions to a variable and whenever it matches you win , the problem is that if you drag all these stick to some other places(then x and y values changes), and then chk you wont be havng right ans , now i want to have other logic to do this ... any help

HI guys , i got stuck with the ans checking logic to this type of game......help me ....
Last edited by rahul_7star; May 31st, 2008 at 12:40 PM.

2. HI
i am having 8*8 grid and i am having a move clip, whenevr you release that movie clip it should attached itself to its nearby Grid(8*8)......any help

3. try

Code:
```var g_gridSpacing:Number = 40;
_mc.onRelease = _mc.onReleaseOutside=function () {
this.stopDrag();
// Stop Dragging
X = this._x;
// Reference X Pos
Y = this._y;
// Reference Y Pos
if (X<320 && Y<320) {
this._x = Math.round(X/g_gridSpacing)*g_gridSpacing;
// Round to nearest GridSpace
this._y = Math.round(Y/g_gridSpacing)*g_gridSpacing;
// Round to nearest GridSpace
}
};```

4. Thanks but i want something like this ....see the fla..

Originally Posted by neilmmm
try

Code:
```var g_gridSpacing:Number = 40;
_mc.onRelease = _mc.onReleaseOutside=function () {
this.stopDrag();
// Stop Dragging
X = this._x;
// Reference X Pos
Y = this._y;
// Reference Y Pos
if (X<320 && Y<320) {
this._x = Math.round(X/g_gridSpacing)*g_gridSpacing;
// Round to nearest GridSpace
this._y = Math.round(Y/g_gridSpacing)*g_gridSpacing;
// Round to nearest GridSpace
}
};```

5. you need to use hitTest

draw a copy of your grid

make each mtach stick position an mc and put a reference to each stick position in an array

then alpha copy grid to 0

when moving a matchstick, on release just do a hitTest to array of alpha out matchsticks in a for loop

the sticks do not have to snap to _x and _y but if you want them to they can match the _x and _y of the match with alpha O

this will also easily give you a match to see if the game is finished

hope this helps

6. Originally Posted by neilmmm
you need to use hitTest

draw a copy of your grid

make each mtach stick position an mc and put a reference to each stick position in an array

then alpha copy grid to 0

when moving a matchstick, on release just do a hitTest to array of alpha out matchsticks in a for loop

the sticks do not have to snap to _x and _y but if you want them to they can match the _x and _y of the match with alpha O

this will also easily give you a match to see if the game is finished

hope this helps

well if you can post a fla then i can have some idea..........right now i am not able to make it