-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2.把核心和其他类移动至module文件夹,分模块的思想 3.修改了Dialog绑定功能的代码,使用事件队列和遍历来实现同一个index要执行不同代码的功能 如在第二句话时,同时切换bgm和人物 4.预计要添加存档API但是,由于存档功能在另外一个界面,所以使用cookie来临时存储进度,但是有bug,todo 5.localStorage存档作用于每个独立的html文件,不可以通用/目录,但cookie可以,所以,后续可能做一个存档和读档中心.html,把存档读档功能做在一个界面里面就行了。
- Loading branch information
1 parent
ec8852a
commit 2375c31
Showing
17 changed files
with
117 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
$(function() | ||
{ | ||
var file=new FileSystem() | ||
alert("请先点击开始按钮来播放背景音乐,由于浏览器安全设置,不能自动播放,点击人物,也能开始播放音乐") | ||
function initUI() | ||
{ | ||
$("#end").click(function() | ||
{ | ||
changeScene("../index.html") | ||
}) | ||
$("#start").click(function() | ||
{ | ||
$("#bgm")[0].play() | ||
}) | ||
$("#loadGame").click(function() | ||
{ | ||
changeScene("../Load.html") | ||
}) | ||
} | ||
initUI() | ||
|
||
var Engine=new EasyAvg() | ||
// NOTE: 需要先创建背景 | ||
var bg=Engine.create_img("../img/bg.jpg","背景") | ||
var koyomi=Engine.create_img("../img/char.png","小夜美") | ||
console.warn("#设置bgm音量"); | ||
$("#bgm")[0].volume=0.5 | ||
//改变人物动作 参数是第几个段落 index从0开始 | ||
//var koyomi_2=Engine.create_img("k18.png","k") | ||
koyomi.css("margin-left","500px") | ||
koyomi.css("margin-top","20px") | ||
koyomi.click(function() | ||
{ | ||
alert("点击了人物,开始播放音乐") | ||
$("#bgm")[0].play() | ||
}) | ||
var dialog=Engine.create_Dialog() | ||
var text=['喂!?一爬起来就趴下可不成啊','今天第一节课是小考,所以昨天不是说好了要教我功课的吗','说好的了吧',"真是的,再不快点起来我会很困扰的啊"] | ||
dialog.setContent(text) | ||
dialog.setDebugLog(true) | ||
//定义人物图片变化,定义bgm变化 | ||
dialog.changeImgAt(2,koyomi,"../img/k18.png") | ||
dialog.changeBgmAt(2,"../bgm/i72008_momoiro_cherry.ogg") | ||
var action=function MyFinishAction() | ||
{ | ||
console.warn("#游戏结束#,来自逻辑层代码"); | ||
alert("结束") | ||
changeScene("../index.html") | ||
} | ||
dialog.setFinishAction(action) | ||
Engine.create_BackroundImg(bg) | ||
$("body").append(bg) | ||
$("body").append(koyomi) | ||
$("body").append(dialog) | ||
// NOTE: 绑定按钮code 存档 | ||
function bindingButtonAction(dialog) | ||
{ | ||
$("#saveGame").click(function() | ||
{ | ||
console.warn("##存档!"); | ||
//在跳转存档页面之前,先暂存游戏运行状态执行到哪一个句子的index | ||
var index=dialog.getRuntimeIndex() | ||
console.warn("#运行状态"+index); | ||
$.cookie('runTimeIndex',index,{path:'/'}) | ||
//localStorage.setItem("test","test1ad3s1") | ||
//file.save("runTimeIndex",index) | ||
changeScene("../save.html") | ||
}) | ||
} | ||
bindingButtonAction(dialog) | ||
}) |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,6 @@ ol | |
} | ||
li | ||
{ | ||
background-color: black; | ||
background-color: grey; | ||
margin-top: 5px; | ||
} |
File renamed without changes
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.