How do I reduce the "sticky-ness"

0 favourites
  • 5 posts
  • I've got a setup with a sprite that has 2 animations: 1 faces right, 1 faces left. The sprite has a Custom Movement behavior & is bound to the layout

    When the right arrow key is Pressed, it plays the animation "FacingRight" (from the beginning).

    When the right arrow key Is Down, the sprite Accelerates 100 at 0 degrees.

    When the left arrow key is Pressed, it plays the animation "FacingLeft" (from the beginning).

    When the left arrow key Is Down, the sprite Accelerates 100 at 180 degrees.

    That's the whole thing: 4 events, 1 sprite, 2 animations, and the behaviors CustomMovement & BoundToLayout.

    Anyway, the resulting effect is that the arrow keys slide the Sprite across the layout. There's a kind of stretchiness to it, like it's being pulled by an invisible rubber band. You hit the arrow key, & it slowly builds up speed as it crosses the screen.

    I like that.

    BUT, when the sprite goes too far to one side (let's say to the right) it kind of sticks to the wall. The longer the sprite is in contact with the layout's boundary, the more time it takes for the Sprite to come back to the other side.

    Anybody know how to tighten this up? I'd still like it to feel like it's being pulled by a rubber band, but by a much thicker & stiffer rubber band. The 4 events posted above should suffice, but I can upload a capx if needed. Thanks in advance

  • Increase the amount by which it accelerates relative to its maximum speed.

    If you add a platform mover, have a look at the difference between the acceleration and the max speed on that for an example of the ratio you'd want to use with the custom movement.

  • Increase the amount by which it accelerates relative to its maximum speed.

    If you add a platform mover, have a look at the difference between the acceleration and the max speed on that for an example of the ratio you'd want to use with the custom movement.

    Thanks for the input. I think I get what you're saying. I tried the Platform Mover behavior & I see the relationship between Max Speed & Acceleration, but it doesn't seem related to the Sprite sticking to the wall.

    Here's the capx to show you what I mean. Move side to side a couple of times to get a feel for it, then touch the wall. The longer you touch it, the longer you're stuck there.

    The rest of the movement is perfect....I just really need to prevent that sticking (or at least reduce it). Thanks again for any help.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here the file fixed:

    https://www.dropbox.com/s/0wr9rra8lrlpl ... fixed.capx

    i replace the 3 beaviors for one phatform beavior. work much better!!

  • Here the file fixed:

    work much better!!

    Thanks, but it completely changed the movement of my sprite....and I really like the movement of my sprite.

    I should have posted earlier: I actually already fixed the problem by creating a wall & stopping the Custom Movement when the sprite is overlapping it.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)