- Home
- Tutorials
- Flash
- Intermediate
- Balls chain with constraints, colision, mouse follow and the math needed

Take a look to the tutorial goal
Alejandro Quarto
Partner, Software Development/General Manager at Persuasive Games. In his role, Mr. Quarto is responsible for software development and testing, as well as studio management and strategy.
Prior to joining to Persuasive Games, Mr. Quarto started his career in interactive entertainment as a freelance programmer using different object-oriented programming tools specifically specializing in Macromedia Flash, Shockwave, and Java development platforms among others. In 2002 Mr. Quarto co-founded Platico Games! in Buenos Aires, Argentina. While at Platico Games Studio, Mr. Quarto produced a wide variety of video game projects including: advergames, educational games, and multiplayer games oriented to big communities.
These games have been developed for clients such as: Claxson Interactive Group, Budweiser, Mattel, Turbo Video Brazil, Canal 13 (TV) Argentina, and FM HIT in Chile.Â
Quarto is currently teaching about Flash development, in an institute located in Buenos Aires. In his role as instructor, he teach how to develop webs and games, for online content. Personal Blog: http://www.alejandroquarto.com
In my first tutorial, i will try to explain a simple example. Sorry about my english and if you want to see all of this in spanish, you can try in my personal blog www.alejandroquarto.com.
Note: possibly, this is not the best way to do it, you can always improve my code. Anyway i want to keep it simple for learning, for those that are not the best coders in the world and that may want to get nice results in a few hours.
This is one of the possible results that you can get by doing this tutorial:
Basically we have a chain composed with an X amount of balls. The first one is always following the mouse pointer, then one after the other, will follow the next ball.
It seems simple, anyway, the complex part in this example is to be able to handle all the balls collision. So, we have to detect overlapping between balls and try to correct each position.
We will need to calculate distance between points for a lot of things in this example, so first, let's try to extend the Math class by adding some new useful methods. This will help you in the future, and you will avoid to re write functions in all your developments


