How do I reduce the "sticky-ness"

Get help using Construct 2

Post » Thu Jul 24, 2014 6:29 pm

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.


:arrow: 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
Last edited by miketv on Mon Jul 28, 2014 3:26 pm, edited 1 time in total.
Phase 1: Collect Underpants.
Phase 2: ????
Phase 3: Profit!
B
16
S
5
G
4
Posts: 106
Reputation: 2,450

Post » Thu Jul 24, 2014 7:27 pm

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.
Image
B
27
S
9
G
5
Posts: 488
Reputation: 11,948

Post » Mon Jul 28, 2014 4:11 am

JohnnySix wrote: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.
Phase 1: Collect Underpants.
Phase 2: ????
Phase 3: Profit!
B
16
S
5
G
4
Posts: 106
Reputation: 2,450

Post » Mon Jul 28, 2014 7:23 pm

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

i replace the 3 beaviors for one phatform beavior. work much better!!
B
48
S
9
G
10
Posts: 200
Reputation: 8,263

Post » Mon Jul 28, 2014 9:19 pm

luisgmolina wrote: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.
Phase 1: Collect Underpants.
Phase 2: ????
Phase 3: Profit!
B
16
S
5
G
4
Posts: 106
Reputation: 2,450


Return to How do I....?

Who is online

Users browsing this forum: boybacteria, dop2000, Microbex, richcoz81, totoe and 31 guests