Wolfy87
Aug 14 2008, 02:08 PM
I am making a virtual gun range were the wind Dir and Speed vary (Forward Left Right Backward Wind) (0,1,5 mph Speed) So i need to randomize between them which inturn selects different types of offet curser and you have to compensate for it so can anyone help?????
Wolfy87
Aug 14 2008, 02:54 PM
Also How would i go about puting in a timer and a score counter i.e Miss = +0, Outer Rim = +1 and Inner Rim = +2? Thanks, Ollie
groovicus
Aug 14 2008, 04:57 PM
What language are you using, c#, c++..??
Wolfy87
Aug 14 2008, 05:08 PM
ok now im typeing on my psp coz i had to come off my computer (sniff sniff:'(...) lol. anyway, forget about the timer and score bit coz i worked that one out my self

but i still need to know how to randomize the wind dir and speed. i will gladly send you the finished program (if i can work out how -.-) if you or any one can help. actually is there anyway of putting it as a download in this forum poast coz i could do that when its done

. Btw im 14...just thought id say lol. Thanks, Ollie
Wolfy87
Aug 14 2008, 05:10 PM
QUOTE(groovicus @ Aug 14 2008, 09:57 PM)

What language are you using, c#, c++..??
I think it is C#
Wolfy87
Aug 14 2008, 05:25 PM
i just checked and it said Visual Basic and then underneath it had Visual C# and Visual C++ so im sorta confused
Wolfy87
Aug 14 2008, 05:30 PM
but the 2 C's wer seperate downlnads to the visual basic download. and sorry about spamming this forum -.-
groovicus
Aug 14 2008, 05:37 PM
There is an edit button that you could use instead of making multiple posts.
All programming languages have functions of one sort or another for generating random numbers. In your first case, wind direction, you want to generate a random number from 1 to 5, (or 0 to 4, whichever). Which ever number comes up will then correspond to a wind direction. Wind speed can be randomized the same way.
C#C++
Wolfy87
Aug 14 2008, 05:50 PM
Ah...i see, by corrosponding a number to a image and using something like the PickOne function i can make it choose one at random. Also after compairing both of your links i have realised that i am definately using C#. Thank you.
Wolfy87
Aug 14 2008, 06:21 PM
could you do an example snippet just to get me going?
groovicus
Aug 14 2008, 06:34 PM
Those two links I gave you have exactly the code you need. We don't write code for others, but we are happy to help you with your code once you have given it a try. Once you generate your random number, then you just need to use some if-statements to evaluate what is going to happen. For example, if randNum=0, then windspeed = 0;
Wolfy87
Aug 14 2008, 06:40 PM
Thank you so much but im stuck on a few more things, how do i assign curcers manually i.e,
Private
PictureBox2.Curcer = (c:Desktop\Programming\Projects\VRange\0,C.cur...
is it that simple or am entierly wrong?
And also, I tryed the code that you provided for C# and i just cannot get it to work what am i doing wrong i put what it said but it just underligned everything with blue??? and it dose not recognise the command "Random"...:S I rely dont have a clue how to implement it, sorry.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.