How do I move a sprite to X with delta time?

Get help using Construct 2

Post » Fri Oct 30, 2015 10:22 am

Hello,
I have two Sprites (A and B). If player is overlapping Sprite B, then this Sprite should be moved soft to X coordinate of Sprite A. How I can do this with delta time? Thanks for help! :)
B
7
S
2
Posts: 84
Reputation: 754

Post » Fri Oct 30, 2015 11:20 am

@wossi

Hello,
Basically the movement would go something like this:

Variable speed = XXXX

if A is overlapping B --> set B.x to Self.x+(A.x-Self.x)*speed*dt
B
67
S
23
G
9
Posts: 166
Reputation: 7,339

Post » Fri Oct 30, 2015 3:00 pm

also look into "lerp" and rex's plugin "move to"
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
33
G
47
Posts: 1,194
Reputation: 30,832

Post » Fri Oct 30, 2015 4:17 pm

RamPackWobble wrote:also look into "lerp" and rex's plugin "move to"


If I might add another suggestion, litetween..
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 » Fri Oct 30, 2015 6:57 pm

@neverk: Fine, that works! :) But. how I can reverse this action?
B
7
S
2
Posts: 84
Reputation: 754

Post » Fri Oct 30, 2015 9:08 pm

@LittleStain - you may... :) (and a darn fine suggestion it would be)
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
33
G
47
Posts: 1,194
Reputation: 30,832


Return to How do I....?

Who is online

Users browsing this forum: David181, evillair, Fenix18, Yahoo [Bot] and 41 guests