Setting custom movement speed is not immediate

0 favourites
  • 1 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • I am using the custom movement behaviour to move a sprite. The player can drag the sprite, and when it is released, it starts slowing down using the tween behaviour to reduce the speed of the custom movement until the sprite stops completely. This works fine.

    Under some circumstances, I want to restrict the position of the sprite and stop it immediately if it passes outside certain x and y coordinates. For this I use the linear stepping mode of the custom movement behaviour with the step size set to 1 pixel. On each step (using the On Custom Step event), I compare the position of the sprite to the limits and sets its speed to 0 as soon as it passes outside these borders. This, however, does not work.

    Apparently the custom movement uses the same speed for all steps during one tick, even if the speed is changed during one of the steps. Is this a bug or the intended behaviour? In my opinion, it makes the use of multiple steps per tick a bit less useful. Of course, it can still be used for pushing out of a solid, but it prevents other ways of using this behaviour for pixel perfect movement.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)