AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

AHK Racing with Bet!
Goto page Previous  1, 2
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
SKAN



Joined: 26 Dec 2005
Posts: 6223

PostPosted: Wed Oct 04, 2006 5:15 pm    Post subject: Reply with quote

.AHK wrote:
Goyyah, I do not understand your function. Can you explain it? Thanks.


Code:
DeriveFall(LoopVal=3) {
Tn=
Loop, %LoopVal% {
                   Random, Rn, 0,2
                   Tn+= Rn
                 }
Return Tn
}


When you call the above function with no parameter like
Running := DeriveFall(), The possible seven return numbers
are 0,1,2,3,4,5,6

You might already know that 0 is False and any positive number is true.
So there is 1/7th chance that the variable Running becomes False ( means the horse has fallen )

Let me know if this was clear or I shall rephrase my answer.
Do read it carefully

Regards, Smile
_________________
Back to top
View user's profile Send private message
.AHK



Joined: 26 Apr 2006
Posts: 662
Location: USA

PostPosted: Wed Oct 04, 2006 5:27 pm    Post subject: Reply with quote

I understand now, thanks Goyyah. I also see what you ment by two levels of customization.
Back to top
View user's profile Send private message Visit poster's website AIM Address
SKAN



Joined: 26 Dec 2005
Posts: 6223

PostPosted: Wed Oct 04, 2006 5:31 pm    Post subject: Reply with quote

You have to add GuiClose routine:

Code:
GuiClose:
 ExitApp
Return


Regards, Smile
_________________
Back to top
View user's profile Send private message
.AHK



Joined: 26 Apr 2006
Posts: 662
Location: USA

PostPosted: Wed Oct 04, 2006 5:40 pm    Post subject: Reply with quote

Why do I always overlook the simple stuff that is most important? Smile Thanks agian, Goyyah.
Back to top
View user's profile Send private message Visit poster's website AIM Address
scriptmonkey



Joined: 19 May 2006
Posts: 112

PostPosted: Wed Oct 04, 2006 7:39 pm    Post subject: Reply with quote

I get an error at Line 3.

Error: This line contains an unrecognizable action.

EDIT: Just upgraded AutoHotkey. Works now.
Back to top
View user's profile Send private message
justcallmedrago



Joined: 23 Jun 2006
Posts: 46

PostPosted: Fri Oct 06, 2006 6:59 pm    Post subject: Reply with quote

you could make the winning horse move a little bit faster than the others...

or win more if a horse that hasn't won many races wins, and win less if a horse that has won many races win again.

and horse names. you need that too!
Back to top
View user's profile Send private message Send e-mail
.AHK



Joined: 26 Apr 2006
Posts: 662
Location: USA

PostPosted: Fri Oct 06, 2006 7:21 pm    Post subject: Reply with quote

Quote:
EDIT: Just upgraded AutoHotkey. Works now.

I'm glad it is working for you.
Quote:
you could make the winning horse move a little bit faster than the others...

I can not do this as there is no actual winning horse until the race is finished. Smile
Quote:
or win more if a horse that hasn't won many races wins, and win less if a horse that has won many races win again.

I might add this, thanks for the suggestion.
Quote:
and horse names. you need that too!

I need five good horse names. If people want to pick the names that would be good.
Quote:
I used to play a dos-based game much similar in which a horse might fall and be out of the race. It will be nice to have it as a feature.

This feature has been added, thanks Goyyah. You can see the blue horse fell in the below screenshot. Run=6, Fall ratio=0-2, it works good.
Quote:
A possible way to add interest to the race is to add acceleration: generate a tiny random number, say between -5 and 5, add it to the acceleration.

PhiLho, I attempted your suggestion using several differnt methods. Your original suggestion of a negative low cannot work with a progress bar. As they do not accept negative numbers. I cannot add an acceleration amount to a already set speed because of this.

Here is a new screenshot of the game. The original posted script has been updated to include the new updates. Link
Back to top
View user's profile Send private message Visit poster's website AIM Address
SoggyDog



Joined: 02 May 2006
Posts: 261
Location: Greeley, CO

PostPosted: Fri Oct 06, 2006 8:36 pm    Post subject: Reply with quote

My request for this game would be that it ask how many players at the start up (1 - 4, for example) and then have a betting area on the GUI for each so that a small group of friends could bet with or against each other. It would be nice if the GUI built the betting areas dynamically so that if only two people were playing, for example, then only two areas are displayed.
_________________

SoggyDog
Download AutoHotKey Wallpaper
Does 'Fuzzy Logic' tickle?


Last edited by SoggyDog on Fri Oct 06, 2006 8:44 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
.AHK



Joined: 26 Apr 2006
Posts: 662
Location: USA

PostPosted: Fri Oct 06, 2006 8:43 pm    Post subject: Reply with quote

