User Tag List

Results 1 to 3 of 3

Thread: Decimal movement deceleration

  1. #1
    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)

    Decimal movement deceleration

    Hi
    This is kinda hard to explain.
    ...

    This is how the Player decelerates:

    If 'MovementSpeedX_' > 0
    -->
    subtract 1 from 'MovementSpeedX_'
    ...

    Lets say my Player 'MovementSpeedX_' = 0.4 ( moving to the right )
    The result will be that 'MovementSpeedX_' = -0.6 ( moving to the left )

    How can i alter my deceleration condition to make it so that the deceleration does not reverse the movement speed?

  2. #2
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Jaffob's Avatar
    Join Date
    May 2008
    Location
    USA
    Posts
    1,833
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Instead of using the subtract from alterable value action, use set alterable value. Set it to:

    Max(0, movementspeedx_("Player")-1)

    This will set the speed to whichever is greater, the player after decelerating or 0. If you program deceleration in the opposite direction, use Min() for that one.

  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)
    movementspeedx_ of player <> 0: Set movementspeedx_ of Player to movementspeedx_ - (movementspeedx_/Abs(movementspeedx_))

    However if you're going to be dealing with non-integers, this won't work.

    Expression courtesy of Eliyahu

Similar Threads

  1. A little problem in my drag with deceleration
    By paobrasil in forum iOS Export Module Version 2.0
    Replies: 1
    Last Post: 23rd February 2013, 08:36 PM
  2. screen drag with deceleration
    By Sumo in forum iOS Export Module Version 2.0
    Replies: 3
    Last Post: 1st October 2012, 05:29 AM
  3. Deceleration problem
    By siriso in forum The Games Factory 2 - Technical Support
    Replies: 2
    Last Post: 23rd October 2008, 04:50 PM
  4. Sliding with deceleration
    By Azeo in forum The Games Factory 2 - Technical Support
    Replies: 5
    Last Post: 27th June 2008, 09:24 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
  •