User Tag List

Results 1 to 6 of 6

Thread: Using a Loop instead of every 0.01 seconds?

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    KLiK-iT's Avatar
    Join Date
    Sep 2011
    Location
    New Jersey
    Posts
    2,852
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Using a Loop instead of every 0.01 seconds?

    I have never used loops in my games,.but since I have the game working with no issue and I was thinking of trying one, instead of "every 0.01 seconds create object (snow). Now the game runs fine the way it is with no slow down at all. So would I gain anything out of using a loop for this event or should I just leave it alone?

    Here is the line that creates the snow and the events for it. Look at picture below. How would I set this up using a loop instead? What would the code read? Like I said,.I never used any loops before. Please explain.
    Thank you,

    John
    Images attachées Images attachées

  2. #2
    Clicker Fusion 2.5 DeveloperiOS Export Module
    ChrisBurrows's Avatar
    Join Date
    May 2011
    Location
    Tasmania, Australia
    Posts
    622
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    There is no reason to use a loop here.

    But, switch the "Every 0.01 seconds" to "Always". Assuming you are using the default framerate of 50 fps, then your event is actually happening every 0.02 seconds because MMF won't be processing your events any faster than 50 times a second.

  3. #3
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    The "Every" condition will trigger multiple times in quick succession to catch up when it falls behind, which can be undesirable in some cases.
    Working as fast as I can on Fusion 3

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    KLiK-iT's Avatar
    Join Date
    Sep 2011
    Location
    New Jersey
    Posts
    2,852
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I didn't know that guys. Thanks for the heads up. So, just take out the Every 0.01 and replace with "Always". Is that correct LB and Chris?

    Thanks again guys!

  5. #5
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Yes, using Always will get you per-frame events.
    Working as fast as I can on Fusion 3

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    KLiK-iT's Avatar
    Join Date
    Sep 2011
    Location
    New Jersey
    Posts
    2,852
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Thanks LB. You guys are great!

Similar Threads

  1. Replies: 7
    Last Post: 25th December 2012, 11:26 AM
  2. Mili seconds = seconds ?
    By Johnny in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 16th November 2009, 07:30 PM
  3. Seconds to HMS
    By LIJI in forum Released Extensions
    Replies: 0
    Last Post: 5th May 2007, 07:52 AM
  4. Seconds to Days, Hours, Minutes and seconds
    By dingdong in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 1st April 2007, 07:30 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
  •