找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 93|回复: 8

[求助] 新手的第一个游戏,帮帮我~

[复制链接]
发表于 4 天前 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
有没有大佬有空帮我看看,刚学一个月,想做一个大学恋爱游戏,现在的问题就是,运行到去上课哪里,我选择了上课,但是tdc不会被记录,三次机会用完后直接跳转到xiuxue标签了!
游戏大致玩法是进入宿舍,有一个行动列表,选择行动,每周要上一次课,否则在标签xun结算时会加kk(旷课)的值,加到3,就跳转到xiuxue标签,然后行动点用完了再回到real循环!
7d2edead3ba3675face7ab4de46be1ee.png
edbadc15aff35f45c91e10756ec837e7.png
 楼主| 发表于 4 天前 | 显示全部楼层
label live1:
    stop music
    show screen black with dissolve
    pause 2.0
第一张图缺的,我没看到
回复 支持 抱歉

使用道具 举报

发表于 4 天前 | 显示全部楼层
en,第二张图的fate变量是什么作用,没看懂
回复 支持 抱歉

使用道具 举报

发表于 3 天前 | 显示全部楼层
请把代码以“文本”的形式发出来……
回复 支持 抱歉

使用道具 举报

 楼主| 发表于 3 天前 | 显示全部楼层
本帖最后由 cyz 于 2025-4-16 11:24 编辑

谢谢大佬!
回复

使用道具 举报

 楼主| 发表于 3 天前 | 显示全部楼层
iceRedtea 发表于 2025-4-15 22:36
en,第二张图的fate变量是什么作用,没看懂

em,随便取的一个名字,下一行if判断fate的值,50%去ts标签,50%上水课
回复 支持 抱歉

使用道具 举报

 楼主| 发表于 3 天前 | 显示全部楼层
被诅咒的章鱼 发表于 2025-4-16 10:15
请把代码以“文本”的形式发出来……

[RenPy] 纯文本查看 复制代码
# 变量定义
default name = ""
default xlove = 0
default qlove = 0
default clove = 0
default money = 0
default week = 1
default grade = "大一"  #年级
default kk = 0     #旷课次数
default study = 0
default power = 0   #健身房
default bite = 0    #魅力值
default art = 0     #艺术
default bb = 0      #篮球
default bmq = 0
default tdc = False

screen black():
    layer "overlay"
    fixed:
        xfill True 
        yfill True
        add "#000"
        text "[grade]第[week]周":
            xalign 0.5 yalign 0.5
            size 60
            color "#fff"


define config.name = "光启大学"
define config.version = "1.1"
define config.window_icon = "fm.png"
define gui.about = _("制作人 cyz.\n\n美术 cyz.")
define gui.choice_button_text_idle_color = '#888888'
define gui.choice_button_text_hover_color = '#0066cc'
define gui.text_color = "#402000"



define n = Character("[name]",color="#ff9dce")
define x = Character("萧逸",color="#6eb3fc")
define q = Character("齐司礼",color="#92fd45")
define c = Character("查理苏",color="#fc2a2a")
define sym = Character("室友们",color="#d0007d")
define sy23 = Character("馨乐和家琦",color="#d0007d")
define sy1 = Character("妍妍",color="#8e71f6aa")
define sy2 = Character("馨乐",color="#ff89b8aa")
define sy1 = Character("家琦",color="#f69234aa")


# 图片路径
image daxue:
    "images/daxue.png"
image fm:
    "images/fm.png"
image class:
    "images/classroom.png"
    zoom 3
    xpos 0.5
    ypos 1.0
image pg:
    "images/playground.png"
image qs1:
    "images/dormitory_hall.png"
    zoom 3
    xpos 0.5
    ypos 0.99
image qs2:
    "images/dormitory2.png"
    zoom 3
    xpos 0.5
    ypos 1.0
image qsm:
    "images/dormitorym.png"



# 人物
image n1:
    "images/player/nv.png"
    zoom 0.8
image n2:
    "images/player/nv2.png"
    zoom 0.5
image cd:
    "images/player/cd.png"
    zoom 0.5
image ct:
    "images/player/ct.png"
    zoom 0.5
image cz:
    "images/player/cz.png"
    zoom 0.5
image qd:
    "images/player/qd.png"
    zoom 0.5
image qh:
    "images/player/qh.png"
    zoom 0.5
image qt:
    "images/player/qt.png"
    zoom 0.5
image xh:
    "images/player/xh.png"
    zoom 0.5
image xz:
    "images/player/xz.png"
    zoom 0.5
image sym:
    "images/player/sym.png"
    zoom 1.1
    xpos 2
    ypos 4
image sy23:
    "images/player/sy23.png"
    zoom 0.7
    xpos 0.7



# 开始按钮
label start:
    # 加渐变效果
    scene daxue with dissolve
    # 调屏幕
    call screen input_name
    # 跳转剧情
    jump teacher

# 输入姓名屏幕
screen input_name():
    add "daxue"  # 背景图
    input:
        xpos 135 ypos 475
        value VariableInputValue("name")
        length 4
    textbutton "入学":
        xpos 900 ypos 880
        action [SetVariable("name", name),Jump("teacher")]




# 剧情1
label teacher:
    play music "audio/bg.mp3"
    scene fm
    with dissolve
    show n1  
    n "莺燕转鸣,叩响春日的门扉;翩翩斯人,撩开我心的窗帷"
    n "风景真不错"
    n "只是..."
    with vpunch
    n "行李太...沉了!"
    hide n1
    "经过了一段时间"
    scene qsm
    with dissolve
    show n1 at left
    n "终于到门口啦!"
    "豆大的汗滴,滴落在你的衣服上!"
    "你的手臂,几乎抬不起来了!"
    # play voice 萧逸语音 
    "你好同学,请问你需不需要帮忙吗?"
    show xz at right
    with vpunch
    "你被吓了一跳"
    n "呃呃..."
    menu:
        "需要帮忙吗?"
        "请他帮忙!":
            $ xlove += 10
            jump hall
        "拒绝他的帮忙":
            jump c1
            $ xlove -= 10
    
# 剧情1分支hall
label hall:
    scene qsm
    show n1 at left
    with dissolve
    show xz at right
    with dissolve
    "你腼腆的涨红着脸"
    n "好!"
    "你们走到了楼道口"
    scene qs1
    play sound "zo.mp3"
    "他一不小心被撞倒了"
    "行李散落了一地"
    show cz
    with dissolve
    ""
    c "不好意思,不好意思"
    c "我帮你们捡起来"
    "说着,他马上伸出手,想要拿起地上的行李"
    menu:
        "要阻止他吗?"
        "阻止他":
            $ xlove += 10
            jump x1
        "让他拿":
            $ clove += 10
            jump xc


# 剧情1分支c,1
label c1:
    scene qs1
    show n1 at left
    with dissolve
    play sound "zo.mp3"
    n "哎呀"
    "你不小心被撞倒了"
    show cz at right
    "不好意思,不好意思"
    "我帮你捡起来"
    menu:
        "要阻止他吗?"
        "阻止他":
            jump q
            $ qlove += 10
        "让他拿":
            jump c2
            $ clove += 10

# 剧情1分支hall分支x,1
label x1:
    scene qs1
    show n1 at left
    show cz at right
    show xz at center
    n "不用了,我们自己会整理好的"
    c "不好意思,我先走了!"
    "他收起了手"
    "头也不回的走了"
    "你们整理好了东西"
    "走到了寝室门口"
    x "我先走了?"
    menu:
        "要不要请他吃饭?"
        "好":
            $ xlove += 10 
            jump xsushe
        "算了":
            jump sushe
            

# 剧情1分支hall分支xc
label xc:
    scene qs1
    show n1 at center
    show cz at left
    show xz at right
    "气氛变得微妙了起来"
    "你们到了寝室"
    "行李整整齐齐的放在了你的床位上"
    x "我先走了?"
    c "我也先走了?"
    menu:
        "要不要请他们吃饭?"
        "请萧逸":
            $ xlove += 10
            jump xsushe
        "请查理苏":
            $ clove += 10
            jump ccsushe
        "小孩子才做选择,我两个都要!":
            $ xlove += 10
            $ clove += 10
            jump xcsushe

# 剧情1分支c,1分支q,1
label q:
    n "不用不用"
    n "我自己来就行了"
    "你费了好大劲,才把行李搬进宿舍"
    jump sushe

# 剧情1分支c,2分支c,3
label c2:
    scene qs1
    "查理苏帮你拾起了行李"
    c "真的不好意思,同学!"
    menu:
        "你的回答"
        "没事没事!我自己来就行!":
            $ clove += 10
            jump sushe
        "让他帮忙把行李放到宿舍":
            $ clove += 10
            jump csushe
        "拿回行李,径直走向宿舍":
            $ clove -= 10
            jump sushe

label xsushe:
    stop music
    scene qs2
    play music "audio/weiji.mp3"
    show n1 at left
    with dissolve
    show sym at right
    with dissolve
    sy23 "哈喽,同学你哪里来的?"
    sy1 "刚刚来帮你搬行李的是你男朋友吗?"
    menu:
        "回答妍妍的话"
        "不是不是,你误会了":
            sy1 "哦哦"
            sy1 "我就说"
            menu:
                "你回答什么?"
                "嗯嗯":
                    jump dasushe
                "哦!":
                    jump dasushe
        "对呀,帅吧?":
            sy1 "真的假的?"
            menu:
                "真的!":
                    sy1 "哦哦"
                "骗你们的!":
                    sy1 "我就说"
                "发脾气":
                    n "干嘛对别人的隐私这么伤心"
                    n "你是没有家人吗?"
                    n "企图在别人这里获得认同感?"
                    sy1 "对不起,对不起"
                    hide sym
                    with dissolve
                    show sy23
                    with dissolve
                    sy23 "不好意思,同学"
                    sy23 "妍妍就是心直口快"
                    n "嗯"
                    jump dasushe
            
        "甩脸色!":
            sy1 "你干嘛不回答我?"
            sy1 "喂!问你话呢!"
            menu:
                "怎么回答?"
                "关你什么事":
                    "跟你有什么关系?"
                    "想不开,就挂个牌子出去站街!"
                    sy1 "不说就不说嘛,骂人干什么!"
                    hide sym
                    with dissolve
                    show sy23
                    with dissolve
                    sy23 "不好意思,同学"
                    sy23 "妍妍就是心直口快"
                    n "嗯"
                    jump dasushe




label csushe:
    scene qs2
    stop music
    scene qs2
    play music "audio/weiji.mp3"
    show n1 at left
    with dissolve
    sy23 "哈喽,同学你从哪里过来的?"
    show sy23 at right
    with dissolve
    hide sy23
    show sym
    sy1 "刚刚来帮你搬行李的是你男朋友吗?"
    menu:
        "回答妍妍的话"
        "不是不是,你误会了":
            sy1 "哦哦"
            sy1 "我就说"
            menu:
                "你回答什么?"
                "嗯嗯":
                    jump dasushe
                "哦!":
                    jump dasushe
        "对呀,帅吧?":
            sy1 "真的假的?"
            menu:
                "真的!":
                    sy1 "哦哦"
                "骗你们的!":
                    sy1 "我就说"
                "发脾气":
                    n "干嘛对别人的隐私这么伤心"
                    n "你是没有家人吗?"
                    n "企图在别人这里获得认同感?"
                    sy1 "对不起,对不起"
                    hide sym
                    with dissolve
                    show sy23
                    with dissolve
                    sy23 "不好意思,同学"
                    sy23 "妍妍就是心直口快"
                    n1 "嗯"
                    jump dasushe
            
        "甩脸色!":
            sy1 "你干嘛不回答我?"
            sy1 "喂!问你话呢!"
            menu:
                "怎么回答?"
                "关你什么事":
                    "跟你有什么关系?"
                    "想不开,就挂个牌子出去站街!"
                    sy1 "不说就不说嘛,骂人干什么!"
                    hide sym
                    with dissolve
                    show sy23
                    with dissolve
                    sy23 "不好意思,同学"
                    sy23 "妍妍就是心直口快"
                    n "嗯"
                    jump dasushe


label xcsushe:
    scene qs2
    stop music
    scene qs2
    play music "audio/weiji.mp3"
    show n1 at left
    with dissolve
    show sy23 at right
    with dissolve
    sy23 "哈喽,同学你哪里来的?"
    hide sy23
    show sym
    sy1 "刚刚来帮你搬行李的是你男朋友吗?"
    menu:
        "回答妍妍的话"
        "不是不是,你误会了":
            sy1 "哦哦"
            sy1 "我就说"
            menu:
                "你回答什么?"
                "嗯嗯":
                    jump dasushe
                "哦!":
                    jump dasushe
        "对呀,帅吧?":
            sy1 "真的假的?"
            menu:
                "真的!":
                    sy1 "哦哦"
                "骗你们的!":
                    sy1 "我就说"
                "发脾气":
                    n "干嘛对别人的隐私这么伤心"
                    n "你是没有家人吗?"
                    n "企图在别人这里获得认同感?"
                    sy1 "对不起,对不起"
                    hide sym
                    with dissolve
                    show sy23
                    with dissolve
                    sy23 "不好意思,同学"
                    sy23 "妍妍就是心直口快"
                    n "嗯"
                    jump dasushe
            
        "甩脸色!":
            sy1 "你干嘛不回答我?"
            sy1 "喂!问你话呢!"
            menu:
                "怎么回答?"
                "关你什么事":
                    n "跟你有什么关系?"
                    n "想不开,就挂个牌子出去站街!"
                    sy1 "不说就不说嘛,骂人干什么!"
                    hide sym
                    with dissolve
                    show sy23
                    with dissolve
                    sy23 "不好意思,同学"
                    sy23 "妍妍就是心直口快"
                    n "嗯"
                    jump dasushe


label sushe:
    scene qs2
    stop music
    scene qs2
    play music "audio/weiji.mp3"
    show n1 at left
    with dissolve
    show sy23 at right
    with dissolve
    sym "哈喽,同学你哪里来的?"
    menu:
        "热情的打招呼":
                n "我就是光启市本地人呀!"
                "拿出特产"
                n "家里带的希望你们别嫌弃"
                sy1 "哇!怎么这么小?"
                sy1 "你带这么小的东西来吃?"
                menu:
                    "就是这样的":
                        sy1 "好吧,我还是去吃我的金丝燕窝"
                        sy1 "喂!同学要不要吃点"
                        menu:
                            "发脾气":
                                n "哇!那可太棒了"
                                n "你站街站来的?"
                                sy1 "不说就不说嘛,骂人干什么!"
                                hide sym
                                with dissolve
                                show sy23
                                with dissolve
                                sy23 "不好意思,同学"
                                sy23 "妍妍就是心直口快"
                                n "嗯"
                                jump dasushe
                            "敷衍过去":
                                n "哦~"
                                jump dasushe
        "敷衍过去":
            jump dasushe


label dasushe:
    n "我先整理床铺"
    jump live1



label live1:
    stop music
    show screen black with dissolve
    pause 2.0
    hide screen black with dissolve
    $ week += 1
    $ action_point = 3  
    jump real

label real: 
    play music "audio/cafe.mp3" 
    if action_point == 0:
        jump xun
    while action_point > 0:        
        scene black
        show qs2
        show n1 at left
        menu:
            "还有[action_point]次行动机会\n你要去哪里?"
            "去上课吧!":
                $ study += 1
                $ bite += 1
                $ tdc = True
                $ action_point -= 1
                jump cm
            "去健身房":
                $ bite += 2
                $ power += 5
                $ action_point -= 1
                jump real
            "去篮球场":
                $ bite += 2
                $ action_point -= 1
            "去钢琴房":
                $ art += 2
                $ bite += 2
                $ action_point -= 1
                jump real
            "去商店":
                jump real
                $ action_point -= 1
            "去图书馆":
                $ bite += 2
                $ study += 2
                $ action_point -= 1
                jump real
            "去兼职打工":
                $ money += 100
                $ action_point -= 1
                jump real
            "打开手机":
                $ action_point -= 1
                menu:
                    "你要打给谁?"
                    "父母":
                        $ bite += 5
                        $ bmq += 1
                        menu:
                            "向父母要钱":
                                "爸爸转了你500块"
                                "好好吃饭呀,乖乖!"
                                $ money += 500
                                if bmq == 5:
                                    jump que 
                                else:
                                    jump real
                            "聊家常":
                                "要好好吃饭"
                                "没钱了,就和我们说"
                                "爸爸妈妈有的是钱~"
                                jump real

                    # "萧逸" if xlove >= 50:
                    # "查理苏" if clove >= 50:
                    # "齐司礼" if qlove >= 50:

label que:
    "怎么啦,乖乖"
    "很缺钱嘛,爸爸妈妈来学校看看你"
    jump real 
    
label xun:    
    if tdc == False:
        $ kk += 1
    if kk > 3:
        jump xiuxue 
    if week > 16:
        $ grade += 1
        $ week = 1
        $ tdc = False  
        "大[grade]啦!"
        jump live1
    elif tdc == False:
        "你已经旷了一节课了,请注意"
        "旷课超过3次,你将被劝退!"
        jump live1

label xiuxue:
    scene fm
    "你因为旷课太多,被劝退回家了!"
    return

        
label cm:
    scene class
    with dissolve
    $ fate = renpy.random.randint(1,100)
    if fate <= 50:
        jump ts
    else:
        "你度过了一节平平无奇的水课"
        jump real

label ts:
    scene class
    show n1 at left
    $ sj = renpy.random.choice(["老师抽到你回答问题","同学问你借草稿纸","这节课文思如泉涌,认真学习了"])
    if sj == "老师抽到你回答问题":
        "你叫[name]是吗"
        "布尔值是什么意思?"
        menu:
            "乱蒙一个":
                "全班同学发出咯咯咯的笑声"
                jump real
            "沉默":
                "老师生气的让你坐下,讲完了这道题"
                jump real
            "含糊的回答" if study >= 100:
                $ study += 5
                n "就是...呃呃,对。"
                "老师叹了口气,坐下吧"
                jump real 
            "流畅的回答问题" if study >= 300:
                $ study += 10
                $ xlove += 10
                $ clove += 10
                $ qlove += 10
                n "布尔值就是turn和false"
                "[name理解的不错,大家都要向她多学习学习!]"
                jump real
    elif sj == "同学问你借草稿纸":
        show xz at right
        show n1 at left
        x "你好同学,我们又见面了"
        x "能不能借我几张纸呀?"
        menu:
            "给他草稿纸":
                n "给你!"
                xz "谢谢!"
                $ xlove += 10
                jump real
            "给他卫生纸":
                $ xlove += 20
                n "给!"
                xz "啊!"
                xz "我要的是草稿纸"
                menu:
                    "给他草稿纸":
                        xz "谢谢"
                        $ xlove += 10
                        jump real
                    "就只有这个":
                        n "不好意思同学"
                        n "我只有这个"
                        xz "好吧,谢谢!"
                        $ xlove -= 10
                        jump real  
            "不借":
                n "不好意思"
                n "我也没带草稿纸!"
                xz "好吧,谢谢!"
                $ xlove -= 10
                jump real
    else:
        n "这节课还挺容易的"
        "你学会了许多知识"
        $ study += 50
        jump real
            


            


    











    










































    
    
    

回复 支持 抱歉

使用道具 举报

 楼主| 发表于 3 天前 | 显示全部楼层

不用了,大佬,我自己看到了,我自己没有加如果是tdc = ture会怎么样
回复 支持 抱歉

使用道具 举报

 楼主| 发表于 前天 16:25 | 显示全部楼层
已解决!
自己忽略了一种情况!
回复 支持 抱歉

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|RenPy中文空间 ( 苏ICP备17067825号|苏公网安备 32092302000068号 )

GMT+8, 2025-4-19 10:16 , Processed in 0.079782 second(s), 28 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表