Move Sprite to target on a curve/spiral path

Get help using Construct 2

Post » Sat Feb 16, 2013 12:38 pm

Hi All,

Is their a semi easy way and preferable using easeTween to move a sprite to a target but on a curve/spiral path. Like bejweeled butterflies do when moving to score https://www.youtube.com/watch?v=IuoJsi8imXE

I was thinking I could offset the Y and X by every tick while easetween progress is less than 1. Tried this:
[Code]
Sprite EaseTween progress is between 0.1 & 0.5 | Sprite.X or Target X = Sprite.X + (1*(Sprite.EaseTween.Progress*10))
Sprite EaseTween progress is between 0.5 & 0.9 | Sprite.X or Target X = Sprite.X - (1*(Sprite.EaseTween.Progress*10))
[/code]

Didn't work.

So has anyone else got a solution?
B
24
S
11
G
5
Posts: 140
Reputation: 5,004

Post » Sun Feb 17, 2013 12:57 pm

I wouldn't exactly say that was a curved path....its two separate movements..once they start moving they touch the score HUD then move down to the other box HUD...
Tweening can be done ..even manually like you attempted..you were on the right track for manual tweening.

Try 'moving' your object to the co ordinates but stop short by say 20 or 30 pixels, then do some micro adjustments to close the gap..

Also those butterflies look like they have a slight 'sine' function on them for added movement variation...both horizontal and verticals ..
Try adding those behaviors also and toggling their values at each movement call...
I use sine behaviors for nearly all butterfly or movement tweening ..if you tweak it just right you can get some fantastic smooth movements and random variations....:-) :-) hope that helps...
mystazsea2013-02-17 12:58:33
When in doubt..or you are lost in a Zombie apocalypse or someone is giving you a hard time..Remember one thing..... Read the Construct 2 Manual..it will save your life.:)
B
29
S
11
G
8
Posts: 312
Reputation: 7,333

Post » Sun Feb 17, 2013 2:59 pm

Its pretty easy with a variable.
He has the groups thing, haven't investigated it much tho.
Note: you could do the same thing with Rex's move to plug.

example
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Sun Feb 17, 2013 5:02 pm

Ta Guys, the sine behaviour was the ticket. I wanted a flick at the beginning of the trajectory, and using Sine allowed me to do this.

@Newt that's great example, I thought to use a var to change target :)
B
24
S
11
G
5
Posts: 140
Reputation: 5,004


Return to How do I....?

Who is online

Users browsing this forum: Braus, R0J0hound, shinkan and 25 guests