News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.

Post Reply  Post Thread 
someone with mad math skills, help please
Author Message
Senior Member

Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #1
RE: someone with mad math skills, help please

I tried it assuming that 'a' was maximum speed, and came up with something different, but not very different than what I already had. Actually it was farther away from my goal.

Here is the curent loop I have, with this change:

function grav_loop()
local my_x,bx=Fl:event_x(),0
local my_y,by=Fl:event_y()-demo_bh,0
local c=math.random(1,255)
local b=math.random(1,balls)
  for i=1,balls do
    local xdistance=math.abs(my_x-ball[i]:x())
    local ydistance=math.abs(my_y-ball[i]:y())
    local distance=math.sqrt(xdistance*xdistance+ydistance*ydistance)
    local speed=1+5/distance
    if distance > 0 then
      if my_x > ball[i]:x() then
      if my_y > ball[i]:y() then

ball is a table of randomly placed circles

EDIT: Actually I kinda like that one too. I'm going to keep it in the mix as stage 3. Thanks.

This post was last modified: 01-23-2008 12:27 PM by mikshaw.

01-23-2008 12:18 PM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Messages In This Thread
RE: someone with mad math skills, help please - mikshaw - 01-23-2008 12:18 PM

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: