
-----------------------------------
gilbamy
Fri May 26, 2006 11:13 am

bouncing:ball
-----------------------------------
Alright i need some direction with this program okay the bloody ball won't bounce around the screen and how do i do borders so the ball won't go off the screen here is my code oh and i tried using Pic.Free but it would not work i think it is though in my code 
 %Amy Gilbank
%May 18 2006
%bounceball.t
%a progrsm that allows picture to bounce around
var winMain : int := Window.Open ("graphics:800;600")
var pic1, pic1w, pic1h, pic1x, pic1y, x, y, speedx, speedy,backg : int
pic1 := Pic.FileNew ("ball.bmp")
pic1w := Pic.Width (pic1)
pic1h := Pic.Height (pic1)
pic1x := 100
pic1y := 200
speedx := 90
speedy := 80
loop
    backg := Pic.New (pic1x,pic1y, pic1x + pic1w,pic1y - pic1h)
        Pic.Draw (pic1, pic1x, pic1y,picCopy)
     delay (500)
        Pic.Draw ( backg,pic1x, pic1y, picCopy)
                                      if pic1y >= 400 - pic1h or pic1y = 700 - pic1w or pic1x = maxx or ballx - 15 