User Tag List

Results 1 to 2 of 2

Thread: Floating Point Movement & Fastloops

  1. #1
    Clicker Fusion 2.5Android 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)
    MasochisticGamer's Avatar
    Join Date
    Nov 2012
    Location
    Gravois Mills. MO USA
    Posts
    76
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Question Floating Point Movement & Fastloops

    Start of Frame
    ~Set XPos("Player") to X("Player")
    ~Set YPos("Player") to Y("Player")

    Left("Counter") > 0
    ~Sub 1.25 from XPos("Player")

    Right("Counter") > 0
    ~Add 1.25 from XPos("Player")

    "Right Detector" is overlapping a backdrop
    "Player Hitbox" is overlaying a backdrop
    ~Sub 1.25 from XPos("Player")

    "Left Detector" is overlapping a backdrop
    "Player Hitbox" is overlaying a backdrop
    ~Add 1.25 from XPos("Player")

    Always
    ~Set X("Player") to XPos("Player")
    ~Set Y("Player") to YPos("Player")

    Me again. Haha. So here's my dilemma. The above events work for the most part for my platform engine. However, every once in a while, I still find myself stuck within a wall. Is there a way to incorporate fastloops to this so that the hitbox doesn't get stuck on a backdrop?

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    UltimateWalrus's Avatar
    Join Date
    Jul 2006
    Posts
    825
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It looks to me like the problem is here:

    "Right Detector" is overlapping a backdrop
    "Player Hitbox" is overlaying a backdrop
    ~Sub 1.25 from XPos("Player")

    "Left Detector" is overlapping a backdrop
    "Player Hitbox" is overlaying a backdrop
    ~Add 1.25 from XPos("Player")
    You're trying to detect if the player has moved onto a backdrop... except you haven't actually moved the player anywhere yet. Keep in mind that events get executed in order.

    You could try this:


    Start of Frame
    ~Set XPos("Player") to X("Player")
    ~Set YPos("Player") to Y("Player")

    Left("Counter") > 0
    ~Sub 1.25 from XPos("Player")

    Right("Counter") > 0
    ~Add 1.25 from XPos("Player")

    Always
    ~Set X("Player Hitbox") to XPos("Player")
    ~Set Y("Player Hitbox") to YPos("Player")
    ~Set X("Right Detector") to XPos("Player")
    ~Set Y("Right Detector") to YPos("Player")
    ~Set X("Left Detector") to XPos("Player")
    ~Set Y("Left Detector") to YPos("Player")



    "Right Detector" is overlapping a backdrop
    "Player Hitbox" is overlaying a backdrop
    ~Sub 1.25 from XPos("Player")

    "Left Detector" is overlapping a backdrop
    "Player Hitbox" is overlaying a backdrop
    ~Add 1.25 from XPos("Player")

    Always
    ~Set X("Player") to XPos("Player")
    ~Set Y("Player") to YPos("Player")



    It depends on your game but I might recommend ditching the right/left detectors altogether and just nudging the player collider to "feel around" for obstacles. Detectors are useful in certain situations but for a simple platform movement I feel they're overkill and overcomplicate things tremendously... I don't know why their use is so widespread (I think it has something to do with people thinking of a game as actual physical objects rather than what it is, a computer program).

Similar Threads

  1. Moving Platforms under Floating Point Movement?
    By N64Mario in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 10th February 2010, 06:18 AM
  2. Stuck on fast loops in floating point movement.
    By N64Mario in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 29th July 2009, 04:54 AM
  3. Static Platform Under Floating Point Movement?
    By N64Mario in forum Multimedia Fusion 2 - Technical Support
    Replies: 13
    Last Post: 14th July 2009, 09:26 PM
  4. Arrays, fastloops and floating point
    By Tiles in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 11th January 2008, 09:31 AM
  5. [Bug]Floating Point issues
    By xyzzy in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 10th January 2008, 12:13 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
  •