# Gw Temp

## Tutorial - 'Blackjack for rm2k' by ATARI

An item about RPGMaker 2000 posted on

### Blurb

A guide on how to create a blackjack game for your casino in an rm2k game

### Body

Hi folks. It's atari AGAIN!

Okay, some of us gamble, some don't. I personally don't gamble, and a lot of people don't. But if you have ever played any gambling mini-games in an rpg (ex: blackjack in Mario Rpg), it's kinda fun, because you know you aren't going to lose anything, but enough of this. Let's talk about making a black jack mini game (which of course can be morphed into other games)

Make your variables (you can do this without knowing what they are) you need 4: label one, hero card, hero's point, their card, their points. So in the variable menu it would look like
[xxxx]hero card
[xxxx]hero point
[xxxx]their card
[xxxx]their point
Of course, i have no idea what number variable you would be using, so we'll just do hero card = 1, hero point = 2, their card = 3 their point = 4.

The rules to black jack are simple. The person to the closest to 21 wins between the two people wins and the lowest wins. If you go over 21 you lose. You draw cards until you want to stop (or go over 21)
In this tutorial the cards range from 1-10. How do you make this happen? Read a find out. (and get me a donut. J/k)

First of all, make a event. Make it start out asking if you want to play or not. Make a choice to say yes or no. If you say no, don't put anything, but under yes goes the real coding.

Put a message that tells them their total. so it would look like. Your total is /v[2]. (it really is the other slash, but it doesn't show up in g-world, i don't know how to make it show). Under it make a show choice event with three choices.,
Draw
Stop
Quit Game
Under draw, make the coding, put a label, label it any number, just make it a number you haven't used before. (duh). Under the label put a variable event. Go into your variable option. Select in choose variables one and the hero card variable, then in the set, select set. Then in operand, select random and type in 1 and in the next box 10.
Make a message event that says you drew a(n) /v[1]. (if you don't undertstand the /v[1] goto my variable tut) Now go into the variable event again. put hero point at the top , change the set to plus, change the operand from random to variable (the first one, not the one that has variable no after it) make it hero card. It should look like this so far in the event:

Messg: Wanna play?
Show choice: [yes]
Messg: you have \v[2]
Show choice: [draw]
Label No. 1
Variable [0001] hero card set, randm [1*10]
Messg: you drew a \v[1]
Variable [0002] hero point +, var [0001] val
[end]
<>
[quit]
<>
[no]
<>
END CASE
<>

under the last event you made, put another variable event and set hero card at 0. Then make a Messg that has the dealer saying my turn. Then do the exact thing as you did with the hero getting the cards except change the variables to fit the dealer.
(except don't say how much the dealer has. The dealer doesn't know yours, the dealers a dumb computer)
Now under the last event, make a fork. Go into fork option, select variable, put in the hero point variable, type in 21 in set and make it above. The after that event. Make a messg telling you u lost. Then make all the variables you made for this tutorial at 0. Under the else case, do the exact thing except change the varible to their point and make a messg that says you won. Easy? Almost done now. Under the last else case make it goto label no.1

Now go under the end case make a messg that says
I had /v[4] and you had /v[2] Make a fork under it
select hero point, then in the things below select their point. Make it above. Then make an event that says you won. then change everything to zero.

Under the else case, do the same thing except change above to below and make the messg say u lost.
Then at the very last end case, make everything set to 0.

This should work. If it doens't just ask. I proabably made some mistatkes. (what? Atari make mistakes?)

To spiff it up, you can make them hand over money, or u hand over money. I won't explain how to do this correctly (like handing over 500 gold when your at 200), read up on fork tutorials to do it.

Good luck young coders
NOTE: U can post this anywhere just give me credit, and u don't have to give me credit in your game, It would be nice though if you did. :)

Remember
"Even the greatest gamers were nOObs."
ATARI