User Tag List

Results 1 to 10 of 10

Thread: Object Numbering

  1. #1
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module
    Verbage's Avatar
    Join Date
    Dec 2010
    Location
    Lakewood, CO, USA
    Posts
    233
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Object Numbering

    Hello all.

    I am working on a Minesweeper variant, and am having a few issues with bomb detection.

    As of now, the game checks for X and Y coordinates relative to bombs around it. My issue is that these actions only affect the first bomb to be spawned in... all other bombs do not run the command. I know if you make related events to an object it will apply the event to ONLY one object, however I need this to run the events for ALL bombs.

    Any help?

    Thanks in advance,

    -Verbage

  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)
    There is such a thing as object numbering, though it's called something else - the Spread value action (under Alterable Values) will assign values to the instances of that object in sequence starting from the number you specify (usually 0). You can then run a fastloop through them and compare each one individually. You can read the Fastloops tutorial (under Clickteam's tutorial page, on the right sidebar when you're on the forum list) to learn more.

    For games based heavily around grids of objects, I would actually recommend using the Advanced Game Board object (which has functionality for checking for adjacent tiles built in) and then using the data in that to draw the visible screen, rather than doing it directly - but if the approach you're using is working for you, it's worth continuing.

  3. #3
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,773
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    You might also have some luck with the Easy Grid Extension.

    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  4. #4
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module
    Verbage's Avatar
    Join Date
    Dec 2010
    Location
    Lakewood, CO, USA
    Posts
    233
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you David for your reply.

    I tried researching fast loops... to no avail (for this situation). I understand fast loops generally, but am quite stumped on how to run the event for each bomb. I'll go ahead and list what I have here, and see if anyone can make some corrections.

    Always
    Start Loop "Numbering" 1000 Times

    Always
    Spread value 0 in ID

    ID of "Tile" = LoopIndex("Numbering")
    *position stuff here for all adjacent angles, I've done separate tests so I know they detect*
    Add 1 to Bomb [Bomb Angle (1-7 are numbered animations) is always set to the Bomb value]

    I feel like I'm doing something wrong. If anyone knows the issue but is beyond describing in words, let me know and I can send you the source file.

    Please and thank you.

  5. #5
    Clicker Multimedia Fusion 2SWF Export Module
    Jacob's Avatar
    Join Date
    Jul 2007
    Location
    Second pixel to the right
    Posts
    3,208
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would use nested fastloops. Create two 1x1px active objects. Name one Detector 1 and the other Detector 2. Give both the Tile object and Detector 2 a value called MineCount.

    +Start of Frame -
    Start loop "Check 1" GridWidth*GridHeight times

    +On Loop "Check 1" -
    Detector 1: Set X Position to loopindex("Check 1") mod GridWidth
    Detector 1: Set Y Position to loopindex("Check 1") / GridWidth

    +On Loop "Check 1"
    +Detector 1 overlaps Tile
    Start loop "Check 2" 9 times

    +On Loop "Check 2"
    Detector 2: Set X Position to (X("Detector 1")-TileWidth)+(loopindex("Check 2") mod 3)* TileWidth
    Detector 2: Set Y Position to (Y("Detector 1")-TileHeight)+ (loopindex("Check 2")/3)* TileHeight

    +On Loop "Check 2"
    +Detector 2 overlaps Tile
    +Tile is a mine
    Detector 2: Add 1 to MineCount

    +On Loop "Check 1"
    +Detector 1 overlaps Tile
    +MineCount("Detector 2") > 0
    Tile: Set MineCount to MineCount("Detector 2")

    The red variables are defined as follows:
    GridWidth: The width of the grid in cells (eg: An 8x8 grid would use 8 for this number)
    GridHeight: The height of the grid in cells, see above.
    TileWidth: The width of each tile in pixels.
    TileHeight: The height of each tile in pixels.
    Minecount: The number of tiles adjacent to each tile.

    I hope this is clear enough. It's been a few years since I worked on my minesweeper game :P

  6. #6
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module
    Verbage's Avatar
    Join Date
    Dec 2010
    Location
    Lakewood, CO, USA
    Posts
    233
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you for your reply Jacob.

    I followed your guide step-by-step and reviewed it 3 times. Doesn't work. I can send you my .mfa, but so far this isn't working.

    Thanks

  7. #7
    Clicker Multimedia Fusion 2SWF Export Module
    Jacob's Avatar
    Join Date
    Jul 2007
    Location
    Second pixel to the right
    Posts
    3,208
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is your grid area at 0,0? I didn't put any code to offset it to whatever the grid position is

  8. #8
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module
    Verbage's Avatar
    Join Date
    Dec 2010
    Location
    Lakewood, CO, USA
    Posts
    233
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah that would do it. Yeah, my grid area starts at (10,94).

    Also: Do you happen to have a Skype? Would make this thing a bit speedier.

    Thanks again.

  9. #9
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module
    Verbage's Avatar
    Join Date
    Dec 2010
    Location
    Lakewood, CO, USA
    Posts
    233
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also, in the spirit of learning, what does "Mod" mean? I see the button, but mousing over it doesn't bring up an explanation box.

  10. #10
    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)
    It's the remainder after division - 1 mod 2 = 1, 2 mod 2 = 0, 3 mod 2 = 1, 6 mod 4 = 2, 7 mod 4 = 3...

Similar Threads

  1. Movement numbering and qualifiers?
    By mobichan in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 26th March 2010, 05:27 PM
  2. MMF2 autoversion numbering
    By Patrick in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 13th September 2007, 10:47 AM
  3. Action numbering
    By Nick in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 11th May 2007, 10:24 PM
  4. Frame numbering is off?
    By Wingamez in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 15th July 2006, 06:20 AM

Posting Permissions

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