# Move Sprite to target on a curve/spiral path

Get help using Construct 2

### » 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
25
S
11
G
5
Posts: 140
Reputation: 5,039

### » 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
36
S
13
G
8
Posts: 318
Reputation: 7,710

### » 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
B
179
S
50
G
207
Posts: 8,720
Reputation: 128,308

### » 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
25
S
11
G
5
Posts: 140
Reputation: 5,039

### Who is online

Users browsing this forum: No registered users and 15 guests