2circlingBalls-lua - Corona physics example of body:applyForce()
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


--[[  2circlingBalls-lua - Corona physics example of body:applyForce()
-- Copyright (c) Frank Siebenlist. All rights reserved.
-- The use and distribution terms for this software are covered by the
-- Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php).
-- By using this software in any fashion, you are agreeing to be bound by
-- the terms of this license.
-- You must not remove this notice, or any other, from this software.
-- Corona Game SDK example of how to let two bodies circle each other by applying a continuous, attracting force

The example uses the physics engine, sets gravity to 0, creates two balls separated in the x-direction,
with initial speeds in opposite y-direction.
Thru an enterFrame event handler, an attracting force is continuously applied to both balls with body:applyForce().
The force is normalized over the distance between the two balls
By playing with the initial speed and force factors, you can make the balls spin faster/slower in circles or ellipses
Save this file as "main.lua" in a project directory and load it in the simulator

Enjoy, Frank  (September 23, 2010).