
-----------------------------------
Aniota
Wed May 28, 2008 6:32 pm

creating random falling asteroids..
-----------------------------------
I want to create falling asteroids(circles), that appear randomly, looped. I have looked up how to create a random integer but i can't seem to be able to make it a variable  and then use that variable when i draw a circle. I am not sure if i am thinking in the wrong direction.

Does anyone know how i would do this?


thanks =)

-----------------------------------
shadowman544
Wed May 28, 2008 7:30 pm

Re: creating random falling asteroids..
-----------------------------------
create a random int between maxx and minx and assign it to the x coordinate create another random loop that with a ranmdom generator for a numbert between say 1 and 100 and if an int of i is greater than say 95 then randomly generate an asteroid at the random, x value given. if this helps then good if not tell me an i will type it out in more detail

-----------------------------------
Aniota
Thu May 29, 2008 11:17 am

Re: creating random falling asteroids..
-----------------------------------
I tried that and it helped, (or maybe i didnt understand what u meant) but then i had some more problems. They started to just spam the screen I figured i needed to put them in arrays.
This is what i have started to do, but to test it and the brackets keep giving errors.  Ack im such a noob >_<

View.Set ("graphics:800;600,offscreenonly")
var xx, y : int 
var a : array 1 .. 800 of int
loop
xx:= Rand.Int (1, 800)
    y:= Rand.Int (1, 600)

if y > 500 then 
for i : 1 .. upper(a)
    if y(i)  