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
 
I think it's easist first to watch a short vidio clip I find these videos very relaxing to watch .. I got to thinking is this being done in the most efficient way? The sand has to be suspended in the water to move it to the outlet ... The faster the water , the more turbulance and the sand stays suspended, so it seems to me the rule of thumb is the hose be aimed towards the outlet at all times .. Many times the workers hit the sand directly which will greatly reduce the water...
comparing a flat solar panel of area 2π r² and a hemisphere of the same area, the hemispherical solar panel would only occupy the area π r² of while the flat panel would occupy an entire 2π r² of land. wouldn't the hemispherical version have the same area of panel exposed to the sun, occupy less land space and can therefore increase the number of panels one land can have fitted? this would increase the power output proportionally as well. when I searched it up I wasn't satisfied with...
Back
Top