User Tag List

Results 1 to 4 of 4

Thread: Acceleration and deacceleration for custom movement?

  1. #1
    Clicker Fusion 2.5Fusion 2.5 MaciOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    dnlhern's Avatar
    Join Date
    May 2013
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Acceleration and deacceleration for custom movement?

    Hello! I've decided to finally start work on a small 8-directional engine with my own events instead of using the pre-built movements that CF2.5 comes with. I have got basic movement implemented, but now I am wondering what could be a good way to add acceleration and deacceleration to the movement? Sorry for the incredibly noobish question, I'm rather new to all this!

    I have provided an MFA file if anyone wants to tinker about.

    Thank you!

    GrimeAug20.mfa

  2. #2
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,310
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)
    The basic idea is that you need to make a set of variables for XSpeed and YSpeed. These values will tell your character how much to move in X and Y every frame. Then make another set of variables for XSpeedDelta and YSpeedDelta. "Delta" is used to define the amount of change to something every frame, in this case it would be the amount of acceleration or deceleration. At the start of Frame, define the Delta variables to a value (best to use decimal values). Then, when you press the joystick begin adding the Delta value to your XSpeed and YSpeed (depending on which direction you are going, you might subtract the Delta value). Then add the XSpeed and YSpeed value to your X and Y positions.

    Something like this:

    Start of Frame
    - Set XSpeedDelta to 0.1

    +If Joystick is pressed Right
    +XSpeed < Value (This is your Max speed)
    -- Add XSpeedDelta to XSpeed

    When you want to decelerate, simply do the opposite:

    +If Joystick is not pressed
    +XSpeed > 0.0
    -- Subtract XSpeedDelta from XSpeed

    Then always update the active's movement:

    + XSpeed different than 0.0 (you use "different" because the XSpeed value might be a positive or negative number)
    -- Set X Position(active) to X(active) + XSpeed

    Hope this helps.

    Reg

  3. #3
    Clicker Fusion 2.5Fusion 2.5 MaciOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    dnlhern's Avatar
    Join Date
    May 2013
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Many thanks!

  4. #4
    Clicker Fusion 2.5Fusion 2.5 MaciOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    dnlhern's Avatar
    Join Date
    May 2013
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Excuse the double post, but I went by mobichan's directions regarding accel/deaccel with the 8 dir movement, but I've ran into a small hitch. For some reason, the X and Y speeds always manage to go over 3.0 because of the delta value added to the object's speed, creating some left over values, such as the speed being 0.3 or -0.3 even when there is no activity, or the speed being 3.3 or -3.3 or a mishmash of numbers when moving.

    Can I get assistance on this, or is this a bug with Clickteam Fusion itself?

    Thank you. I have attached the MFA I am working with to show this, and sorry if I sound a bit confusing.

    GrimeAug26.mfa

Similar Threads

  1. Help with Custom Movement
    By lucaoo in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 3rd September 2011, 05:21 PM
  2. Acceleration on Bouncing Ball movement type?
    By TheBeak in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 16th July 2011, 09:53 PM
  3. Deacceleration ignored
    By Phi in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 20th March 2011, 10:16 AM
  4. Custom Movement problem (Horizontal movement)
    By KiteRyagara in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 7th June 2008, 03:40 PM
  5. Custom Movement
    By Rabagast in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 5th February 2008, 12:45 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
  •