10 Commits

Author SHA1 Message Date
b9dc8b7105 fix: 修复一个错误 2026-02-26 22:38:23 +08:00
47f1733a95 feat: 增加了2个游戏背景音乐 2026-02-26 22:29:46 +08:00
230e5f8892 refactor: 将下课铃修改为ogg格式 2026-02-26 16:12:27 +08:00
4a348e578b 添加:主菜单背景音乐 2026-02-26 16:09:55 +08:00
2e273a782c 解决冲突:保留CLAUDE.md 2026-02-26 13:15:05 +08:00
b5452a0a8a 忽略编译的文件 2026-02-26 13:11:06 +08:00
890dea326d 忽略.rpymc 2026-02-26 13:02:35 +08:00
ec39996d7c 修改网页版加载界面 2026-02-26 13:00:07 +08:00
d2da64618a 删除重复的mac包 2026-02-26 12:59:49 +08:00
7bf578b6b0 删除错误的“语法错误判断” 2026-02-26 12:59:10 +08:00
13 changed files with 130 additions and 4 deletions

1
.gitignore vendored
View File

@@ -3,6 +3,7 @@
# ============================================= # =============================================
*.rpyc *.rpyc
*.rpyb *.rpyb
*.rpymc
game/cache/ game/cache/
game/saves/ game/saves/
game/temp/ game/temp/

95
CLAUDE.md Normal file
View File

@@ -0,0 +1,95 @@
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Project Overview
**莘澜日记 (XinLanDiary)** 是一款使用 Ren'Py 引擎开发的中文视觉小说游戏,当前版本 dev0.0.6,由 RYT Studio 制作。游戏以校园为背景,通过多角色关系数值追踪和多视角叙事推动剧情。
## 开发环境与运行
本项目没有传统的构建脚本。开发和构建均通过 **Ren'Py SDK** 完成:
```bash
# 在开发模式下运行游戏(需要安装 Ren'Py SDK
/path/to/renpy.sh /Users/lipeng/Documents/projects/XinLanDiary-b2-dev
# 检查脚本语法错误Ren'Py 会在启动时自动编译 .rpy 文件)
# 错误日志位于game/traceback.txt 和 log.txt
```
构建多平台发行版需通过 Ren'Py 启动器 GUI 操作,配置见 `project.json``android.json`
## 项目架构
### 核心文件
| 文件 | 作用 |
|------|------|
| `game/script.rpy` | 入口点角色定义、变换效果、start 标签跳转 |
| `game/options.rpy` | 游戏配置:版本、音频、转场、存档目录 |
| `game/screens.rpy` | UI/屏幕布局1622行 |
| `game/gui.rpy` | GUI 样式配置,分辨率 1920x1080 |
| `game/Chapters/Chapter1.rpy` | 第一章剧情脚本 |
| `剧情/Chapter1.txt` | 剧情草稿(中文原稿) |
### 角色系统
所有角色在 `game/script.rpy` 中定义。每个角色有专属颜色、发言速度和独立的关系数值字典。
**主要角色速查表**
| 变量名 | 全名 | 颜色 | 独特数值 |
|--------|------|------|----------|
| `me` | 任懿涛(主角) | #71b4e4 | selfAcceptance, humorSense, studyStress (0-10) |
| `xingyu` | 陈星宇 | #cff3ff | affection, cooperation, helpfulness (0-100) |
| `lhy` | 刘泓予 | #ffc052 | affection, trust, empathy (0-100) |
| `lzx` | 李泽瑄 | #631e2c | infoOpenness (0-10),神秘角色 |
| `xiaowei` | 林晓薇 | #f4a7b9 | affection, synergy, interactionFrequency网络ID薇风拂晓 |
| `yutong` | 苏雨桐 | #69cae7 | affection, attention, academicSupport |
| `yh` | 颜涵 | #d4b8e0 | affection, understanding, support |
| `xwhy` | 徐卫浩宇 | #9dffdb | affection, reliance, helpfulness |
**数值定义模式**
```python
default {char}_stats = {
"{stat_name}": 0, # 说明
}
```
### 场景与标签规范
- 场景入口:`label Chapter{#}_Scene{#}:`
- 背景命名:`bg_{地点}_{光照}_{特殊}`(如 `bg_classroom_morning`
- 角色素材:`{缩写}_{状态}`(如 `ryt_normal`, `lhy_embarrassed`
- 网络身份后缀:`_w`(如 `xiaowei_w`, `me_w`
### 核心叙事机制
- **多视角切换**:第三场景从主角视角切换至苏雨桐、林晓薇视角
- **关系数值驱动分支**:玩家选择同时影响多个角色的多项数值
- **隐藏数值**`h_` 前缀(如 `h_academicSupport`)用于更精细的关系追踪
- **剧情内社交媒体**:包含论坛帖子和私信场景
### 变换效果Transforms
`script.rpy` 中定义的常用变换:
- `shake_rotate` — 抖动旋转动画0.5秒)
- `slide_right(distance, duration)` — 向右滑动
- `zoom_to_upper_right` — 镜头缩放并移向右上角
- `c1s2_ryt_pos`, `c1s4_ryt_pos` — 特定场景角色定位
## 多平台构建配置
- **macOS**`project.json`当前激活force_recompile=true
- **Android**`android.json`(横屏锁定,包名 `com.rytstudio.xinlandiary`,堆内存 3GB
- **Web/其他**:通过 Ren'Py launcher 配置
## 错误排查
运行时错误日志:
- `game/log.txt` — 运行日志
- `game/traceback.txt` — 崩溃堆栈
- `game/errors.txt` — 编译错误
Ren'Py 在启动时自动将 `.rpy` 编译为 `.rpyc`,语法错误会阻止游戏启动并写入上述日志。

View File

@@ -3,15 +3,17 @@
label Chapter1_Scene1: label Chapter1_Scene1:
scene bg classroom featryt with fade scene bg classroom featryt with fade
me "{cps=25}九月的风还带着夏末的燥热,那道斜切过窗台的阳光,在黑板上画出一道明晃晃的线。\n就像我的人生被分成了两半——线的那头是重点班线的这头是我。" me "{cps=25}九月的风还带着夏末的燥热,那道斜切过窗台的阳光,在黑板上画出一道明晃晃的线。\n就像我的人生被分成了两半——线的那头是重点班线的这头是我。"
me "这道光就这么直直地切过来,像是在提醒我,你就在这儿,也只能在这儿了。\n曾经唾手可得如今遥不可及。" me "这道光就这么直直地切过来,像是在提醒我,你就在这儿,也只能在这儿了。\n曾经唾手可得如今遥不可及。"
pause 0.5 pause 0.5
show xingyu thinking at left
show xingyu thinking at left
xingyu "涛哥,你咋又对着黑板发呆?" xingyu "涛哥,你咋又对着黑板发呆?"
play music "audio/XinLanDiary-Part1.ogg" fadein 2
show xingyu laughing show xingyu laughing
xingyu "该不会是在研究光线折射角度吧?" xingyu "该不会是在研究光线折射角度吧?"
hide xingyu hide xingyu
@@ -35,7 +37,9 @@ label Chapter1_Scene1:
show xingyu laughing big show xingyu laughing big
xingyu "{cps=5}哈哈哈哈哈{cps=15}\n真是一对苦命鸳鸯" xingyu "{cps=5}哈哈哈哈哈{cps=15}\n真是一对苦命鸳鸯"
play sound "audio/xiakering.mp3" stop music fadeout 1.0
play sound "audio/AfterClassRing.ogg" noloop
queue sound "audio/MainMenu.ogg" fadein 1.0
scene bg black with fade scene bg black with fade
pause 1.0 pause 1.0
scene bg playground twilight scene bg playground twilight
@@ -52,6 +56,7 @@ label Chapter1_Scene1:
stop sound fadeout 1.0 stop sound fadeout 1.0
hide xingyu with dissolve hide xingyu with dissolve
play music "audio/MainMenu.ogg" fadein 1.0
me "那声'起义'在心里荡开了一个小涟漪。" me "那声'起义'在心里荡开了一个小涟漪。"
me "他说得对——但说出口的代价,比他想的要重得多。" me "他说得对——但说出口的代价,比他想的要重得多。"
@@ -68,6 +73,7 @@ label Chapter1_Scene1:
show ryt dialogue embarrass pocket at center with dissolve show ryt dialogue embarrass pocket at center with dissolve
me "三张连拍……全程记录,还加了学术注释。行吧,就是个玩笑。" me "三张连拍……全程记录,还加了学术注释。行吧,就是个玩笑。"
hide ryt with dissolve hide ryt with dissolve
stop music fadeout 1.0
$ lhy_stats["affection"] += 3 $ lhy_stats["affection"] += 3
$ lhy_stats["trust"] += 2 $ lhy_stats["trust"] += 2
@@ -80,6 +86,7 @@ label Chapter1_Scene1:
label Chapter1_Scene2: label Chapter1_Scene2:
scene bg classroom morning featryt with fade scene bg classroom morning featryt with fade
play music "audio/XinLanDiary-Part1.ogg" fadein 2
#system_ "【第二天早上】" #system_ "【第二天早上】"
me "第二天早上,一切都不一样了。" me "第二天早上,一切都不一样了。"
@@ -111,12 +118,14 @@ label Chapter1_Scene2:
me "深吸一口气——经过八班队列时,我故意做了个跳起来打空气的动作,表情夸张。" me "深吸一口气——经过八班队列时,我故意做了个跳起来打空气的动作,表情夸张。"
hide ryt with dissolve hide ryt with dissolve
tongxue "哈哈哈哈——" tongxue "哈哈哈哈——"
stop music fadeout 1.0
me "果然,又是一阵笑声。" me "果然,又是一阵笑声。"
me "我的那层盔甲还在。 对吗?" me "我的那层盔甲还在。 对吗?"
pause 0.3 pause 0.3
# 关键场景:刘泓予看穿 # 关键场景:刘泓予看穿
play music "audio/MainMenu.ogg" fadein 2.0
show lhy dialogue normal at right with dissolve show lhy dialogue normal at right with dissolve
lhy "你刚才那个假动作面部肌肉的紧张程度是平时的1.3倍。" lhy "你刚才那个假动作面部肌肉的紧张程度是平时的1.3倍。"
show ryt dialogue embarrass pocket at left with dissolve show ryt dialogue embarrass pocket at left with dissolve
@@ -130,6 +139,8 @@ label Chapter1_Scene2:
me "但不知道为什么,被他这么一说……我反而松了口气。" me "但不知道为什么,被他这么一说……我反而松了口气。"
me "有人看见了,但没有嘲笑。只是……记录。" me "有人看见了,但没有嘲笑。只是……记录。"
#stop music fadeout 1.0
$ lhy_stats["affection"] += 5 $ lhy_stats["affection"] += 5
$ lhy_stats["trust"] += 5 $ lhy_stats["trust"] += 5
$ lhy_stats["empathy"] += 3 $ lhy_stats["empathy"] += 3
@@ -167,6 +178,8 @@ label Chapter1_Scene3:
yutong "我那天递给他的纸条上可不仅写了“恭喜”二字……" yutong "我那天递给他的纸条上可不仅写了“恭喜”二字……"
yutong "这句话,他没有回应。\n 或许他根本就没有看见……" yutong "这句话,他没有回应。\n 或许他根本就没有看见……"
stop music fadeout 1.0
$ yutong_stats["affection"] += 3 $ yutong_stats["affection"] += 3
$ yutong_stats["attention"] += 5 $ yutong_stats["attention"] += 5
$ yutong_stats["h_academicSupport"] += 1 $ yutong_stats["h_academicSupport"] += 1
@@ -174,6 +187,7 @@ label Chapter1_Scene3:
pause 0.5 pause 0.5
# —— 视角B林晓薇·高二一班走廊 —— # —— 视角B林晓薇·高二一班走廊 ——
play music "audio/XinLanDiary-Part1.ogg" fadein 2.0
scene bg corridor with dissolve scene bg corridor with dissolve
"【同日下午·高二一班走廊】" "【同日下午·高二一班走廊】"
@@ -183,11 +197,13 @@ label Chapter1_Scene3:
xiaowei "拍得好生动啊!你们说,要是我也这样跳起来打人,会不会也这么有效果?" xiaowei "拍得好生动啊!你们说,要是我也这样跳起来打人,会不会也这么有效果?"
tongxue "哈哈哈哈!" tongxue "哈哈哈哈!"
hide xiaowei with dissolve hide xiaowei with dissolve
stop music fadeout 1.0
"{cps=20}她笑着,眼睛却没有离开屏幕。" "{cps=20}她笑着,眼睛却没有离开屏幕。"
"{cps=20}那种真实的活力,让她觉得……在礼貌而疏离的文科班里,有什么东西被触动了。" "{cps=20}那种真实的活力,让她觉得……在礼貌而疏离的文科班里,有什么东西被触动了。"
#system_ "【切换账号:薇风拂晓】" #system_ "【切换账号:薇风拂晓】"
play music "audio/XinLanDiary-Part1.ogg" fadein 2.0
scene bg classroom phone closeup with dissolve scene bg classroom phone closeup with dissolve
system_ "好友列表:逍遥剑客 [[在线]" system_ "好友列表:逍遥剑客 [[在线]"
xiaowei_w "在吗?问个事。你们学校是不是有个挺搞笑的人?最近好像因为什么照片火了。" xiaowei_w "在吗?问个事。你们学校是不是有个挺搞笑的人?最近好像因为什么照片火了。"
@@ -202,6 +218,7 @@ label Chapter1_Scene3:
me "任懿涛正背对门口,和陈星宇比划着什么。大概又是游戏攻略。" me "任懿涛正背对门口,和陈星宇比划着什么。大概又是游戏攻略。"
hide ryt with dissolve hide ryt with dissolve
hide xingyu with dissolve hide xingyu with dissolve
stop music fadeout 1.0
$ xiaowei_stats["affection"] += 4 $ xiaowei_stats["affection"] += 4
$ xiaowei_stats["interactionFrequency"] += 2 $ xiaowei_stats["interactionFrequency"] += 2
@@ -210,6 +227,7 @@ label Chapter1_Scene3:
jump Chapter1_Scene4 jump Chapter1_Scene4
label Chapter1_Scene4: label Chapter1_Scene4:
play music "audio/MainMenu.ogg" fadein 2.0
scene bg classroom wide afterschool with fade scene bg classroom wide afterschool with fade
"{cps=20}【同日放学后·七班教室】" # system_ "【同日放学后·七班教室】" "{cps=20}【同日放学后·七班教室】" # system_ "【同日放学后·七班教室】"
@@ -250,6 +268,7 @@ label Chapter1_Scene4:
hide ryt with dissolve hide ryt with dissolve
# 反侦察行动 # 反侦察行动
play music "audio/XinLanDiary-Part1.ogg" fadein 2.0
show xingyu at left with dissolve show xingyu at left with dissolve
xingyu "各位!我有个绝妙的主意——" xingyu "各位!我有个绝妙的主意——"
xingyu "既然那个画廊这么喜欢拍涛哥,咱们不如搞个「反侦察行动」!" xingyu "既然那个画廊这么喜欢拍涛哥,咱们不如搞个「反侦察行动」!"
@@ -260,9 +279,12 @@ label Chapter1_Scene4:
xingyu "哎呀小卡你别扫兴!就是玩嘛!涛哥,你说干不干?" xingyu "哎呀小卡你别扫兴!就是玩嘛!涛哥,你说干不干?"
hide lhy with dissolve hide lhy with dissolve
stop music fadeout 0.8
show ryt dialogue normal at right with dissolve show ryt dialogue normal at right with dissolve
me "看着眼前这群人。认识不过一个多月——但他们就这么凑过来,商量这种无聊又有趣的计划。" me "看着眼前这群人。认识不过一个多月——但他们就这么凑过来,商量这种无聊又有趣的计划。"
me "在重点班时,从来没有过这样的时刻。" me "在重点班时,从来没有过这样的时刻。"
play music "audio/XinLanDiary-Part1.ogg" fadein 1.0
me "行啊!但咱们得专业!要有分工!有排班表!有应急预案!还要有——" me "行啊!但咱们得专业!要有分工!有排班表!有应急预案!还要有——"
hide ryt with dissolve hide ryt with dissolve
hide xingyu with dissolve hide xingyu with dissolve
@@ -275,6 +297,7 @@ label Chapter1_Scene4:
yh "我负责记录你们的失败过程。" yh "我负责记录你们的失败过程。"
hide yh with dissolve hide yh with dissolve
tongxue "哈哈哈哈哈!" tongxue "哈哈哈哈哈!"
stop music fadeout 1.0
show ryt dialogue normal at right with dissolve show ryt dialogue normal at right with dissolve
me "我也跟着笑。但眼睛不自觉地望向窗外。" me "我也跟着笑。但眼睛不自觉地望向窗外。"
@@ -294,6 +317,7 @@ label Chapter1_Scene4:
pause 0.5 pause 0.5
# 便利店 # 便利店
play music "audio/XinLanDiary-Part2.ogg" fadein 2.0
scene bg convenience store with fade scene bg convenience store with fade
system_ "【傍晚17:25·校门外便利店】" system_ "【傍晚17:25·校门外便利店】"

Binary file not shown.

BIN
game/audio/MainMenu.ogg Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -69,7 +69,7 @@ define config.has_voice = False
## 将以下语句取消注释就可以设置标题界面播放的背景音乐文件。此文件将在整个游戏中 ## 将以下语句取消注释就可以设置标题界面播放的背景音乐文件。此文件将在整个游戏中
## 持续播放,直至音乐停止或其他文件开始播放。 ## 持续播放,直至音乐停止或其他文件开始播放。
# define config.main_menu_music = "main-menu-theme.ogg" define config.main_menu_music = "audio/MainMenu.ogg"
## 转场 ########################################################################## ## 转场 ##########################################################################

View File

@@ -113,10 +113,14 @@ transform zoom_to_upper_right:
# 快速放大并向左下偏移(画面看起来往右上移动) # 快速放大并向左下偏移(画面看起来往右上移动)
ease 0.3 zoom 1.7 xalign 0.6 yalign 0.2 ease 0.3 zoom 1.7 xalign 0.6 yalign 0.2
#label before_main_menu:
# $ renpy.music.play("andio/MainMenu.ogg", loop=True, fadein=2.0)
# 游戏在此开始。 # 游戏在此开始。
label start: label start:
# stop music fadeout 1.0
jump Chapter1_Scene1 jump Chapter1_Scene1
# 此处为游戏结尾。 # 此处为游戏结尾。

Binary file not shown.

View File

@@ -1,7 +1,9 @@
{ {
"build_update": false, "build_update": false,
"packages": [ "packages": [
"mac" "mac",
"linux",
"win"
], ],
"add_from": true, "add_from": true,
"force_recompile": true, "force_recompile": true,

BIN
web-presplash.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 KiB