Computer Science Canada

It bounces and bounces and bounces and doh!!! it stopped =Þ

Author:  Homer_simpson [ Fri Apr 25, 2003 7:42 pm ]
Post subject:  It bounces and bounces and bounces and doh!!! it stopped =Þ

code:
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...?!!!

Author:  Prince [ Fri Apr 25, 2003 7:50 pm ]
Post subject: 

a physics book might help ya Razz

Author:  Homer_simpson [ Fri Apr 25, 2003 7:54 pm ]
Post subject: 

i dont have a physic book and i'm not planning to buy one... =(
i thought there might be a website or something... =/

Author:  Blade [ Fri Apr 25, 2003 8:00 pm ]
Post subject: 

again... catalyst.... or tony.... they're awesome at physics (i havent taken physics yet...Sad but i dont think catalyst has either, he's only in grade 10... he's just a damned genius)

Author:  Homer_simpson [ Fri Apr 25, 2003 8:21 pm ]
Post subject: 

code:
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

Author:  Homer_simpson [ Fri Apr 25, 2003 8:31 pm ]
Post subject: 

better yet
code:
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

Author:  Homer_simpson [ Fri Apr 25, 2003 11:53 pm ]
Post subject: 

guess this is another way of explaining bouncing
code:
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 <= x2 then
        if y >= y1 and y <= y2 then
            result true
        end if
    end if
    result false
end mouseover

loop
    mousewhere (mousex, mousey, mouseb)
    drawbox (mousex - 10, mousey - 40, mousex, mousey + 40, 9)
    drawfilloval (x, y, 10, 10, 9)
    View.Update
    delay (1)
    cls
    case dirx of
        label true :
            x += 2
        label false :
            x -= 2
    end case
    case diry of
        label true :
            y -= 1
        label false :
            y += 1
    end case
    if x >= 630 or x <= 0 then
        dirx := not dirx
    end if
    if y >= 390 or y <= 0 then
        diry := not diry
    end if

    if mouseover (x, y, mousex - 10, mousey - 40, mousex, mousey + 40) then
        dirx := not dirx
    end if
    if mouseover (x, y, mousex - 10, mousey - 40, mousex, mousey + 40) then
        diry := not diry
    end if


end loop

Author:  Tony [ Fri Apr 25, 2003 11:54 pm ]
Post subject: 

good... now make pong Very Happy

Author:  Homer_simpson [ Sat Apr 26, 2003 12:01 am ]
Post subject: 

pong sux and it's too easy to make i cant believe a stupid online game of pong won a prize at the contest at http://ooturing.psychz.net/ even i could have done better

Author:  Tony [ Sat Apr 26, 2003 12:13 am ]
Post subject: 

well considering they have about just 5 users.. its good for them that they got something submited Shocked

Author:  Catalyst [ Sat Apr 26, 2003 12:13 am ]
Post subject: 

pong didnt win ne thing there, tho a physics sim did

Author:  jamez [ Sat Apr 26, 2003 8:32 am ]
Post subject: 

Homer dont be such an ass, especially when you have no idea of what you are talking about.

Catalyst won it with his f00kin awesome 3d space shooter type game, "Solar Blue". It r0x.

Author:  Homer_simpson [ Sat Apr 26, 2003 11:29 am ]
Post subject: 

Hey dont be so critical james u jackass!!! so i thought that pong won... that doesn't make an ass Mad

Author:  Homer_simpson [ Sat Apr 26, 2003 11:31 am ]
Post subject:  Catalyst help!!!!

Catalyst
catalyst do u know any other websites that are like this one(http://hem.passagen.se/olle2/programmering.htm) with all those formulas documented in it?!

Author:  Tony [ Sat Apr 26, 2003 1:50 pm ]
Post subject: 

Catalyst - I hope you'll be uploading your game here soon. I'd love to see it. 8)

Author:  Prince [ Thu May 01, 2003 9:57 am ]
Post subject: 

omg they made a turing verison of contra Shocked ... classic nintendo games rule!! Very Happy

Author:  Catalyst [ Thu May 01, 2003 12:33 pm ]
Post subject: 

the contra game isnt too good tho its pretty much a walking/jumpng graphics demo

Author:  Prince [ Thu May 01, 2003 5:30 pm ]
Post subject: 

ohh thats it Sad ... wat a disappointment Crying or Very sad


: