How Can I Create Clickable Shapes in a Flash Game?

  • Context: Undergrad 
  • Thread starter Thread starter izikon
  • Start date Start date
  • Tags Tags
    Flash Game
Click For Summary
SUMMARY

The discussion focuses on creating interactive shapes in a Flash game using physics principles. The key concept involves calculating the center of mass and implementing rotational dynamics based on user input. Specifically, the object should rotate around the drag point to align with the direction of the drag, with rotational velocity proportional to drag velocity. The original poster seeks a formula or resource to facilitate this implementation.

PREREQUISITES
  • Understanding of Flash ActionScript 3.0 for game programming
  • Knowledge of physics concepts such as center of mass and rotational dynamics
  • Familiarity with vector mathematics for calculating angles and directions
  • Experience with user input handling in interactive applications
NEXT STEPS
  • Research "Flash ActionScript 3.0 physics libraries" for pre-built solutions
  • Study "Rotational dynamics formulas" to understand angular motion
  • Explore "Vector mathematics in game development" for calculating drag and rotation
  • Look into "Implementing center of mass in Flash games" for practical examples
USEFUL FOR

Game developers, particularly those working with Flash, who are interested in implementing interactive physics-based mechanics in their projects.

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
 

Similar threads

  • · Replies 26 ·
Replies
26
Views
3K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 6 ·
Replies
6
Views
4K
Replies
6
Views
2K
  • · Replies 52 ·
2
Replies
52
Views
4K
  • · Replies 4 ·
Replies
4
Views
3K
Replies
8
Views
2K
Replies
10
Views
2K
Replies
1
Views
3K