User Tag List

Results 1 to 4 of 4

Thread: Decimal Place Movement on a Moving Platform

  1. #1
    Clicker Fusion 2.5 DeveloperiOS Export Module
    FinalSpecimen's Avatar
    Join Date
    Oct 2011
    Location
    Boston, MA
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Decimal Place Movement on a Moving Platform

    I have a moving platform system that works like so:

    "Platform" Flag 0 is on +
    "Platform" Value A < 3
    : Add 0.1 to "Platform" Value A

    "Platform" Collides with "Right Boundary":
    : Set "Platform" Flag 0 off
    : Set "Platform" Flag 1 on

    "Platform" Flag 1 is on +
    "Platform" Value A > -3
    : Sub 0.1 to "Platform" Value A

    "Platform" Collides with "Left Boundary":
    : Set "Platform" Flag 1 off
    : Set "Platform" Flag 0 on


    This sets the platform moving back and forth, with deceleration and acceleration every time it switches directions.

    Then to make my player ride the platform:

    "Feet Detector" is overlapping "Platform"
    : Set X("Player") to (X("Player")+Alt Value A("Platform")

    Everything works fine until the deceleration/acceleration starts, at which point the player "slides" on the platform. The equation does not appear to recognize the decimal values of the Platform with respect to the Player's position.... any suggestions?

  2. #2
    Clicker Fusion 2.5 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)
    Sumo's Avatar
    Join Date
    Jul 2008
    Posts
    642
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    If you number isn't remembering the digits after the decimal point, try multiplying it by 1.0

    That should keep it as a float.

  3. #3
    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)
    It's probably something simple. If you set an object to a floating point position, it is rounded to the nearest whole number, creating precision errors in future calculations. The work around is to store the actual floating point position in an alterable value and update it every frame. Or perhaps your events are misordered, but really it's impossible to pinpoint the culprit without seeing your code. Upload an mfa demonstrating the problem and you'll get help.

  4. #4
    Clicker Fusion 2.5 DeveloperiOS Export Module
    FinalSpecimen's Avatar
    Join Date
    Oct 2011
    Location
    Boston, MA
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @ChrisBurrows - I have solved my original problem from your suggestion - in the event editor, I moved the Platform events above the single "Always" event that moves the Platform relative to its Alt. Value. I believe when MMF2 reads down the events, it now sees to set Player to the Platform first, and move the Platform second, which solves the problem.

    I am having a secondary issue however - when I land on the vertical platform, while it is moving down, the character bounces. Haven't been able to figure this one out. Below is the MFA link, let me know if you have any download issues. Thanks.

    https://www.dropbox.com/s/i636ubj4ps...OBLEM.mfa?dl=0

Similar Threads

  1. Horizontal Moving Platform using Platform Movement Object example
    By Warmachine in forum Guides, Tutorials, Examples, Widgets
    Replies: 0
    Last Post: 20th January 2015, 09:31 PM
  2. Counter only shows one decimal place on Android
    By PunchyBog in forum Android Export Module Version 2.0
    Replies: 2
    Last Post: 13th August 2013, 07:19 AM
  3. Moving platforms with PMO (Platform Movement Object)
    By Ahiru in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 19th February 2013, 12:57 AM
  4. Moving Platform in Platform Movement Object
    By radel999 in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 16th July 2012, 01:49 PM
  5. Decimal place in Edit box?
    By billv in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 29th March 2009, 11:48 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
  •