How Can I Create Clickable Shapes in a Flash Game?

  • Thread starter Thread starter izikon
  • Start date Start date
  • Tags Tags
    Flash Game
AI Thread Summary
To create clickable shapes in a Flash game, the key concept involves using the center of mass of the shapes for movement. When a user clicks on a shape, the object should rotate around the drag point to align with the direction of the drag. The rotational velocity of the shape is influenced by how quickly the user drags it. Understanding this requires visualizing a line between the drag point and the center of mass that rotates to match the drag direction. Resources for specific formulas and further programming guidance are sought to implement this functionality effectively.
izikon
Messages
2
Reaction score
0
Hi
i have any idea in physics 'i'm a game programmer who needs help
i have this flash file
http://www.knowingames.com/test_ik_06.swf"
the original idea is that i can click any opint on any shape and it'd move
as in the flash exmple

i have no idea what is the name of this physics action
does anyone know ?
or more importent - where i can find a formula that can teach me how to do this?
 
Last edited by a moderator:
Physics news on Phys.org
Part of the answer is in your example. The small gray dots outside of the shapes represent the center of mass of the shapes. As you drag the object, the line between the point clicked on and the point representing the center of mass tends to line up in the direction you are dragging.

To program it, make the object rotate about the (moving) drag point in the closest direction to make the points line up in the direction you are dragging it. The rotational velocity depends on the drag velocity: the faster you drag it, the faster it rotates.

It's a bit easier to understand if you just forget about the shape and picture a straight line between the drag point and the center of mass that's rotating through the smallest angle possible to match the direction in which you are dragging.
 
Thanks - but the idea is that i want to able to clikc and drag and point of the shape
do you have a resource for a formula that solve the problem i have
 
Back
Top