How do I know angle of drag sprite

Get help using Construct 2

Post » Thu May 28, 2015 11:00 pm

Hello, is it possible to know the angle of a dragged sprite ? I want to associate a particle with a sprite. When the sprite is dragged, I want that the particle is like a "queue" to the sprite, whatever is the sprite angle of motion. Excuse my poor English ! I am not sur to be clear in my explannations...
Regards,
B
7
S
1
Posts: 13
Reputation: 460

Post » Thu May 28, 2015 11:12 pm

You could compare the oldx and oldy with the currentx and currenty every tick..

so give the dragged sprite three instance variables OldX, OldY, Dragangle

DraggedSprite is dragging
--system compare two values: Draggedsprite.OldX is not Draggedsprite.X
or
--system compare two values: Draggedsprite.OldY is not DraggedSprite.Y
> Draggedsprite set Dragangle = angle(Draggedsprite.x,Draggedsprite.y,Draggedsprite.oldX,Draggedsprite.oldy)
> Draggedsprite set oldx = Draggedsprite.x
> Draggedsprite set oldy = Draggedsprite.Y
> Particle set angle = Draggedsprite.DragAngle
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 » Thu May 28, 2015 11:21 pm

Thank you LittleStain !
I will try this.
Have a good day !
B
7
S
1
Posts: 13
Reputation: 460


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 37 guests