How do I make sprite imitate other sprite after x seconds?

Get help using Construct 2

Post » Sun Oct 25, 2015 10:05 pm

Hi,
I am currently making a platformer game.
I want Sprite B to copy Sprite A's movement after 0.25 seconds
Currently, I have given platformer behaviour to both of them.
but on Sprite B, I've put when key is down, wait 0.25seconds, then move.
However, for some reason, Sprite B move a little bit less and a little bit more than Sprite A.
Is there a way for Sprite B to copy Sprite A's movement after 0.25 seconds exactly?

I've been trying days to figure this one out :(
I would very much appriate it if anyone could give me a hand :)
B
3
Posts: 4
Reputation: 183

Post » Tue Oct 27, 2015 2:02 pm

I was able to get it to work using platformer enable/disable.

I made a keyboard event of any-key-pressed and set action 1 as sprite 2 platformer disabled, then a wait of 0.25, then a sprite 2 platformer enabled.

I am not sure what your trying to do exactly but it seemed to work like you described. You could change the any-key-pressed to whatever trigger you needed or set it up for each separate keypress.
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
70
S
19
G
8
Posts: 639
Reputation: 9,674

Post » Tue Oct 27, 2015 5:42 pm

Hi,
Thank you for your reply.
However, I think you misunderstood my question.
I will try to explain it more clearly.

This is the example of what I want to achieve.
Please watch around 10:28 mark
https://youtu.be/sRrWu9wU4JA

Just like how dogs follow the main character.
I would like to recreate that.
Looking forward to hear from you.
Thanks.
B
3
Posts: 4
Reputation: 183

Post » Tue Oct 27, 2015 7:55 pm

In summary, You want to make a follower.
https://www.scirra.com/forum/viewtopic.php?f=147&t=162256&p=983233&hilit=follower#p983233 and some other thread on the forum could help
Image Image
B
25
S
14
G
139
Posts: 876
Reputation: 72,510

Post » Tue Oct 27, 2015 9:17 pm

Try using the lerp feature if you want to make a follower? I am not certain this will work, but it might work...
B
5
S
1
Posts: 86
Reputation: 571

Post » Tue Oct 27, 2015 9:48 pm

That looks exactly like how mine looked when I tested it this morning if the sprite-B was also evented to move to sprite-A until overlap if no buttons are pressed...
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
70
S
19
G
8
Posts: 639
Reputation: 9,674

Post » Wed Oct 28, 2015 9:12 pm

Hey toy for the replay guys.
Chrisinfinger, can you share the project file with me? for some reason I am not getting the result you are saying.
Sprite B does move after 0.25 seconds but it does not travel the same distance as Sprite A.
Also, since it is a platformer game, It is more than just X position. When Sprite A jumps, then Sprite B should jump at the Positon as Sprite A jumped from and follow sprite A's jumping trail in order to sync with Sprite A's movement.

Phantomumboxing, tried Lerp but it wasn't the result I was looking for. Thanks anyway.

MadSpy, I've played with your snakey project and it looks really great. However, is there a way to apply animation to the body of the snake? based on my assessment of your conditions, body sprites are repeatedly created and destoried.

I look forward to hearing from you.
Thanks
B
3
Posts: 4
Reputation: 183

Post » Mon Nov 02, 2015 4:34 pm

Does anyone else have any suggestions?
I would very much appreciate it
B
3
Posts: 4
Reputation: 183


Return to How do I....?

Who is online

Users browsing this forum: kainrazial and 20 guests