Quote:
My request for this game would be that it ask how many players at the start up (1 - 4 for example) and then have a betting area on the GUI for each so that a small group of friends could bet with or against each other.

This is a good idea, and I will add it sometime. When the game starts should it ask if the game is single player or multiplayer? Multiplayer being a group of friends at a single computer of course. Also, what should the maximum amount of players be for the multiplayer mode?
Back to top
View user's profile Send private message Visit poster's website AIM Address
SoggyDog



Joined: 02 May 2006
Posts: 261
Location: Greeley, CO

PostPosted: Fri Oct 06, 2006 8:59 pm    Post subject: Reply with quote

.AHK wrote:
When the game starts should it ask if the game is single player or multiplayer? Multiplayer being a group of friends at a single computer of course. Also, what should the maximum amount of players be for the multiplayer mode?


I would think something like this would pop up at start up;



If you select One then it's obviously not a multiplayer game, otherwise, the additional betting areas would be generated with the GUI.

As far as the maximum number of players, I would think that only so many people would be comfortable gathered around a computer screen, so maybe just 4 or 6 as a max.

It would also be nice if it asked and displayed the names of the players to have a more personal feel, rather than just Player #1, Player #2, etcetera.
_________________

SoggyDog
Download AutoHotKey Wallpaper
Does 'Fuzzy Logic' tickle?
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
.AHK



Joined: 26 Apr 2006
Posts: 662
Location: USA

PostPosted: Fri Oct 06, 2006 9:04 pm    Post subject: Reply with quote

Quote:
I would think something like this would pop up at start up;

There we go.
Quote:
As far as the maximum number of players, I would think that only so many people would be comfortable gathered around a computer screen, so maybe just 4 or 6 as a max.

I will keep it at the default five racers. Even if there is only 2 players there will still be 5 racers to bet on. This sounds best to me.
Quote:
It would also be nice if it asked and displayed the names of the players to have a more personal feel, rather than just Player #1, Player #2, etcetera.

I was already thinking about this for the multiplayer, thanks.
Back to top
View user's profile Send private message Visit poster's website AIM Address
SoggyDog



Joined: 02 May 2006
Posts: 261
Location: Greeley, CO

PostPosted: Fri Oct 06, 2006 9:46 pm    Post subject: Reply with quote

.AHK wrote:
I will keep it at the default five racers. Even if there is only 2 players there will still be 5 racers to bet on. This sounds best to me.


I guess I misunderstood. Yes, of course I would keep it at five racers. I would limit the number of players, though, to a fairly small number as I indicated earlier.

Obviously, any player could bet on any racer, even if it had already been bet on by someone else in the game.

Another thought I had regarding multiplayer; If you wanted to "compete" against someone but didn't have anyone around to play with, you could set it up so that the computer could play as the other "Players."

Maybe when this game progresses to the point where it does ask for the Players names, if you enter "Computer" for any or all players, then the player(s) is played by the computer, entering a random bet(s) on a random racer(s).
_________________

SoggyDog
Download AutoHotKey Wallpaper
Does 'Fuzzy Logic' tickle?
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
.AHK



Joined: 26 Apr 2006
Posts: 662
Location: USA

PostPosted: Fri Oct 06, 2006 9:56 pm    Post subject: Reply with quote

Quote:
Another thought I had regarding multiplayer; If you wanted to "compete" against someone but didn't have anyone around to play with, you could set it up so that the computer could play as the other "Players."

Maybe when this game progresses to the point where it does ask for the Players names, if you enter "Computer" for any or all players, then the player(s) is played by the computer, entering a random bet(s) on a random racer(s).

Another great idea. Instead of difficulty levels I will just have it so you compete agianst the computer in single player as you suggested.
Quote:
I guess I misunderstood. Yes, of course I would keep it at five racers. I would limit the number of players, though, to a fairly small number as I indicated earlier.

No I knew what you ment. I wrote a bad reply to that quote is all. Thanks for your suggestions.
Back to top
View user's profile Send private message Visit poster's website AIM Address
d-man



Joined: 08 Jun 2006
Posts: 247

PostPosted: Sun Oct 08, 2006 12:28 am    Post subject: Reply with quote

m8, odds are 1 in 5—u should at least get 5x what you bet for 1:5 odds.
Back to top
View user's profile Send private message
slomz



Joined: 03 Sep 2006
Posts: 608
Location: Iowa, U.S.

PostPosted: Sun Oct 08, 2006 5:15 am    Post subject: Reply with quote

Lol yes well thought out. You should also put a constantly moving black pixel tht is like 5x5 moving up and down the screen. If the bar happens to hit tht pixel in the front, then it stops in its tracks. So basically make the blakc pixel a deadly obstacle.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group