The "call"-command did it with the hp bars

And it was simply the case, that the background wasn't seethrough (as it will look when not using a background) but the color of the menu (in my case blue).
Nothing else, just blue and the speech box.
But it's fixed now, the hint with call was good.
The error about "can't find 32.png" is also gone, seems to be wiped out.
And I also guess it's almost finished, the only problem is:
I don't see something ôo
The health bar is up there, but nothing else.
No speech box, no cards, nothing. I can also click on nothing, the screen seems to be totally empty.
I named my cards 1-22, of course as png. And I tried typing all the codes by hand in case I have an error there again.
I post my entire battle.rpy as code, maybe I just don't see the error or I did something wrong (like changing a command or stuff)
Code: Select all
init:
$ hp = 100
$ maxhp = 100
$ enemyhp = 100
$ enemymaxhp = 100
$ hand = []
screen hpbars:
frame:
xalign 1.0
yalign 0.0
hbox:
vbox:
hbox:
text "HP" size 20
bar value hp range maxhp xmaximum 200
vbox:
hbox:
text "EnemyHP" size 20
bar value enemyhp range enemymaxhp xmaximum 200
vbox:
text ("%d/%d" % (hp, maxhp)) xalign 0.5 size 20
label draw3:
python:
deck = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22]
for i in range(3):
newcard = renpy.random.choice(deck)
deck.remove(newcard)
hand.append(newcard)
jump battle
label battle:
screen playerhand:
for a in range(len(hand)):
if a in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]: #assuming 1-10 as attack cards
imagebutton:
idle (str(a) + ".png")
hover (str(a) + ".png")
action Jump('attack')
xpos (100 + a * 50) ypos 600
if a in [11, 12, 13, 14, 15, 16, 17, 18, 19, 20]:
imagebutton:
idle (str(a) + ".png")
hover (str(a) + ".png")
action Jump('defend')
xpos (100 + a * 50) ypos 600
if a in [21, 22]:
imagebutton:
idle (str(a) + ".png")
hover (str(a) + ".png")
action Jump('hurtplayer')
xpos (100 + a * 50) ypos 600
if a in [10, 20]:
imagebutton:
idle (str(a) + ".png")
hover (str(a) + "18.png")
action Jump('healall')
xpos (100 + a * 50) ypos 600
label attack:
"I attack the enemy!"
$ enemyhp -= 10
"I deal 10 damage."
"Enemy's HP %(enemyhp)d."
jump victory
label defend:
"Nothing happend."
jump battle
label healall:
"Everyone is healed!"
$ hp = maxhp
$ enemyhp = enemymaxhp
label hurtplayer:
"Argh!"
$ hp -= 10
"You lose 10 HP."
"Robin HP %(hp)d."
jump victory
label victory:
if enemyhp < 1:
"I won!"
jump after_battle
else:
jump lose
label lose:
if hp < 1:
"Game Over!"
return
else:
jump damage
label damage:
"The enemy attacked you!"
$ hp -= 5
"You lose 5 HP."
"Robin HP %(hp)d."
jump battle
Like I said, the images are called 1.png, 2.png, 3.png, etc till 22.png
So that wouldn't be a problem.
They are also 600x772 pixel, maybe they are too big?
I'm very sorry for all the work (and me being so stupid).
But what would be a card magician without magic cards? xD"
P.S.
Cool, spoiler doesn't work when posting a code =__=
P.P.S.
I just tried this, still won't work
Code: Select all
init:
$ hp = 100
$ maxhp = 100
$ enemyhp = 100
$ enemymaxhp = 100
$ hand = []
screen hpbars:
frame:
xalign 1.0
yalign 0.0
hbox:
vbox:
hbox:
text "HP" size 20
bar value hp range maxhp xmaximum 200
vbox:
hbox:
text "EnemyHP" size 20
bar value enemyhp range enemymaxhp xmaximum 200
vbox:
text ("%d/%d" % (hp, maxhp)) xalign 0.5 size 20
screen playerhand:
for a in range(len(hand)):
if a in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]: #assuming 1-10 as attack cards
imagebutton:
idle (str(a) + ".png")
hover (str(a) + ".png")
action Jump('attack')
xpos (100 + a * 50) ypos 600
if a in [11, 12, 13, 14, 15, 16, 17, 18, 19, 20]:
imagebutton:
idle (str(a) + ".png")
hover (str(a) + ".png")
action Jump('defend')
xpos (100 + a * 50) ypos 600
if a in [21, 22]:
imagebutton:
idle (str(a) + ".png")
hover (str(a) + ".png")
action Jump('hurtplayer')
xpos (100 + a * 50) ypos 600
if a in [10, 20]:
imagebutton:
idle (str(a) + ".png")
hover (str(a) + "18.png")
action Jump('healall')
xpos (100 + a * 50) ypos 600
label draw3:
python:
deck = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22]
for i in range(3):
newcard = renpy.random.choice(deck)
deck.remove(newcard)
hand.append(newcard)
jump battle
label battle:
call screen playerhand
label attack:
"I attack the enemy!"
$ enemyhp -= 10
"I deal 10 damage."
"Enemy's HP %(enemyhp)d."
jump victory
label defend:
"Nothing happend."
jump battle
label healall:
"Everyone is healed!"
$ hp = maxhp
$ enemyhp = enemymaxhp
label hurtplayer:
"Argh!"
$ hp -= 10
"You lose 10 HP."
"Robin HP %(hp)d."
jump victory
label victory:
if enemyhp < 1:
"I won!"
jump after_battle
else:
jump lose
label lose:
if hp < 1:
"Game Over!"
return
else:
jump damage
label damage:
"The enemy attacked you!"
$ hp -= 5
"You lose 5 HP."
"Robin HP %(hp)d."
jump battle