Hello all...I have been gone for a long time because I was grounded...or atleast I thought I was, but thats a different story. While I was gone I decided to make a tic-tac-toe game, and I have everything I need, except the most important part....HOW TO WIN!
I'm not sure how to go about doing this. Do I run a check whenever somone clicks on a square to go, to see if there is an X above the one they just put down and an X below it or something? I tried using the get_dir(), but it would make me win no matter what, so I know that's not right ;). If somone could point me in the right direction I would really appreciate it.
?The Wizard of How¿
ID:261350
Jan 13 2002, 5:22 am
|
|
Jan 13 2002, 6:18 am
|
|
try get step.
|
Example, you have three in a row, you just placed your last piece.
Have that piece check in every direction. If it finds another peice north of you, check north of that piece. If there's one there, run WinGame squences. Do something similar for each direction when you place a piece. |
In response to Foomer
|
|
Yeah, but what would I use to do that? I tried get_step and get_dir, but I couldnt get it. Thanks Foom
|
In response to The Wizard of How
|
|
get_dir returns a number, here's one way you can do this; make some vars:
mob Now, when checking the direction do it like so: mob Now, when you make a new piece appear on the board call that proc. |
In response to Nadrew
|
|
Sorry Im being so stupid about this, but This error comes up and I'm not sure how to fix it;
src.kind:bad var In this line; if(T.kind == src.kind) Can somone help me please......again? |
In response to The Wizard of How
|
|
kind has to be a obj var and a mob var, set the mobs kind to what their team is at login, and then when you make a obj set it's kind to src.kind.
|