User Tag List

Results 1 to 3 of 3

Thread: Random pick object -destroy eight surroung objects

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jul 2008
    Location
    United States
    Posts
    92
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Question Random pick object -destroy eight surroung objects

    Hi -
    I am designing a Windows (or HTML5) game with a grid of dots. The smallest grid is 6x6 and the largest will be 16x16. I want to be able to randomly pick a dot in the grid (I can), get it's x and y coordinates (I can) and finally, identify the 8 surrounding dots so I can flash them or destroy them. I can get the coordinates of the 8 surrounding objects by adjusting the X and Y coordinates of the target. I don't know how to translate those coordinates into the proper dots in the grid. I could use a blunt force approach for smaller grids (i.e. 6x6, 7x7) and write a routine for each individual dot. However, that is really tiresome when I get to the 16x16 grid (256 routines).
    In the game, a random dot is chosen in the grid. It starts flashing. If the player doesn't save the surrounding dots by the end of a set time, then the flashing dot and the 8 around it (or anythat are still adjacent) are lost. Not sure how to tackle this. Thanks for any suggestions and help offered.

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,366
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)
    I'm not exactly sure if I understand what you're asking for here.
    I suppose you want to know how to identify the 8 surrounding dots of a random dot?

    First, you need to find a way to pick a random dot. The easiest way to do that is to use the "pick Dot at random" condition.
    Then one method is to simply position an object shaped as a square that overlaps all surrounding objects but the one in the middle, on the target object.
    Then do whatever you want with the objects overlapping the shape.

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jul 2008
    Location
    United States
    Posts
    92
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Okay. That sounds like a good trick to try. Thank you for your time and expertise. Stay safe.

Similar Threads

  1. pick a random odd value
    By alexexhowl in forum Fusion 2.5
    Replies: 4
    Last Post: 25th June 2018, 09:57 AM
  2. Pick a Random object and destroy by id
    By agarcia in forum Fusion 2.5
    Replies: 7
    Last Post: 20th August 2015, 01:25 AM
  3. Pick Random Object From a Zone.
    By 00J in forum File Archive
    Replies: 0
    Last Post: 28th December 2007, 07:27 AM
  4. Pick object at random, among a selected few
    By Popcorn in forum File Archive
    Replies: 1
    Last Post: 6th December 2007, 05:51 PM
  5. Pick an object at random?
    By Clicktastic in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 13th August 2006, 01:31 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
  •