User Tag List

Results 1 to 3 of 3

Thread: I've got 2 groups interacting, along with 'for each' loops, but!

  1. #1
    Clicker Multimedia Fusion 2
    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)
    FlipSwitchX's Avatar
    Join Date
    Feb 2012
    Location
    California
    Posts
    182
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Wink I've got 2 groups interacting, along with 'for each' loops, but!

    But problems still occur! :P

    Ok here's the situation:
    I've got several kinds of projectile that can be thrown, and I've got several kinds of enemy. I put both things in their own group.

    However, these projectiles are sometimes just laying around on the game field, such as trash cans in a beat 'em up.
    When I throw a projectile at an enemy, if the enemy is overlapping a dormant projectile of a different kind ( like I threw a trashcan but the enemy is overlapping a baseball bat), the thrown projectile will immediately react, and bounce away, even though it's nowhere near the enemy. The enemy will also react at a distance.

    To avoid this entanglement I've tried various configurations with and without loops, but nothing seems to be problem free.

    The last thing I tried read basically as such:

    •Overlapping group.projectile and group.enemies
    ->start loop for each group.projectile
    ->start loop for each group.enemy

    •On loop for each enemy
    •Projectile overlapping enemy
    •'Projectile has been thrown' flag on
    -enemy get hit, create effects, etc

    •On loop for each projectile
    •Projectile overlapping enemy
    •'Projectile has been thrown' flag on
    ->projectile bounce off, etc

    Also I'm using physics movement for throwing the projectile, in case that might have anything to do with it.
    This perplexes me as I didn't think it would give me such trouble.

  2. #2
    Clicker Fusion 2.5
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    573
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    you shouldn't need a loop for this.

    when two objects overlap, only they are scoped. something like

    -projectile has been thrown flag is on
    -projectile overlaps enemy
    -->projectile bounce off

    should work. if it doesn't, try always starting a projectile foreach loop only, and doing the same thing as above with "on foreach" at the top.

  3. #3
    Clicker Multimedia Fusion 2
    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)
    FlipSwitchX's Avatar
    Join Date
    Feb 2012
    Location
    California
    Posts
    182
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    hqdefault.jpg Thank you

Similar Threads

  1. Replies: 7
    Last Post: 16th December 2015, 08:23 PM
  2. Replies: 3
    Last Post: 16th July 2015, 05:37 PM
  3. Replies: 1
    Last Post: 7th November 2014, 08:16 AM
  4. only when event loops and groups help.
    By Clicktastic in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 20th October 2006, 09:08 PM
  5. Loops 'n' groups in mmf2
    By stuckboy in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 18th July 2006, 04:25 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
  •