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

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




PostPosted: Sun Apr 18, 2004 12:57 pm   Post subject: Help?

Hi, guys I have one problem with my screensaver.
Code
View.Set ("graphics:400;400,offscreenonly")

var num_Balls : int := 10
var x, y, dx, dy, clr : array 1 .. num_Balls of int

for i : 1 .. num_Balls
x (i) := Rand.Int (50, maxx - 50)
y (i) := Rand.Int (50, maxy - 50)
dx (i) := Rand.Int (-3, 3)
dy (i) := Rand.Int (-3, 3)
clr (i) := Rand.Int (1, 200)
end for

loop

exit when hasch
cls

for i : 1 .. num_Balls

x (i) := x (i) + dx (i)
y (i) := y (i) + dy (i)

if x (i) < 50 or x (i) > maxx - 50 then
dx (i) := -dx (i)
end if
if y (i) + dy (i) < 50 or y (i) + dy (i) > maxy - 50 then
dy (i) := -dy (i)
end if

drawfilloval (x (i), y (i), 50, 50, clr (i))
drawfilloval (x (i) - 20, y (i) + 20, 10, 10, black)
drawfilloval (x (i) + 20, y (i) + 20, 10, 10, black)
drawarc (x (i), y (i), 40, 40, 180, 350, black)

end for

View.Update
delay (10)

end loop

There is too many balls that around the screen, but my question is how I do this when one ball touch the y value then other ball appear and then ball touch the x value then one more ball appear.
Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Sun Apr 18, 2004 1:05 pm   Post subject: (No subject)

3 things:
first: don't put the subject of your post as "Help?". Your posting in the turing help section, we know you want help. Wink giving it an effective title just helps to keep things clean around here.

second: use the code tags when posting code. type this:
[ code ] put your code here [ /code]
only without the spaces.

third: I'm not exactly sure what you are asking.

Alexx wrote:
how I do this when one ball touch the y value then other ball appear and then ball touch the x value then one more ball appear.


wha? Eh what do you mean by y value and x value? y and x value of what? another ball? or the wall? Thinking
gamer




PostPosted: Sun Apr 18, 2004 1:07 pm   Post subject: (No subject)

ya man if u want people to help u gota be more specific then that
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: