Computer Science Canada Programming C, C++, Java, PHP, Ruby, Turing, VB   Username:   Password: Wiki   Blog   Search   Turing   Chat Room  Members
Help?
Author Message
Alexx

Posted: 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.

Cervantes

Posted: 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. 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? what do you mean by y value and x value? y and x value of what? another ball? or the wall?
gamer

Posted: 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: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

Page 1 of 1  [ 3 Posts ]
 Jump to:  Select a forum  CompSci.ca ------------ - Network News - General Discussion     General Forums   -----------------   - Hello World   - Featured Poll   - Contests     Contest Forums   -----------------   - DWITE   - [FP] Contest 2006/2008   - [FP] 2005/2006 Archive   - [FP] 2004/2005 Archive   - Off Topic     Lounges   ---------   - User Lounge   - VIP Lounge     Programming -------------- - General Programming     General Programming Forums   --------------------------------   - Functional Programming   - Logical Programming   - C     C   --   - C Help   - C Tutorials   - C Submissions   - C++     C++   ----   - C++ Help   - C++ Tutorials   - C++ Submissions   - Java     Java   -----   - Java Help   - Java Tutorials   - Java Submissions   - Ruby     Ruby   -----   - Ruby Help   - Ruby Tutorials   - Ruby Submissions   - Turing     Turing   --------   - Turing Help   - Turing Tutorials   - Turing Submissions   - PHP     PHP   ----   - PHP Help   - PHP Tutorials   - PHP Submissions   - Python     Python   --------   - Python Help   - Python Tutorials   - Python Submissions   - Visual Basic and Other Basics     VB   ---   - Visual Basic Help   - Visual Basic Tutorials   - Visual Basic Submissions     Education ----------- - Student Life   Graphics and Design ----------------------- - Web Design     Web Design Forums   ---------------------   - (X)HTML Help   - (X)HTML Tutorials   - Flash MX Help   - Flash MX Tutorials   - Graphics     Graphics Forums   ------------------   - Photoshop Tutorials   - The Showroom   - 2D Graphics   - 3D Graphics     Teams ------ - dTeam Public

 Style: Appalachia blueSilver eMJay subAppalachia subBlue subCanvas subEmjay subGrey subSilver subVereor Search: