这计算也很有意思的
字典计算,测试脚本:
[RenPy] 纯文本查看 复制代码 # 游戏的脚本可置于此文件中。
init python :
Dict_1 = {"A":2,"B":6, "C":8 }
# AAA = Dict_1['A']
def CCC():
Dict_1['A'] = Dict_1['A'] + 2
# Dict_1['A'] = 3
screen ABC():
fixed:
xpos 0.1
ypos 0.1
vbox:
text str(Dict_1['A'])
textbutton _("函数方式") align(0.2 ,0.3) action Function(CCC)
textbutton _("调用界面") align(0.1 ,0.3) action Show("JISUAN")
textbutton _("返回菜单") align(0.2 ,0.3) action MainMenu(confirm=False)
screen JISUAN():
fixed:
textbutton _("关闭screen") align(0.2 ,0.5) action Hide("JISUAN")## 这按钮也能计算?
## screnn里
python:
Dict_1['A'] = Dict_1['A'] + 5
# Dict_1['A'] = 11
# 游戏在此开始。
label start:
call screen ABC()
# 此处为游戏结尾。
return
|