
-----------------------------------
Homer_simpson
Fri Apr 25, 2003 7:42 pm

It bounces and bounces and bounces and doh!!! it stopped =Ãž
-----------------------------------
procedure jspeed (var s : real, i, ii : int)
    var x, y : real
    %s := sqrt ((i ** 2) - (ii ** 2))
    s := ((- ((ii / i) ** 2)) + 100)
end jspeed

var y := 0.0
var bouncability := 10
colorback (16)
View.Set ("offscreenonly")
for decreasing b : 100 .. 10 by bouncability
    for i : -b .. b
        jspeed (y, 10, i)
        drawfilloval (320, round (y) + 200 - (100 - b), 10, 10, 9)
        drawline (0, 190, 640, 190, 12)
        View.Update
        delay (1)
        cls
    end for
end for
ok here's a bounce formula i've just made up doe's anyone know where i can get the physic formulas like gravity ,speed, acceleration,etc...?!!!

-----------------------------------
Prince
Fri Apr 25, 2003 7:50 pm


-----------------------------------
a physics book might help ya :P

-----------------------------------
Homer_simpson
Fri Apr 25, 2003 7:54 pm


-----------------------------------
i dont have a physic book and i'm not planning to buy one... =(
i thought there might be a website or something... =/

-----------------------------------
Blade
Fri Apr 25, 2003 8:00 pm


-----------------------------------
again... catalyst.... or tony.... they're awesome at physics (i havent taken physics yet...:( but i dont think catalyst has either, he's only in grade 10... he's just a damned genius)

-----------------------------------
Homer_simpson
Fri Apr 25, 2003 8:21 pm


-----------------------------------
procedure jspeed (var s : real, i, ii : int)
    var x, y : real
    %s := sqrt ((i ** 2) - (ii ** 2))
    s := ((- ((ii / i) ** 2)) + 100)
end jspeed

var y, x, x2 := 0.0

var bouncability := 10
colorback (16)
cls
View.Set ("offscreenonly")
for decreasing b : 100 .. 10 by bouncability
    for i : -b .. b by 5
        jspeed (y, 10, i)
        if i > 0 then
            jspeed (x, 10, i)
        else
            jspeed (x, 10, -i)
        end if
        x2 += x div 30
        drawfilloval (round (x2), round (y) + 200 - (100 - b), 10, 10, 9)
        drawdot (round (x2) - 11, round (y) + 200 - (100 - b) - 11, 15)
        drawline (0, 190, 640, 190, 12)
        View.Update
        delay (10)
        drawfilloval (round (x2), round (y) + 200 - (100 - b), 10, 10, 16)
    end for
end for

alittle more enhanced one

-----------------------------------
Homer_simpson
Fri Apr 25, 2003 8:31 pm


-----------------------------------
better yet
procedure jspeed (var s : real, i, ii : int)
    var x, y : real
    %s := sqrt ((i ** 2) - (ii ** 2))
    s := ((- ((ii / i) ** 2)) + 100)
end jspeed

var y, x, x2 := 0.0
var xx1, xx2, yy1, yy2 := 0

var bouncability := 10
colorback (16)
cls
View.Set ("offscreenonly")
for decreasing b : 100 .. 10 by bouncability
    for i : -b .. b by 5
        jspeed (y, 10, i)
        if i > 0 then
            jspeed (x, 10, i)
        else
            jspeed (x, 10, -i)
        end if
        x2 += x div 30
        drawfilloval (round (x2), round (y) + 200 - (100 - b), 10, 10, 9)
        xx1 := round (x2) - 11
        yy1 := round (y) + 200 - (100 - b) - 11
        drawdot (round (x2) - 11, round (y) + 200 - (100 - b) - 11, 15)
        drawline (xx1, yy1, xx2, yy2, 12)
        xx2 := xx1
        yy2 := yy1
        View.Update
        delay (10)
        drawfilloval (round (x2), round (y) + 200 - (100 - b), 10, 10, 16)
    end for
end for


-----------------------------------
Homer_simpson
Fri Apr 25, 2003 11:53 pm


-----------------------------------
guess this is another way of explaining bouncing
var x, y := 200
var dirx, diry := true
View.Set ("offscreenonly")
var mousex, mousey, mouseb : int

function mouseover (x, y, x1, y1, x2, y2 : int) : boolean
    if x >= x1 and x = y1 and y = 630 or x = 390 or y 