Making circle pop up in random areas
Author |
Message |
besomebody
|
Posted: Sun Jan 11, 2009 4:07 pm Post subject: Making circle pop up in random areas |
|
|
Alright, Im making a game with a joystick with turing for my grade ten computer engineering class. Since I've never used turing before I had this class, and we only had a small portion of time to practice using turing, I'm not very knowledgable when using it. I want circles to appear on the screen randomly in 8 possible areas (north, east, south, west, northwest, etc), so that when it pops up, you need to copy the direction with the joystick. Is that possible? If so, I'd be greatly appreciated if you could explain what commands or structures I need to use. Thanks =) |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Tony
|
Posted: Sun Jan 11, 2009 4:12 pm Post subject: RE:Making circle pop up in random areas |
|
|
Rand.Int() will give you a random number. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
besomebody
|
Posted: Sun Jan 11, 2009 4:21 pm Post subject: RE:Making circle pop up in random areas |
|
|
Yes, but the coordinates of the circle needs to be in one of eight possible areas, I cant use that because it will set the variable to any number. I want it to be randomized between the eight possible areas. |
|
|
|
|
|
The_Bean
|
Posted: Sun Jan 11, 2009 4:29 pm Post subject: Re: Making circle pop up in random areas |
|
|
Make an array of the x,y positions of the 8 possible spots, then use Rand.Int to pick a random element from the array. |
|
|
|
|
|
besomebody
|
Posted: Sun Jan 11, 2009 4:34 pm Post subject: RE:Making circle pop up in random areas |
|
|
Alright, thanks =)
And sorry my question was so lame. We literally only had a bit more than a week to practice using Turing. |
|
|
|
|
|
|
|