设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 533|回复: 7
打印 上一主题 下一主题

[有事请教] 怎么设置游戏通关后,更改标题界面的音乐呢?

[复制链接]

Lv4.逐梦者

梦石
0
星屑
5637
在线时间
411 小时
注册时间
2021-12-4
帖子
447
1
发表于 2023-9-2 10:23:24 | 显示全部楼层
https://rpg.blue/forum.php?mod=r ... amp;fromuid=2731820
可以参考我之前给别人的回答,他是通关后改变标题画面背景图片。
(function() {
ConfigManager.makeData = function() {
    const config = {};
    config.alwaysDash = this.alwaysDash;
    config.commandRemember = this.commandRemember;
    config.touchUI = this.touchUI;
    config.bgmVolume = this.bgmVolume;
    config.bgsVolume = this.bgsVolume;
    config.meVolume = this.meVolume;
    config.seVolume = this.seVolume;
    config.newGamePlus = this.newGamePlus; // 本行为新增内容,表示是否已通关一周目
    return config;
};
ConfigManager.applyData = function(config) {
    this.alwaysDash = this.readFlag(config, "alwaysDash", false);
    this.commandRemember = this.readFlag(config, "commandRemember", false);
    this.touchUI = this.readFlag(config, "touchUI", true);
    this.bgmVolume = this.readVolume(config, "bgmVolume");
    this.bgsVolume = this.readVolume(config, "bgsVolume");
    this.meVolume = this.readVolume(config, "meVolume");
    this.seVolume = this.readVolume(config, "seVolume");
    this.newGamePlus = this.readFlag(config, 'newGamePlus'); // 本行为新增内容,表示是否已通关一周目
};
Scene_Title.prototype.playTitleMusic = function() {
    if (ConfigManager.newGamePlus) {
        $dataSystem.titleBgm = {"name":"Theme4","pan":0,"pitch":100,"volume":90};
    } // 以上为新增内容,Theme4为通关后的音乐
    AudioManager.playBgm($dataSystem.titleBgm);
    AudioManager.stopBgs();
    AudioManager.stopMe();
}
})();
然后,在通关事件里,使用如下两行脚本:
ConfigManager.newGamePlus = true; // 标记已完成一周目通关
ConfigManager.save(); // 和四个音量等一起保存到配置文件里
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-21 19:03

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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