I am currently coding blackjack and am trying to sum up the two first random cards and display the score.
Code: Select all
label yes:
"Great, let's start the game"
$ firstCard = renpy.random.choice(["vAce", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", "v10", "vJ", "vQ", "vK"])
show expression firstCard:
yalign 0.9
xalign 0.37
$ secondCard = renpy.random.choice(["vAce", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", "v10", "vJ", "vQ", "vK"])
show expression secondCard at center:
yalign 0.9
$ firstCardOpp = renpy.random.choice(["vAce", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", "v10", "vJ", "vQ", "vK"])
show expression firstCardOpp:
yalign 0.0
xalign 0.37
$ secondCardOpp = renpy.random.choice(["vAce", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", "v10", "vJ", "vQ", "vK"])
show expression secondCardOpp at center:
yalign 0.0
if firstCard = vAce:
"Please select either 11 or 1."
menu:
"11":
$ amountFirstCard = 11
jump amountFirstCard
"1":
$ amountFirstCard = 1
jump amountFirstCard
$ amountFirstCard = cardWorth.get("[firstCard]")
if SecondCard = vAce:
"Please select an amount"
menu:
"11":
$ amountSecondCard = 11
jump firstRound
"1":
$ amountSecondCard = 11
jump FirstRound
$ amountSecondCard = cardWorth.get("[secondCard]")
Code: Select all
if FirstCard = vAce:
Am I just stupid or am I blind? The same occurs again at
Code: Select all
if SecondCard = vAce:
Code: Select all
$ amountFirstRound = amountFirstCard + amountSecondCard
I searched python wiki an ren'py wiki but I can't find a mistake.
Thx for any help
SaladDressing