User Tag List

Results 1 to 4 of 4

Thread: Projectiles using ForEach

  1. #1
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module

    Join Date
    Oct 2013
    Location
    England
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Projectiles using ForEach

    Hey guys,

    Just half way through recoding all my bad guys as ForEach loops so speed up my FPS.

    I have a few projectiles in the game as well that might be better off with ForEach loops too but would like to get some opinions from those who may be able to help my understanding.

    For example currently my stick of dynamite code starts with:

    Dynamite collides with background

    -run loop 'CollideX'
    -run loop 'ColideY'

    Would it be better to put it in a ForEach loop e.g:

    ForEach loop collide for object Dynamite
    +Dynamite collides with background

    -run loop 'CollideX'
    -run loop 'ColideY'


    I'm wondering which way would be faster and less of a burden on memory and FPS. Thanks in advance.

  2. #2
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module

    Join Date
    Oct 2013
    Location
    England
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can anyone offer some thoughts on this? Have I explained the question well enough?

    Just wondering what MMF2 does in the background if you just leave it with a collide condition and if that is simplified by ForEach and therefore better practice.

    If anyone can offer some idea, I'd really appreciate it.

  3. #3
    Clicker Fusion 2.5iOS 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)
    SolarB's Avatar
    Join Date
    Feb 2012
    Location
    Melbourne
    Posts
    904
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    With this you are better off going with your first method but using foreach for the loops, ie:

    Dynamite collides with bg
    - start foreach loop "collide" for object dynamite

    This will narrow the object scope down to only whatever dynamite is colliding and iterate over only those instances.

    This is one of many advantages of using ForEach. This does not work with normal loops as the object scope is reset in the "on loop" event.

  4. #4
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module

    Join Date
    Oct 2013
    Location
    England
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the reply, I am not working on it today but will report back when I am on it again!

Similar Threads

  1. Bouncing shell projectiles?
    By ChrisBurrows in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 16th October 2011, 10:30 PM
  2. Projectiles Collide at once?
    By Pixzel in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 25th May 2011, 10:12 AM
  3. Limiting onscreen projectiles
    By adamwalker13 in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 21st October 2008, 07:42 PM
  4. How do i do a ForEach
    By Spryz in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 12th May 2008, 12:45 AM

Tags for this Thread

Posting Permissions

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