Computer Science Canada Rand Ball proggy help plz |
Author: | Lazarus [ Tue Apr 19, 2005 11:57 am ] | ||
Post subject: | Rand Ball proggy help plz | ||
k, I'm sure anyone of you could get this done in a few seconds, but I have a brain cramp, so no matter what I do it's not working properly, I know I have to get it to choose weither it will be positive or negative a rand. But I'm confuzzled, here's what I got:
|
Author: | Martin [ Tue Apr 19, 2005 12:15 pm ] |
Post subject: | |
I'm not entirely sure what you're trying to do. Do you mean that you want it to start moving in a random direction from a random point on the screen? |
Author: | Lazarus [ Tue Apr 19, 2005 12:20 pm ] |
Post subject: | |
Completely Random, Start at a Random point, move to a random location, then move from that location to an other Random location. All I need to do is find out how to make it decide weither or not it to be positive or negative, and it cannot go off the screen. |
Author: | Martin [ Tue Apr 19, 2005 12:27 pm ] |
Post subject: | |
Type Rand.Int and press F10. You'll want to generate 4 numbers: the start x and y location, and the end x and y location. Then figure out the slope of the line connecting the two points (remember grade 9?) and you're set. |
Author: | Lazarus [ Tue Apr 19, 2005 12:29 pm ] |
Post subject: | |
This does not help, because it will not be completely Random. |
Author: | Martin [ Tue Apr 19, 2005 12:39 pm ] |
Post subject: | |
I don't understand what you mean by completely random. Like, you want it to just shake around on the screen? |
Author: | Lazarus [ Tue Apr 19, 2005 12:41 pm ] | ||
Post subject: | |||
Yep yep, but I got it, my brain cramp left me lol
now all I have to do is make a boundry so it doesn't go off the screen, how would I? |
Author: | Martin [ Tue Apr 19, 2005 12:53 pm ] | ||
Post subject: | |||
|