Computer Science Canada

Objects Moving with Different Delays

Author:  FearSonic [ Mon Feb 02, 2004 9:52 pm ]
Post subject:  Objects Moving with Different Delays

Hey guys, I was wondering if there is a way to objects moving at different speeds accross the screen according to their randomized speed? I have the randomed speed already, but I just need to know how to get it to move at the same time according to the speed. Thanks! Smile

Author:  shorthair [ Mon Feb 02, 2004 10:00 pm ]
Post subject: 

Well what you need to do is make the random vaiable for the speed the change in the y axis , so say teh speed is 2 , well then your movement will be y + 2, but you would want this as a variable


so randint speed ... blah blah blah
loop
delay (100) *** so you can see it move ***
drawfilloval ( 0,y,0,0,0,0)
y =y + speed
exit when y = maxy
end loop



<-- not proper syntax at all but get my point about making the oval variable dependant , i wish i could explain it better , im gonna find you a working program tolearn from , but i just cant explain it right now , i jsut know how to do it

Author:  Paul [ Mon Feb 02, 2004 10:03 pm ]
Post subject: 

Im not sure if it would help you, but you can check my horseracing game at:
http://www.compsci.ca/v2/viewtopic.php?t=3338
This involves moving stuff across the screen at random speeds.

Author:  FearSonic [ Mon Feb 02, 2004 10:07 pm ]
Post subject: 

paulbian.. that is PERFECT! Thanks to both of you though!


: