User Tag List

Results 1 to 9 of 9

Thread: Connect 4

  1. #1
    No Products Registered

    Join Date
    Jan 2007
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Connect 4

    hi guys, i have made a handy little connect 4 game, it all works fine, the only thing i cant do and have no idea how to do is, make the game end when a player gets 4 in a row....(at the moment it just carries on) .....anybody have any idea how i can do this ?

    thanks

  2. #2
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Connect 4

    How are you storing the positions of the player's pieces on the screen? If it's in an array then it could be done mathematically (don't ask me exactly how, though!)

    If it's a collection of actives then I think the easiest way would be to create a "scanner" object that runs across the length, width and diagonals of the board (look up fastloops if you haven't used them before) and stops when it detects four in a row. This could be done by using an alterable value that increases if the piece it overlaps is the same as the last one, and resets to 1 if it's different.

  3. #3
    No Products Registered

    Join Date
    Jan 2007
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Connect 4

    thanks man i kind of understand, yeah i basically have an active object (the arrow) and when user clicks button, i made it CREATE a yellow counter that falls down into the grid until it hits an invisible line (or another counter)

    at the moment i have made a scanner object that is running straight up and down, (im gonna clone it and put one in EACH of the horizontal or vertical areas it can go) im gonna do this instead of using just 1 scanner object as it cant move fast enough to move in all the rows, and i want the game to end as soon as the player has 4 in a row

    so yeah i have put the scanner object in one row for now, but im still stuck....at first i tried creating a counter and said "when scanner colides with the Yellow counter, add 1 to the counter"....and "when scanner colides with red counter RESET yellow counter to 0"......but this didnt work as every time the scanner came back down and colided with the same yellow peice again, it still added 1 to the counter........so then i had the bright idea of saying "when scanner DOESNT colide with yellow counter - RESET counter to zero"....BUT i couldnt fugure out how to write this, my first guess was to NEGATE the scanner colides with yellow counter, but it wont let me Negate it

    so im still stuck arghhhh can you help ?

  4. #4
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Connect 4

    To carry on with what you're doing, you can replace your collision conditions with the "Object is overlapping object" condition, which is negatable - the Collides one just triggers when an object wasn't overlapping the other object on the last frame and is now.

  5. #5
    No Products Registered

    Join Date
    Jan 2007
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Connect 4

    Hi david! all seems to be working! all i gotta do now is the tedius part of creating all those other scanners for the different horizontal rows and vertical AND diagonal arghhhh

    thanks for all the help

  6. #6
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jun 2006
    Location
    England
    Posts
    3,520
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: Connect 4

    For anyone with MMF2 you can use the Advanced Game Board Object to do the hard work for you (just check out the demo in your \MMF2\examples\AGBO\ folder).
    .:::.Joshtek.:::.

  7. #7
    No Products Registered

    Join Date
    Jan 2007
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Connect 4

    oh im being cheeky now but i dont spose you could answer this question could you? i have a top down racer game but i dont like the fact you have to push up to move, also i dont like the fact that if you let go of the controller the car still keeps going and doesnt decelerate unless you press down......what i want is to be able to hold down a button to move and when you let go it decelerates, any ideas how to do this?

  8. #8
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jun 2006
    Location
    England
    Posts
    3,520
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: Connect 4

    Check out: \Examples\Clickteam Movements\Vector Examples.mfa - You should be able to modify the Asteroids movement to what you want.

    If that example won't load then get http://x.jflom.com/files/klik/cursorless_vector_example.zip
    .:::.Joshtek.:::.

  9. #9
    No Products Registered

    Join Date
    Jan 2007
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Connect 4

    Thanks for that mate! im afraid i aint as advanced as that, i just tried to copy the example but failed....i set movement to vector and inserted a movement contoller...but in the event editor i wasnt able to get the same values as the example...it has add 2 to angle etc and i got really frustrated, where am i going wrong?

    thanks

Similar Threads

  1. Connect Four AI?
    By StingRay in forum iOS Export Module Version 2.0
    Replies: 7
    Last Post: 16th June 2012, 11:51 AM
  2. Can't... connect... to anything...
    By Konidias in forum Lacewing
    Replies: 12
    Last Post: 18th June 2011, 04:42 AM
  3. cant connect?
    By Gibbon in forum Lacewing
    Replies: 7
    Last Post: 17th November 2010, 01:44 PM
  4. Connect the Dots
    By rogiedodgie32 in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 31st January 2010, 08:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •