我正在尝试用 renpy 制作游戏,并且我实现了一个类似于机械师的小型 rpg,并且我试图显示健康条。它工作了一段时间,但后来它停止了,我不知道为什么。我检查了我的变量,一切似乎都井井有条。也许这里有人可以帮助我。下面是小rpg画面设置部分。
label rpg_test:
play music "Boss_Fight.wav"
$ attack = 0
if "dagger" in inventory == True:
$ player_attack + 2
$ kdragon_hp = kdragon_max_hp
define gui.bar_tile = True
define getting_attacked = "No one"
$ kdragon_max_hp = 50 * len(party)
$ kdragon_hp = kdragon_max_hp
screen simple_stats_screen:
frame:
xalign 0.01 yalign 0.05
xminimum 220 xmaximum 220
yminimum 100 ymaximum 100
vbox:
text name size 15 xalign 0.25
text "[player_hp] / [player_max_hp] HP" size 13 xalign 0.5
text "[player_sp] / [player_max_sp] SP" size 13 xalign 0.75
null height 2
hbox:
bar:
xmaximum 130
ypos 10
value player_hp
range player_max_hp
left_gutter 0
right_gutter 0
thumb None
thumb_shadow None
null width 3
if gilbert_in_party == True:
frame:
xalign 0.01 yalign 0.20
xminimum 220 xmaximum 220
yminimum 100 ymaximum 100
vbox:
text "Gilbert" size 15 xalign 0.25
text "[gilbert_hp] / [gilbert_max_hp] HP" size 13 xalign 0.5
text "[gilbert_sp] / [gilbert_max_sp] SP" size 13 xalign 0.75
null height 2
hbox:
bar:
xmaximum 130
ypos 10
value gilbert_hp
range gilbert_max_hp
left_gutter 0
right_gutter 0
thumb None
thumb_shadow None
null width 3
if guard_in_party == True:
frame:
xalign 0.01 yalign 0.35
xminimum 220 xmaximum 220
yminimum 100 ymaximum 100
vbox:
text "Guard" size 15 xalign 0.25
text "[guard_hp] / [guard_max_hp] HP" size 13 xalign 0.5
text "[guard_sp] / [guard_max_sp] SP" size 13 xalign 0.75
null height 2
hbox:
bar:
xmaximum 130
ypos 10
value guard_hp
range guard_max_hp
left_gutter 0
right_gutter 0
thumb None
thumb_shadow None
null width 3
if host_in_party == True:
frame:
xalign 0.01 yalign 0.5
xminimum 220 xmaximum 220
vbox:
text "TV Host" size 15 xalign 0.25
text "[host_hp] / [host_max_hp] HP" size 13 xalign 0.5
text "[host_sp] / [host_max_sp] SP" size 13 xalign 0.75
null height 5
hbox:
bar:
xmaximum 130
value host_hp
range host_max_hp
left_gutter 0
right_gutter 0
thumb None
thumb_shadow None
null width 5
text "[host_hp] / [host_max_hp]" size 16
frame:
xalign 0.99 yalign 0.05
xminimum 220 xmaximum 220
vbox:
text "Dragon king" size 22 xalign 0.5
null height 5
hbox:
bar:
xmaximum 130
value kdragon_hp
range kdragon_max_hp
left_gutter 0
right_gutter 0
thumb None
thumb_shadow None
null width 5
text "[kdragon_hp] / [kdragon_max_hp]" size 16
```