马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
[RenPy] 纯文本查看 复制代码 screen show_card_all:
zorder 3
for i in range(0, 5):
use show_card(card.card_pos[i], 0.55, card.card_image[card.my_card[i]], i)
use show_card(card.card_pos[i], 0.15, card.card_image[card.cat_card[i]], i)
screen show_card(x, y, card_image, card_pos):
zorder 4
add card_image:
at more(x, y)
transform more(x, y):
xpos x+1.0 ypos 1.25*(y-0.08) zoom 1.00 alpha 1.00 rotate -90 subpixel True
parallel:
easein 0.7 xpos x
parallel:
easein 0.7 ypos y
parallel:
easein 0.5 rotate 0
screen add_score():
zorder 5
textbutton "交换" pos(0.8,0.5) action [Play("sound","1935.mp3",selected = None), Function(card.change)]
后台
[RenPy] 纯文本查看 复制代码 init -500 python:
import random
class card_class(object):
def __init__(self):
####牌库
self.cardbase = []
for i in range(1, 11):
for j in range(0, 4):
self.cardbase.append(i)
random.shuffle(self.cardbase)
####我的卡牌/得分
self.my_card = []
for i in range(0, 5):
self.my_card.append(self.cardbase[i])
self.my_score = 0
####对手卡牌/得分
self.cat_card = []
for i in range(5, 10):
self.cat_card.append(self.cardbase[i])
self.cat_score = 0
####卡牌位置
self.card_pos = [0.1, 0.2, 0.3, 0.4, 0.5]
####卡牌图案
self.card_image = ([' ', 'game1.png', 'game2.png', 'game3.png', 'game4.png', 'game5.png', 'game6.png', 'game7.png', 'game8.png', 'game9.png', 'game0.png'])
####本回合分数
self.score = 1
####展示的卡牌数量
self.show = 4
def change(self):
test = self.my_card[0]
self.my_card[0] = self.cat_card[0]
self.cat_card[0] = test
现在利用这种方法虽然可以实现前两个图片交换,但是并不能实现动画,请问大佬们有妙招吗?
|