0 Favourites

Custom speed acting weird

  • Problem Description

    custom movement behavior gets stuck at 200.00000000000003

    Attach a Capx

    Project

    Description of Capx

    this cap shows you the overall speed of the arrow

    Steps to Reproduce Bug

    • Step 1 turn player to a diagonal angle
    • Step 2 accelerate player to maximum speed
    • Step 3 when player reaches maximum speed turn around and try to accelerate another way

    Observed Result

    the speed seems to get stuck 200.00000000000003 even though I clearly set it back to 200

    Expected Result

    when it reaches higher then maximum speed it should reset back to 200 allowing the player to move again

    Affected Browsers

    • Chrome: (YES)
    • Internet Explorer: (YES)

    Operating System and Service Pack

    Windows 10

    Construct 2 Version ID

    212.2 and beta r214

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Hey Shadow, the problem with it is that in event 2 in your movement sheet is asking if the speed is not only less than but also equal to. So you can be at the max speed and that accelerate will still be trigger-able. I know that the event below should set it back to 200 (but there really is not much difference between 200 and 200.00000000000003).

    In event 4, switch the else action to set speed to 199 instead of 200 and it works as intended (it just doesn't look pretty).

  • Closing as not a bug: as GenkiGenga says, you allow acceleration when the speed is exactly equal to 200, allowing it to accelerate slightly beyond. Even with that though, you should not expect the speed to exactly equal 200. See "Expecting math calculations to be exact" in common mis-used events and gotchas.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
0 Favourites
Internet Speed Test
56 14,201
Havok's avatar
Havok

You do not have permission to view this topic

Unread hot topic
0 Favourites
Animation Speed
49 4,937
kayin's avatar
kayin