Smoothly add 64px to players position.

Get help using Construct 2

Post » Wed Jul 25, 2012 4:19 am

So this seems like a simple idea. I have a tile based design, and I need to move my player in increments of 64px. But I'd like it to be a smooth transition. I thought about using lerp for this, but couldn't figure out what to do. Could someone help me out?
B
16
S
3
G
5
Posts: 43
Reputation: 3,875

Post » Wed Jul 25, 2012 4:44 am

There's an example of smooth grid movement in the FAQ. Have a look there first, see if it's what you're looking for.
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Wed Jul 25, 2012 4:58 am

You could either use a plugin like Lerp, or you could use something like this:

Every Tick --> While Player.Moving --> Player.x + (64 * dt)

Every tick/fraction of a second, you can check for a player's moving boolean and move the x value however much you want (the dt is for framerate independency) and then check for when the player reaches his next tile destination to stop his movement.
B
19
S
5
G
1
Posts: 104
Reputation: 2,920

Post » Wed Jul 25, 2012 5:50 am

B
38
S
8
G
3
Posts: 438
Reputation: 6,869

Post » Wed Jul 25, 2012 10:47 pm

My game have the same 'system', tile based with 64px and I'm 'move at angle' to make it runs smoothly 64px ahead.
B
30
S
6
G
5
Posts: 433
Reputation: 6,061

Post » Thu Jul 26, 2012 4:37 pm

How are you guys handling collision?
B
16
S
3
G
5
Posts: 43
Reputation: 3,875


Return to How do I....?

Who is online

Users browsing this forum: badmoodtaylor, Megavolt, Yahoo [Bot] and 8 guests