User Tag List

Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 26

Thread: X += (target - X) * .1

  1. #1
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,256
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)

    Question X += (target - X) * .1

    I was watching this video, which is very interesting http://www.youtube.com/watch?v=Fy0aCDmgnxg

    At about minute 4 in the video they show this formula I have in the title. How would this be translated to an event in MMF? Many of these effects are very cool, especially the one where the ball hits the walls and they "bounch" on the impact. I wonder how these could be translated to mmf code.

  2. #2
    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)
    += (stuff) just means Set X to X + (stuff) or Add to X (stuff).

  3. #3
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,256
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SolarB View Post
    += (stuff) just means Set X to X + (stuff) or Add to X (stuff).
    This formula has something to do with easing object so they move smoothly instead of stopping and starting abrubtly

  4. #4
    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)
    Plugged it into MMF2, with a Target value of 50 and an initial X value of 0.

    0
    10
    18
    24.4
    29.52
    33.616
    36.8928
    39.5142
    41.6114
    43.2891
    44.6313
    45.705
    46.564
    47.2512
    47.801
    48.2408
    48.5926
    48.8741
    49.0993
    49.2794
    49.4235
    49.5388
    49.6311
    49.7049
    49.7639
    49.8111
    49.8489
    49.8791
    49.9033
    49.9226
    49.9381
    49.9505
    49.9604
    49.9683
    49.9746
    49.9797
    49.9838
    49.987
    49.9896
    49.9917
    49.9934
    49.9947
    49.9957
    49.9966
    49.9973
    49.9978
    49.9983
    49.9986
    49.9989
    49.9991
    49.9993
    49.9994
    49.9995
    49.9996
    49.9997
    49.9998
    49.9998
    49.9999
    49.9999
    49.9999
    49.9999
    49.9999
    50

  5. #5
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,256
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ChrisBurrows View Post
    Plugged it into MMF2, with a Target value of 50 and an initial X value of 0.

    0
    10
    18
    24.4
    29.52
    33.616
    36.8928
    39.5142
    41.6114
    43.2891
    44.6313
    45.705
    46.564
    47.2512
    47.801
    48.2408
    48.5926
    48.8741
    49.0993
    49.2794
    49.4235
    49.5388
    49.6311
    49.7049
    49.7639
    49.8111
    49.8489
    49.8791
    49.9033
    49.9226
    49.9381
    49.9505
    49.9604
    49.9683
    49.9746
    49.9797
    49.9838
    49.987
    49.9896
    49.9917
    49.9934
    49.9947
    49.9957
    49.9966
    49.9973
    49.9978
    49.9983
    49.9986
    49.9989
    49.9991
    49.9993
    49.9994
    49.9995
    49.9996
    49.9997
    49.9998
    49.9998
    49.9999
    49.9999
    49.9999
    49.9999
    49.9999
    50
    Can you show an example how you did it?

  6. #6
    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)
    Chris I think your numbers are a little off, but I could be wrong...

  7. #7
    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)
    Care to elaborate?

  8. #8
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleXNA 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)
    gkinfinity's Avatar
    Join Date
    May 2011
    Location
    USA
    Posts
    284
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    According to Chris' example, using the numbers 0 and 50 it should look like...

    0 += (50-0) * 0.1, which becomes 0 += 5 which is 5
    5 += (50-5) * 0.1, which becomes 5 += 4.5 which is 9.5

    So yeah, I think Chris' numbers were a little off. I'd assume he was actually using the equation X += (target-X )*0.2, and the last number can obviously be changed to whatever you want anyway. The higher the decimal number is, the faster the object will approach its target. Just mess around with it to see what works best for you.

    At any rate, here's an example.

    Edit: Oh, I forgot to mention... for the example just press the spacebar to generate a random target location on screen.
    Attached files Attached files

  9. #9
    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)
    Actually yeah, my mistake. I was playing around with different values and I guess I posted the results for the a slightly different equation, X += (target-X )*0.2

    Nice example by the way gkinfinity.

  10. #10
    Clicker Multimedia Fusion 2 DeveloperiOS 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)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Pretty cool stuff they manage to do in the video.
    Ill deff check this out when i get the time.
    Thanks for posting this Outcast

Page 1 of 3 1 2 3 LastLast

Similar Threads

  1. Aiming target
    By MdNelson in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 16th September 2013, 12:16 PM
  2. Deployment Target
    By phanchingchong in forum iOS Export Module Version 2.0
    Replies: 2
    Last Post: 15th October 2012, 05:45 PM
  3. Accelerate to target
    By SolarB in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 22nd July 2012, 03:03 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
  •