Computer Science Canada

PLEASE HELP

Author:  lil_li [ Wed May 07, 2003 3:29 pm ]
Post subject:  PLEASE HELP

ok... right now there is 2 balls on the screen, i can control one of them, but when i move i want them to not touch each other, so i wont erase the other ball with the one i'm controlling. Crying or Very sad

plz give me help examples Wink


here is the program:(DON'T MIND THE EXTRA VARIABLES)




View.Set ("offscreenonly")

var Ax := 100
var Ay := 80
var Rx := 100
var Ry := 140
var Lx := 100
var Ly := 200

var dist : int

var Tx := 300
var Ty := 300



var my, m, xx, yy, x1, x2, y1, y2 : int
var slope, temp, b : real
var colourx := 7

var right : array char of boolean


drawfilloval (Ax, Ay, 20, 20, yellow) %Catch
drawfilloval (Rx, Ry, 20, 20, blue) %Right
drawfilloval (Lx, Ly, 20, 20, brightred) %Left

View.Update


xx := Tx
yy := Ty

var Axchange := 2
var Aychange := 2


loop


Input.KeyDown (right)
if right (KEY_RIGHT_ARROW) then

Axchange := 10

drawfilloval (Ax, Ay, 20, 20, yellow)
delay (50)
drawfilloval (Ax, Ay, 20, 20, colourbg)
View.Update

Ax += Axchange
drawfilloval (Ax, Ay, 20, 20, yellow)
View.Update
end if

if right (KEY_LEFT_ARROW) then

Axchange := 10

drawfilloval (Ax, Ay, 20, 20, yellow)
delay (50)
drawfilloval (Ax, Ay, 20, 20, colourbg)
View.Update

Ax -= Axchange
drawfilloval (Ax, Ay, 20, 20, yellow)
View.Update
end if

if right (KEY_UP_ARROW) then

Aychange := 10

drawfilloval (Ax, Ay, 20, 20, yellow)
delay (50)
drawfilloval (Ax, Ay, 20, 20, colourbg)
View.Update

Ay += Aychange
drawfilloval (Ax, Ay, 20, 20, yellow)
View.Update
end if

if right (KEY_DOWN_ARROW) then

Aychange := 10

drawfilloval (Ax, Ay, 20, 20, yellow)
delay (50)
drawfilloval (Ax, Ay, 20, 20, colourbg)
View.Update

Ay -= Aychange
drawfilloval (Ax, Ay, 20, 20, yellow)
View.Update
end if


end loop

Author:  Homer_simpson [ Wed May 07, 2003 3:39 pm ]
Post subject: 

if u send yer codes i can look at it and might be able to help u =)

Author:  Asok [ Wed May 07, 2003 4:24 pm ]
Post subject: 

Please read our subject line policy at the top of this forum.

Locked.


: