Page 1 of 1

Mouse Power

PostPosted: Tue Feb 22, 2011 11:00 am
by Goose
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.

Re: Mouse Power

PostPosted: Tue Feb 22, 2011 11:46 am
by Daedalus_95
Do you mean as the ball gets further away from the object, make the ball go faster?

Re: Mouse Power

PostPosted: Tue Feb 22, 2011 1:27 pm
by newt
power = distance(sprite.x,sprite.y,mousex,mousey)

Re: Mouse Power

PostPosted: Tue Feb 22, 2011 8:11 pm
by Goose
[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)