Gw Temp

Menu

Tutorial - 'Casino Coin-toss Game' by ElementZero

An item about RPGMaker 2000 posted on

Blurb

Learn how to make a simple coin toss game.

Body

Hi there! This is the last of my three tutorials, or at least until I can think of any more to post. This is the tutorial to make a Casino Coin-toss game. I expect you to know your way around variables, but It won't be hard like a CMS or CBS. It looks complicated because of lots of forks and change variable commands, but trust me. If you know your way around variables and fork options, and are not a beginner, but at least a novice, you can get through this.

Start off by making a common event (F8) called 'Coin Toss'. Make its start condition 'Call'. Now put these commands in it:

< >Label: 1No.
< >Variable Ch:[####:Money]Set, Money#
< >Messg: How much \$money do you want to bet?
< >Input Number: 6 digit[####:Coin Toss Money]
< >FORK Optn:Variable[####:Money]-[####:Coin Toss Money]above-add else case
< >Messg: Heads or Tails?
< >Show Choice: Heads/Tails
:[Heads] Case
< >Variable Ch: [####:Coin Toss]Set, Random[1*2]
< >FORK Optn: Variable[####:Coin Toss]-1-add else case
< >Wait 1.0s
< >Messg: Heads it is!
< >Variable Ch:[####:Coin Toss Money]*, 2
< >Messg: Got \V[# of Coin Toss Money] GP!
< >Change Money: Money V[####:Coin Toss Money] Increase
< >Variable Ch:[####:Coin Toss]Set, 0
< >Variable Ch:[####:Coin Toss Money]Set, 0
< >Variable Ch:[####:Money]Set, 0
< >
:ELSE Case
< >Wait 1.0s
< >Messg: Nope, it's Tails!
< >Change Money: Money V[####:Coin Toss Money] Decrease
< >Variable Ch:[####:Coin Toss]Set, 0
< >Variable Ch:[####:Coin Toss Money]Set, 0
< >Variable Ch:[####:Money]Set, 0
< >
:END Case
< >
:[Tails] Case
< >Variable Ch: [####:Coin Toss]Set, Random[1*2]
< >FORK Optn: Variable[####:Coin Toss]-1-add else case
< >Wait 1.0s
< >Messg: Tails it is!
< >Variable Ch:[####:Coin Toss Money]*, 2
< >Messg: Got \V[# of Coin Toss Money] GP!
< >Change Money: Money V[####:Coin Toss Money] Increase
< >Variable Ch:[####:Coin Toss]Set, 0
< >Variable Ch:[####:Coin Toss Money]Set, 0
< >Variable Ch:[####:Money]Set, 0
< >
:ELSE Case
< >Wait 1.0s
< >Messg: Nope, it's Heads!
< >Change Money: Money V[####:Coin Toss Money] Decrease
< >Variable Ch:[####:Coin Toss]Set, 0
< >Variable Ch:[####:Coin Toss Money]Set, 0
< >Variable Ch:[####:Money]Set, 0
< >
:END Case
< >
:END Case
< >
:ELSE Case
< >Messg: You don't have that much money!
< >GOTOLabel: 1No.
< >
:END Case
< >

There! Now you're so close to being done it's funny!
Make a new event on the map (not a common event). Give him a good Coin-Toss-Gambling-Employee look. Make him 'Push Key' and 'Same Level as Hero'. Now give him these commands:

< >FORK Optn: Hero - Facing Down-add else case
< >Messg: Come on now, sir! Get in front of me!
< >
:ELSE Case
< >Messg: Want to play a Coin Toss game, Sir?
< >Show Choice: Yes/No
:[Yes] Case
< >Call Event: Coin Toss
< >
:[No] Case
< >
:END Case
< >
:END Case
< >

Now you're done! Now just talk to that Coin-Toss-Gambling-Employee guy from the front or the sides (not the back because he'll yell at you) and you can play!

If you would like to download an in-game tutorial click here.
If the above link doesn't work, go to http://www.gamingw.net/file/ez_tuts.zip