Simulating Gravity (Or Any Attractive Force)

Tutorials Shared by the Internet Community


  Top Tutorials     New Tutorials     Submit     Login     Register  

Simulating Gravity (Or Any Attractive Force)

This tutorial shows you how to simulate an attractive force like gravity between two objects like planets.
  • Total Hits: 18464

  • Average Rating :
    URL RatingURL RatingURL RatingURL RatingURL Rating


  • Total Votes: 149 votes

  • Category: Flash/Math & Physics

  • Submitted on: 2008-04-02 11:21:41

  • Submitted By: Devesh Khanna

  • Set as Favorite


Here are the steps I took to make this.

1. I created a sun movieclip and an earth movieclip and placed them on the stage with instance names ball1 and ball2 respectively.
2. I used FlashGuru's function that determines the distance between two movieclips and returns a distance object (with a slight modification).
3. Using the info in the distance object I determined what the velocities and accelerations of the bodies.    More detail...

Rating Detail

 Stars  Percentage  Total Vote
 One star  Vote LeftVote MiddleVote Right 37.58%  56
 Two starsTwo star  Vote LeftVote MiddleVote Right 10.74%  16
 Three starsThree starsThree stars  Vote LeftVote MiddleVote Right 12.08%  18
 Four starsFour starsFour starsFour stars  Vote LeftVote MiddleVote Right 11.41%  17
 Five starsFive starsFive starsFive starsFive stars  Vote LeftVote MiddleVote Right 28.19%  42

Caste Your Vote

 Rating  Selection  Guidelines
 Poor:     Very disappointing, useless.
 Fair:     Below average, disappointing but not useless.
 Good:     About average in its class.
 Very Good:     Above average for its category.
 Excellent:     One of the best Tutorials in its category.