Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 PLEASE HELP
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
lil_li




PostPosted: 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
Sponsor
Sponsor
Sponsor
sponsor
Homer_simpson




PostPosted: Wed May 07, 2003 3:39 pm   Post subject: (No subject)

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




PostPosted: Wed May 07, 2003 4:24 pm   Post subject: (No subject)

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

Locked.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: