Help needed with horse racing game
Author |
Message |
AParaipan
|
Posted: Mon Jan 09, 2012 9:04 pm Post subject: Help needed with horse racing game |
|
|
Hello!
I am new to this turing world and so i have an assignment to do for my class. Like the subject says i am making a horse racing game. The problem i have is : I dont know how to make the horses move
Can anyone help me ?
i attached the code in here http://uploading.com/files/bc8fdmc2/game.rar/ (click free download box) |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Raknarg
![](http://compsci.ca/v3/uploads/user_avatars/3745510004d8be6689b92f.jpg)
|
Posted: Tue Jan 10, 2012 11:32 am Post subject: RE:Help needed with horse racing game |
|
|
You should fill out the template; tell us everything that you have tried. first. |
|
|
|
|
![](images/spacer.gif) |
Alex C.
|
Posted: Tue Jan 10, 2012 10:29 pm Post subject: RE:Help needed with horse racing game |
|
|
well u could try using a loop and increasing the value of the horses "x & y" coordinates each time |
|
|
|
|
![](images/spacer.gif) |
Velocity
![](http://compsci.ca/v3/uploads/user_avatars/1809397984eb9e2888e99b.jpg)
|
Posted: Wed Jan 11, 2012 12:07 am Post subject: RE:Help needed with horse racing game |
|
|
is the game played by a human or an A.I ? |
|
|
|
|
![](images/spacer.gif) |
tg851
![](http://compsci.ca/v3/uploads/user_avatars/769939254ed665749ae13.jpg)
|
Posted: Wed Jan 11, 2012 11:26 am Post subject: RE:Help needed with horse racing game |
|
|
its an easy fix using the "randint" command is the easy and lays way,and by no means the best(its not actual random at all,and can get predictable) doing that that multiple times till the horses move across the screen and then see who gets to the y coordinate at the other end of the screen first. there's ways that are WAY better,but this is a help forum,not a give away the answers forum,one more thing please,PLEASE,PLEASE don't use offsite uploads,the site has an add attachment to post feature with an unusually large upload limit,please use it,it makes thing less of a headache to help you |
|
|
|
|
![](images/spacer.gif) |
Aange10
![](http://compsci.ca/v3/uploads/user_avatars/19166165534f400d42de502.png)
|
Posted: Wed Jan 11, 2012 5:42 pm Post subject: RE:Help needed with horse racing game |
|
|
Quote:
there's ways that are WAY better,
For example? |
|
|
|
|
![](images/spacer.gif) |
tg851
![](http://compsci.ca/v3/uploads/user_avatars/769939254ed665749ae13.jpg)
|
Posted: Thu Jan 12, 2012 10:55 am Post subject: Re: RE:Help needed with horse racing game |
|
|
Aange10 @ Wed Jan 11, 2012 5:42 pm wrote: Quote:
there's ways that are WAY better,
For example?
make your own algorithm,using the processor clock,then put through BEDMAS with other system processes,nigh impossible to predict unless you are REALLY(think the flash)fast at math and have all of them displayed.pretty much like random seed gen in minecraft on steroids. |
|
|
|
|
![](images/spacer.gif) |
DemonWasp
|
Posted: Thu Jan 12, 2012 11:18 am Post subject: RE:Help needed with horse racing game |
|
|
You have to be careful when writing random number generators. It is important to make sure you're actually generating the uniform distribution you expect to be producing (surprisingly difficult to prove mathematically). If you really must implement your own PRNG, at least use a published algorithm, such as the Mersenne Twister: http://en.wikipedia.org/wiki/Mersenne_twister
Otherwise, you will almost certainly find (on inspection) that you get a non-uniform distribution. Try it on your custom PRNG today! |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
tg851
![](http://compsci.ca/v3/uploads/user_avatars/769939254ed665749ae13.jpg)
|
Posted: Thu Jan 12, 2012 11:28 am Post subject: Re: RE:Help needed with horse racing game |
|
|
DemonWasp @ Thu Jan 12, 2012 11:18 am wrote: You have to be careful when writing random number generators. It is important to make sure you're actually generating the uniform distribution you expect to be producing (surprisingly difficult to prove mathematically). If you really must implement your own PRNG, at least use a published algorithm, such as the Mersenne Twister: http://en.wikipedia.org/wiki/Mersenne_twister
Otherwise, you will almost certainly find (on inspection) that you get a non-uniform distribution. Try it on your custom PRNG today!
thanks for that,it be helpful to say the least, that's relay useful,my code was using 6 system variables,and was pretty good,if overtly archaic and easy to break,now il only need a few |
|
|
|
|
![](images/spacer.gif) |
zainokay
|
Posted: Fri Oct 25, 2013 1:16 pm Post subject: Re: Help needed with horse racing game |
|
|
can someone post a horse race game? |
|
|
|
|
![](images/spacer.gif) |
Raknarg
![](http://compsci.ca/v3/uploads/user_avatars/3745510004d8be6689b92f.jpg)
|
Posted: Fri Oct 25, 2013 8:45 pm Post subject: RE:Help needed with horse racing game |
|
|
I could make one, what for? |
|
|
|
|
![](images/spacer.gif) |
|
|