User Tag List

Results 1 to 5 of 5

Thread: Trying to learn foreach.

  1. #1
    Clicker Multimedia Fusion 2
    Fusion 2.5 (Steam)

    Join Date
    Oct 2011
    Location
    Oregon
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Trying to learn foreach.

    So, I'm trying to learn how to use the foreach extension, and this is what I'm doing to test it:
    http://i.imgur.com/CWU37tS.png
    So, if the enemy is within dist of the player, it moves toward it at 1 pixel per ms. The problem I'm having is that when there's only one on screen, it does move 1 pixel, like it's supposed to... but if there were 10 on screen, they would all move 10 pixels at a time, although their positions would still be handled separately. What am I doing wrong?

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 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)

    Join Date
    Apr 2007
    Location
    Australia
    Posts
    1,151
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you tried the other ForEach loop option? The "On ForEach loop for object" one, then pick your enemy object.

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    happygreenfrog's Avatar
    Join Date
    May 2011
    Location
    I.L.T.D.O.I.R (I.L.T.D.O.I.R's Location: The Dimension Of Infinite Recursion)
    Posts
    4,307
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Yeah, you need to use the "On ForEach loop for object" option, like RhysD said. Otherwise, it doesn't handle the object selection for you, basically making it worthless.

  4. #4
    Clicker Multimedia Fusion 2
    Fusion 2.5 (Steam)

    Join Date
    Oct 2011
    Location
    Oregon
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That worked, thank you. What's the point of the other option though? There doesn't appear to be a loop that corresponds with it.

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    happygreenfrog's Avatar
    Join Date
    May 2011
    Location
    I.L.T.D.O.I.R (I.L.T.D.O.I.R's Location: The Dimension Of Infinite Recursion)
    Posts
    4,307
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    My best guess is that it is for when you want to do something at the start of the loop that doesn't involve the individual object at all (E.G. setting a global value), no matter what object it is that started the loop of that name (E.G. both your enemy and your player have a loop with that name, and you want it to do that at the start of the loop in both cases).

Similar Threads

  1. A good way to learn about events?
    By ardo in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 28th December 2011, 07:59 PM
  2. Help Jibs Learn PMO (lol)
    By Jibs in forum Multimedia Fusion 2 - Technical Support
    Replies: 10
    Last Post: 18th December 2011, 06:02 PM
  3. Alphabet Learn
    By Jeff in forum iOS Released Games & Apps
    Replies: 0
    Last Post: 16th September 2011, 02:22 PM
  4. Help - I'm trying to learn to use the event editor
    By keokeo in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 6th April 2008, 07:42 AM
  5. Best way to learn Lua...?
    By aidmm in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 10th December 2006, 11:54 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
  •