只需一步,快速开始
您需要 登录 才可以下载或查看,没有帐号?立即注册
init python: import random class Room(): def __init__(self): self.state=0 def display(self): if self.state == 0: ui.imagebutton(idle="apoto.png") else: ui.imagebutton(idle="apoto2.png",action=[self.click,SetScreenVariable("a",1)]) def click(self): self.state=0 def random(self): self.state=0 result=random.randint(0,4) if result==0: self.state=1 class MyGame(): def __init__(self): self.grid=[] for i in range(0,16): self.grid.append(Room()) def display(self): ui.grid(4,4,align=(0.5,0.5),spacing=20) #ui.vbox(align=(0.5,0.5)) for room in self.grid: room.display() ui.close() def random(self): for room in self.grid: room.random() mygame=MyGame() screen test(): default a=1 python: mygame.display() timer 2.0: action [mygame.random,SetScreenVariable("a",1)] repeat True #游戏开始的标记 label start: call screen test
查看全部评分
使用道具 举报
本版积分规则 发表回复 回帖并转播 回帖后跳转到最后一页
小黑屋|手机版|RenPy中文空间 ( 苏ICP备17067825号 | 苏公网安备 32092302000068号 )
GMT+8, 2021-2-27 11:34 , Processed in 0.039010 second(s), 13 queries , File On.
Powered by Discuz! X3.4 Licensed
Copyright © 2001-2020, Tencent Cloud.