How do I set sprite to move in direction of mouse

Get help using Construct 2

Post » Sat Mar 08, 2014 3:26 pm

How do I set sprite to move in direction of mouse and with speed according to distance between mouse and tank.
Banned User
B
33
S
6
G
5
Posts: 116
Reputation: 6,445

Post » Sat Mar 08, 2014 3:45 pm

You can get the mouse position with Mouse.x and Mouse.y, the distance with the distance function distance(sprite.x, sprite.y, mouse.x, mouse.y).
B
40
S
15
G
5
Posts: 295
Reputation: 6,129

Post » Sun Mar 09, 2014 11:48 am

@Joskin Is there any list of all functions like that in Construct 2
Banned User
B
33
S
6
G
5
Posts: 116
Reputation: 6,445

Post » Sun Mar 09, 2014 11:53 am

B
40
S
15
G
5
Posts: 295
Reputation: 6,129

Post » Sun Mar 09, 2014 12:02 pm

@Joskin Thanks a lot
Banned User
B
33
S
6
G
5
Posts: 116
Reputation: 6,445

Post » Sun Mar 09, 2014 12:46 pm

Ashesh wrote:@Joskin Is there any list of all functions like that in Construct 2

You are a Manual graduate. Haven't you read the system references already?
I will not let you reach the sisters
Nature Forums
B
11
S
5
G
2
Posts: 496
Reputation: 2,306

Post » Mon Mar 10, 2014 7:32 am

I left that part as continued reading.
Banned User
B
33
S
6
G
5
Posts: 116
Reputation: 6,445


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 7 guests