Author |
Message |
Schaef
![](http://www.interstudio.co.uk/79142.gif)
|
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? |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Delos
![](http://www.members.shaw.ca/rfolz/delos_avatar.gif)
|
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. |
|
|
|
|
![](images/spacer.gif) |
Boarder16
![](http://members.lycos.co.uk/paulbian/floppy.gif)
|
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?? |
|
|
|
|
![](images/spacer.gif) |
shorthair
![](http://www.members.shaw.ca/rfolz/domo-kun.jpg)
|
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 |
|
|
|
|
![](images/spacer.gif) |
Schaef
![](http://www.interstudio.co.uk/79142.gif)
|
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. |
|
|
|
|
![](images/spacer.gif) |
Delos
![](http://www.members.shaw.ca/rfolz/delos_avatar.gif)
|
|
|
|
![](images/spacer.gif) |
Schaef
![](http://www.interstudio.co.uk/79142.gif)
|
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 |
|
|
|
|
![](images/spacer.gif) |
Delos
![](http://www.members.shaw.ca/rfolz/delos_avatar.gif)
|
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... ![Wink Wink](http://compsci.ca/v3/images/smiles/icon_wink.gif) |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Schaef
![](http://www.interstudio.co.uk/79142.gif)
|
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
|
|
|
|
|
|
![](images/spacer.gif) |
|