Computer Science Canada Programming C, C++, Java, PHP, Ruby, Turing, VB   Username:   Password: Wiki   Blog   Search   Turing   Chat Room  Members
drawing ovals with arrays
Author Message
Schaef

Posted: Sun Jan 25, 2004 8:52 pm   Post subject: drawing ovals with arrays

Is it possible to make an array and make it so that each variable can draw an oval that I would be able to move across the screen?

Delos

Posted: Sun Jan 25, 2004 9:11 pm   Post subject: (No subject)

I don't quite get what you're saying...

...but you could do this:

 code: type coord: record x : int y : int end record var test : array 1..20 of coord

Then, you'd just use some maths to assign the coordinates for each variable, then draw an oval using each ref-point.

Or you could use 1 oval, and just calculate its co-ordinates at each point of the screen.
You'll need cosd and sind for that.
Boarder16

Posted: Sun Jan 25, 2004 9:20 pm   Post subject: (No subject)

i don't follow what u mean?? do u mean 1 oval mobin across teh screen and its variables in an array?? or multiple ovals??
shorthair

Posted: Sun Jan 25, 2004 9:22 pm   Post subject: (No subject)

i would just make a decresing loop of hte y coordinate ,and a decreasing loop for the x coordinate , that way it would move donw the screen , what is the bigger picture for this program , so i know what im trying to make , id liketo help but i dont understand the situation
Schaef

Posted: Sun Jan 25, 2004 9:35 pm   Post subject: (No subject)

sry.. i didnt explain it well. i just started to use arrays recently. I am trying to make a small explosion. I need a whole bunch of dots to go out in different directions at the same time.
Delos

Posted: Sun Jan 25, 2004 9:43 pm   Post subject: (No subject)

http://www.compsci.ca/v2/viewtopic.php?t=3228&highlight=explosion

Heheehe.

As soon as I figure out how he Catalyst did it...I'll tell you...lol.
Schaef

Posted: Sun Jan 25, 2004 9:45 pm   Post subject: (No subject)

ya.. ive seen his code b4.. i cant understand how he did it.. im working on my own crappy version though. lol
Delos

Posted: Sun Jan 25, 2004 9:50 pm   Post subject: (No subject)

Don't try understand his code...it's unbelieveable.

I tell ya, that guy is freakin insane!

In a really nice way though...
Schaef

Posted: Sun Jan 25, 2004 10:05 pm   Post subject: (No subject)

im trying to make my own but its not workin at all.. heres the code, someone look at it and tell me what is wrong with it

 code: View.Set ("graphics:max;max, nobuttonbar") randomize var x:array 1..10 of int var y:array 1..10 of int var em:int for exn:1..10 x(exn):=393 y(exn):=262 end for   for exn:1..10 for expl:1..100 randint(em,-1,1) randint(em2,-1,1) drawdot (x(exn), y(exn), 16) delay(10) drawdot (x(exn), y(exn), 0) x(exn):=x(exn)+em y(exn):=y(exn)+em end for end for
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

Page 1 of 1  [ 9 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: