Mouse Power

» Tue Feb 22, 2011 11:00 am

Hi all my first post, Just started using Construct and I'm liking it. I have an object which rotates towards the mouse pointer and fires a ball when mouse is clicked, Is it possible to fire the ball whith more force based on how far the mouse pointer is from the object. (Less power if close to the object and more power the further away) Any help appreciated Thanks.
B
1
G
1
Posts: 2
Reputation: 429

» Tue Feb 22, 2011 11:46 am

Do you mean as the ball gets further away from the object, make the ball go faster?
B
2
G
1
Posts: 27
Reputation: 504

» Tue Feb 22, 2011 1:27 pm

power = distance(sprite.x,sprite.y,mousex,mousey)
B
173
S
50
G
194
Posts: 8,562
Reputation: 121,360

» Tue Feb 22, 2011 8:11 pm

[quote="Daedalus_95":19d1ak9j]Do you mean as the ball gets further away from the object, make the ball go faster?[/quote:19d1ak9j]
No as the mouse pointer gates further from the object more power.(Like an elastic band the more stretch the more power, Less stretch less power)
B
1
G
1
Posts: 2
Reputation: 429