Computer Science Canada Programming C, C++, Java, PHP, Ruby, Turing, VB   Username:   Password: Wiki   Blog   Search   Turing   Chat Room  Members
Objects Moving with Different Delays
Author Message
FearSonic

Posted: 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!

shorthair

Posted: Mon Feb 02, 2004 10:00 pm   Post subject: (No 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
Paul

Posted: Mon Feb 02, 2004 10:03 pm   Post subject: (No 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.
FearSonic

Posted: Mon Feb 02, 2004 10:07 pm   Post subject: (No subject)

paulbian.. that is PERFECT! Thanks to both of you though!
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

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