// 过关
levelup = function(){
if(level<gametime.length-1){
level ++;
setHtml('level', level);
start();
}else{
clear();
}
}
// 全部通关
clear = function(){
level = 1;
disp('levelplane','hide');
disp('process', 'hide');
setHtml('gameplane','');
message('clear',init);
}
// 音乐播放
bgsound = function(file, loop){
var id = 'audioplayer';
if(typeof(file)!='undefined'){
if(typeof(loop)=='undefined'){
loop = false;
}
var audiofile = [];
audiofile['mp3'] = 'music/' + file + '.mp3';
audiofile['ogg'] = 'music/' + file + '.ogg';
audioplayer(id, audiofile, loop);
}else{
audioplayer(id);
}
}
// 游戏玩法
tips = function(type){
disp('tips', type);
}
// 获取牌总数
get_total = function(){
return total;
}
// 重置参数
reset = function(){
disp('levelplane','show');
setHtml('level', level);
disp('process', 'show');
setHtml('livetime', '');
setHtml('gameplane', '');
is_lock = 1;
is_over = 0;
first = -1;
matchnum = 0;
}
return this;
})(42,9);
JS实现仙剑翻牌记忆力小游戏源码可以到Linux公社资源站下载:
------------------------------------------分割线------------------------------------------
具体下载目录在 /2017年资料/2月/5日/JS实现仙剑翻牌记忆力小游戏/
------------------------------------------分割线------------------------------------------