How do I move sprite to mouse position click?

Get help using Construct 2

Post » Thu Jan 08, 2015 11:30 am

I have an event where when the player uses the right mouse click, my sprite has the bullet behavior enabled and rotates 360 degrees to the mouse x and y position. Then it sets a global variable called goalX to the mouse x position. Then in a separate event where if goalX = my sprite.X it disables the bullet behavior on the player but this doesn't work. Any help on getting this to work would be greatly appreciated!
B
3
Posts: 9
Reputation: 193

Post » Thu Jan 08, 2015 11:39 am

Since you have a bullet behaviour and rotation a chance that the coordinates will ever be exactly the same are somewhat slim. You could do a distance check or somewhat simpler - have the "Is between values" system check with something like GoalX - 10 < Sprite.X < GoalX+10
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

Post » Thu Jan 08, 2015 11:46 am

Ok thank you so much!
B
3
Posts: 9
Reputation: 193


Return to How do I....?

Who is online

Users browsing this forum: Bootfit, OBLIVION and 21 guests