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

Username:   Password: 
 RegisterRegister   
 drawing ovals with arrays
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Schaef




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




PostPosted: 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




PostPosted: 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




PostPosted: 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




PostPosted: 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




PostPosted: 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




PostPosted: 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




PostPosted: 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... Wink
Sponsor
Sponsor
Sponsor
sponsor
Schaef




PostPosted: 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:   
   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  [ 9 Posts ]
Jump to:   


Style:  
Search: