Mouse Power

For questions about using Classic.

Post » 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

Post » 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

Post » Tue Feb 22, 2011 1:27 pm

power = distance(sprite.x,sprite.y,mousex,mousey)
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » 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


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests