How do I make my movement with inertia

Get help using Construct 2

Post » Thu Jul 17, 2014 11:14 am

Hello. I'm new to Construct.
Tried to make their own movement. Allows you to move a sprite on the horizontal axis from left to right. This is not a problem. But I do not understand how to make a smooth change of direction (light inertia)? :?
Inertia the same as in the standard platformer.
Whatever the object was moving at a constant speed, but changed direction or stay smoothly.
Please tell me how can I solve this problem without the use of behavior platformer.
Image

Sorry for my english
B
2
Posts: 2
Reputation: 404

Post » Thu Jul 17, 2014 11:27 am

You could use lerp (linear interpolation) for this, but you could also program it yourself

Create a global variable speed

on right arrow down - sprite set x to sprite.x+speed

add a subevent

system compare variable speed is less than 10 - add 1 to speed

on left arrow down - sprite set x to sprite.x+speed

add a subevent

system compare variable speed is more than -10 - subtract 1 from speed

X on right arrow down (so inverted statement)
X on left arrow down (so inverted stament)

subevent

system speed is between -10 and -1 - add 1 to speed

system speed is between 1 and 10 - subtract 1 from speed
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Jul 17, 2014 11:59 am

Doesn't the 8Direction behavior already have settings for that, like acceleration, deceleration, etc?
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
15
S
3
G
1
Posts: 329
Reputation: 2,012

Post » Thu Jul 17, 2014 1:19 pm

Thank LittleStain, will experiment

Was wondering how to make the controller without using a standard behavior
B
2
Posts: 2
Reputation: 404


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot] and 12 guests