项目地址
https://github.com/mangenotwork/HABL-H5
基于 lufylegend 开发
lufylegend 框架官网 : http://www.lufylegend.com/
lufylegend是一个兼容性极高,功能极多,使用方便的HTML5游戏引擎。
玩家信息
var user_info_data = {
user_gongji_wuli : "100",
user_fangyu_wuli : "500",
user_fangyu_mofa : "151",
user_hp_max : "500",
user_ep_max : "151",
user_lilang : "500",
user_mingjie : "151",
user_jingli : "151",
user_baoji : "100%",
user_shanbi : "100%",
user_xixue : "100%",
user_migzhong : "100%",
user_huo : "100%",
user_shui : "100%",
user_tu : "100%",
user_mu : "100%",
user_jin : "100%",
user_zb_image : {name:"zb_1",path:"../ui/login/zb_1.jpg"},
user_zb_tou_presence : true,
user_zb_tou_image : {name:"zb_tou",path:"../ui/login/zb_1.jpg"},
user_zb_guanghuan_presence : false,
user_zb_guanghuan_image : {name:"zb_guanghuan",path:"../ui/login/zb_1.jpg"},
user_zb_xianglian_presence : true,
user_zb_xianglian_image : {name:"zb_xianglian",path:"../ui/login/zb_1.jpg"},
user_zb_shangshen_presence : false,
user_zb_shangshen_image : {name:"zb_shangshen",path:"../ui/login/zb_1.jpg"},
user_zb_wuqi_presence : true,
user_zb_wuqi_image : {name:"zb_wuqi",path:"../ui/login/zb_1.jpg"},
user_zb_zhuangshi_presence : false,
user_zb_zhuangshi_image : {name:"zb_zhuangshi",path:"../ui/login/zb_1.jpg"},
user_zb_jiezhi_presence : true,
user_zb_jiezhi_image : {name:"zb_jiezhi",path:"../ui/login/zb_1.jpg"},
user_zb_xiashen_presence : true,
user_zb_xiashen_image : {name:"zb_xiashen",path:"../ui/login/zb_1.jpg"},
user_zb_fushou_presence : false,
user_zb_fushou_image : {name:"zb_fushou",path:"../ui/login/zb_1.jpg"},
user_zb_xiezhi_presence : true,
user_zb_xiezhi_image : {name:"zb_xiezhi",path:"../ui/login/zb_1.jpg"},
}
function set_user_info_imgData(){
var userimgData = new Array();
userimgData.push(user_info_data.user_zb_image);
if(user_info_data.user_zb_tou_presence){
userimgData.push(user_info_data.user_zb_tou_image);
}
if(user_info_data.user_zb_guanghuan_presence){
userimgData.push(user_info_data.user_zb_guanghuan_image);
}
if(user_info_data.user_zb_xianglian_presence){
userimgData.push(user_info_data.user_zb_xianglian_image);
}
if(user_info_data.user_zb_shangshen_presence){
userimgData.push(user_info_data.user_zb_shangshen_image);
}
if(user_info_data.user_zb_wuqi_presence){
userimgData.push(user_info_data.user_zb_wuqi_image);
}
if(user_info_data.user_zb_zhuangshi_presence){
userimgData.push(user_info_data.user_zb_zhuangshi_image);
}
if(user_info_data.user_zb_jiezhi_presence){
userimgData.push(user_info_data.user_zb_jiezhi_image);
}
if(user_info_data.user_zb_xiashen_presence){
userimgData.push(user_info_data.user_zb_xiashen_image);
}
if(user_info_data.user_zb_fushou_presence){
userimgData.push(user_info_data.user_zb_fushou_image);
}
if(user_info_data.user_zb_xiezhi_presence){
userimgData.push(user_info_data.user_zb_xiezhi_image);
}
return userimgData;
}
var user_info_imgData = set_user_info_imgData();
function userinfo_Layer_show(){
apply_button = true;
loadingLayer1 = new LoadingSample4();
addChild(loadingLayer1);
LLoadManage.load(user_info_imgData,
function(progress){
loadingLayer1.setProgress(progress);
},userinfo_Layer_show_init);
}
function userinfo_Layer_show_init(result){
var userinfo_dataList = result;
removeChild(loadingLayer1);
loadingLayer1 = null;
KEY_lock = false;
userinfo_Layer = new LSprite();
backLayer.addChild(userinfo_Layer);
var userinfo_bk_bitmap = new LBitmap(new LBitmapData(dataList["user_info_pg1"]));
userinfo_bk_bitmap.x = 50;
userinfo_bk_bitmap.y = 50;
userinfo_Layer.addChild(userinfo_bk_bitmap);
var userinfo_Layer_title = new LTextField();
userinfo_Layer_title.text = " 玩家信息界面 ";
userinfo_Layer_title.size = 20
userinfo_Layer_title.color = "#53FF53";
userinfo_Layer_title.x = 180;
userinfo_Layer_title.y = 80;
userinfo_Layer.addChild(userinfo_Layer_title);
var off_button_show = new LSprite();
userinfo_Layer.addChild(off_button_show);
var off_button = new LButtonSample1(" 关闭 ",12);
off_button.backgroundColor = "#EA0000";
off_button.width = 15;
off_button.height = 12;
off_button.x = 350;
off_button.y = 80;
off_button_show.addChild(off_button);
off_button_show.addEventListener(LMouseEvent.MOUSE_UP,off_addation);
var username_title = new LTextField();
username_title.text = " 玩家姓名 ";
username_title.size = 18
username_title.color = "#fff";
username_title.x = 120;
username_title.y = 120;
userinfo_Layer.addChild(username_title);
var userlv_title = new LTextField();
userlv_title.text = " 10 级 ";
userlv_title.size = 18
userlv_title.color = "#fff";
userlv_title.x = 280;
userlv_title.y = 120;
userinfo_Layer.addChild(userlv_title);
var userchenghao_title = new LTextField();
userchenghao_title.text = " [ 战斗神 ] ";
userchenghao_title.size = 18
userchenghao_title.color = "#fff";
userchenghao_title.x = 120;
userchenghao_title.y = 150;
userinfo_Layer.addChild(userchenghao_title);
var userchenghao_title = new LTextField();
userchenghao_title.text = " < 1阶,1段 > ";
userchenghao_title.size = 18
userchenghao_title.color = "#fff";
userchenghao_title.x = 280;
userchenghao_title.y = 150;
userinfo_Layer.addChild(userchenghao_title);
var jieshao_button_show = new LSprite();
userinfo_Layer.addChild(jieshao_button_show);
var jieshao_button = new LButtonSample1(" 查看信息介绍 ",12);
jieshao_button.backgroundColor = "#000";
jieshao_button.width = 20;
jieshao_button.height = 12;
jieshao_button.x = 110;
jieshao_button.y = 620;
jieshao_button_show.addChild(jieshao_button);
jieshao_button_show.addEventListener(LMouseEvent.MOUSE_UP,off_addation);
var userinfo_title = new LTextField();
userinfo_title.setWordWrap(true);
userinfo_title.htmlText = " 物理攻击:"+user_info_data.user_gongji_wuli+"\
\n\
物理防御:"+user_info_data.user_fangyu_wuli+" \n\
魔法防御:"+user_info_data.user_fangyu_mofa+" \n\
血量Max :"+user_info_data.user_hp_max+" \n\
魔能Max :"+user_info_data.user_ep_max+" \n\
\n\
[体质]\n\
力量:"+user_info_data.user_lilang+" \n\
敏捷:"+user_info_data.user_mingjie+" \n\
精力:"+user_info_data.user_jingli+" \n\
";
userinfo_title.x = 100;
userinfo_title.y = 480;
userinfo_title.textBaseline = "alphabetic";
userinfo_Layer.addChild(userinfo_title);
var userinfo2_title = new LTextField();
userinfo2_title.setWordWrap(true);
userinfo2_title.htmlText = "[属性]\n\n\
暴击:"+user_info_data.user_baoji+" \n\
闪避:"+user_info_data.user_shanbi+" \n\
吸血:"+user_info_data.user_xixue+" \n\
命中:"+user_info_data.user_migzhong+" \n\
元素提成(火):"+user_info_data.user_huo+" \n\
元素提成(水):"+user_info_data.user_shui+" \n\
元素提成(土):"+user_info_data.user_tu+" \n\
元素提成(木):"+user_info_data.user_mu+" \n\
元素提成(金):"+user_info_data.user_jin+" \n\
";
userinfo2_title.x = 260;
userinfo2_title.y = 480;
userinfo2_title.textBaseline = "alphabetic";
userinfo_Layer.addChild(userinfo2_title);
if(user_info_data.user_zb_tou_presence){
var zb_tou_name_data = "zb_tou";
var zb_toubu_bitmap = new LBitmap(new LBitmapData(userinfo_dataList["zb_tou"]));
var userinfo_Layer_button = new LButton(zb_toubu_bitmap);
userinfo_Layer_button.x = 175;
userinfo_Layer_button.y = 195;
userinfo_Layer.addChild(userinfo_Layer_button);
userinfo_Layer_button.addEventListener(LMouseEvent.MOUSE_UP,function(){
console.log("打开装备头部",apply_button);
apply_button=true;
open_zb_jieshao_pg(zb_tou_name_data);
});
}
if(user_info_data.user_zb_guanghuan_presence){
var zb_guanghuan_name_data = "zb_guanghuan";
var zb_guanghuan_bitmap = new LBitmap(new LBitmapData(userinfo_dataList["zb_guanghuan"]));
var userinfo_Layer_button = new LButton(zb_guanghuan_bitmap);
userinfo_Layer_button.x = 260;
userinfo_Layer_button.y = 195;
userinfo_Layer.addChild(userinfo_Layer_button);
userinfo_Layer_button.addEventListener(LMouseEvent.MOUSE_UP,function(){
console.log("光环装备");
apply_button=true;
open_zb_jieshao_pg(zb_guanghuan_name_data);
});
}
if(user_info_data.user_zb_xianglian_presence){
var zb_xianglian_name_data = "zb_xianglian";
var zb_xianglian_bitmap = new LBitmap(new LBitmapData(userinfo_dataList["zb_xianglian"]));
var userinfo_Layer_button = new LButton(zb_xianglian_bitmap);
userinfo_Layer_button.x = 95;
userinfo_Layer_button.y = 280;
userinfo_Layer.addChild(userinfo_Layer_button);
userinfo_Layer_button.addEventListener(LMouseEvent.MOUSE_UP,function(){
console.log("项链装备");
apply_button=true;
open_zb_jieshao_pg(zb_xianglian_name_data);
});
}
if(user_info_data.user_zb_shangshen_presence){
var zb_shangshen_name_data = "zb_shangshen";
var zb_shangshen_bitmap = new LBitmap(new LBitmapData(userinfo_dataList["zb_shangshen"]));
var userinfo_Layer_button = new LButton(zb_shangshen_bitmap);
userinfo_Layer_button.x = 180;
userinfo_Layer_button.y = 280;
userinfo_Layer.addChild(userinfo_Layer_button);
userinfo_Layer_button.addEventListener(LMouseEvent.MOUSE_UP,function(){
console.log("上身装备");
apply_button=true;
open_zb_jieshao_pg(zb_shangshen_name_data);
});
}
if(user_info_data.user_zb_wuqi_presence){
var zb_wuqi_name_data = "zb_wuqi";
var zb_wuqi_bitmap = new LBitmap(new LBitmapData(userinfo_dataList["zb_wuqi"]));
var userinfo_Layer_button = new LButton(zb_wuqi_bitmap);
userinfo_Layer_button.x = 260;
userinfo_Layer_button.y = 280;
userinfo_Layer.addChild(userinfo_Layer_button);
userinfo_Layer_button.addEventListener(LMouseEvent.MOUSE_UP,function(){
console.log("武器装备");
apply_button=true;
open_zb_jieshao_pg(zb_wuqi_name_data);
});
}
if(user_info_data.user_zb_zhuangshi_presence){
var zb_zhuangshi_name_data = "zb_zhuangshi";
var zb_zhuangshi_bitmap = new LBitmap(new LBitmapData(userinfo_dataList["zb_zhuangshi"]));
var userinfo_Layer_button = new LButton(zb_zhuangshi_bitmap);
userinfo_Layer_button.x = 350;
userinfo_Layer_button.y = 280;
userinfo_Layer.addChild(userinfo_Layer_button);
userinfo_Layer_button.addEventListener(LMouseEvent.MOUSE_UP,function(){
console.log("装饰装备");
apply_button=true;
open_zb_jieshao_pg(zb_zhuangshi_name_data);
});
}
if(user_info_data.user_zb_jiezhi_presence){
var zb_jiezhi_name_data = "zb_jiezhi";
var zb_jiezhi_bitmap = new LBitmap(new LBitmapData(userinfo_dataList["zb_jiezhi"]));
var userinfo_Layer_button = new LButton(zb_jiezhi_bitmap);
userinfo_Layer_button.x = 95;
userinfo_Layer_button.y = 365;
userinfo_Layer.addChild(userinfo_Layer_button);
userinfo_Layer_button.addEventListener(LMouseEvent.MOUSE_UP,function(){
console.log("戒指装备");
apply_button=true;
open_zb_jieshao_pg(zb_jiezhi_name_data);
});
}
if(user_info_data.user_zb_xiashen_presence){
var zb_xiashen_name_data = "zb_xiashen";
var zb_xiashen_bitmap = new LBitmap(new LBitmapData(userinfo_dataList["zb_xiashen"]));
var userinfo_Layer_button = new LButton(zb_xiashen_bitmap);
userinfo_Layer_button.x = 180;
userinfo_Layer_button.y = 365;
userinfo_Layer.addChild(userinfo_Layer_button);
userinfo_Layer_button.addEventListener(LMouseEvent.MOUSE_UP,function(){
console.log("下身装备");
apply_button=true;
open_zb_jieshao_pg(zb_xiashen_name_data);
});
}
if(user_info_data.user_zb_fushou_presence){
var zb_fushou_name_data = "zb_fushou";
var zb_fushou_bitmap = new LBitmap(new LBitmapData(userinfo_dataList["zb_fushou"]));
var userinfo_Layer_button = new LButton(zb_fushou_bitmap);
userinfo_Layer_button.x = 260;
userinfo_Layer_button.y = 365;
userinfo_Layer.addChild(userinfo_Layer_button);
userinfo_Layer_button.addEventListener(LMouseEvent.MOUSE_UP,function(){
console.log("副手装备");
apply_button=true;
open_zb_jieshao_pg(zb_fushou_name_data);
});
}
if(user_info_data.user_zb_xiezhi_presence){
var zb_xiezhi_name_data = "zb_xiezhi";
var zb_xiezhi_bitmap = new LBitmap(new LBitmapData(userinfo_dataList["zb_xiezhi"]));
var userinfo_Layer_button = new LButton(zb_xiezhi_bitmap);
userinfo_Layer_button.x = 350;
userinfo_Layer_button.y = 365;
userinfo_Layer.addChild(userinfo_Layer_button);
userinfo_Layer_button.addEventListener(LMouseEvent.MOUSE_UP,function(){
console.log("鞋子装备");
apply_button=true;
open_zb_jieshao_pg(zb_xiezhi_name_data);
});
}
}
function user_info_ListChildView(i){
var self = this;
base(self,LListChildView,[]);
self.graphics.drawRect(1, "#000000", [0, 0, 310, 50],
true,"#3C3C3C");
var t = new LTextField();
t.color = "#FFFFFF";
t.size = 20;
t.text = i;
t.x = t.y = 5;
self.addChild(t);
}
玩家背包
var beibao_info_data = {
beibao_1 : [
[ "wuping_1","wuping_2",0,"wuping_3",0],
[ 0,0,0,0,0],
[ 0,0,0,0,0],
[ 0,0,0,0,0],
[ 0,0,0,0,0]
],
beibao_2 : [
[ 0,0,0,0,0],
[ 0,0,0,0,0],
[ 0,0,0,0,0],
[ 0,0,0,0,0],
[ 0,0,0,0,0]
],
beibao_3 : [
[ "wuping_1","wuping_2",0,"wuping_3",0],
[ "wuping_1","wuping_2",0,"wuping_3",0],
[ 0,0,0,0,0],
[ 0,0,0,0,0],
[ 0,0,0,0,0]
],
beibao_4 : [
[ "wuping_1","wuping_2",0,"wuping_3",0],
[ 0,0,0,0,0],
[ 0,0,0,0,0],
[ 0,0,0,0,0],
[ "wuping_1","wuping_2",0,"wuping_3",0]
],
}
var beibao_zb_data = {
wuping_1 : 3,
wuping_2 : 2,
wuping_3 : 12,
}
var user_beibao_info_data = {
wuping_1 : {name:"wuping_1",path:"../ui/login/zb_1.jpg"},
wuping_2 : {name:"wuping_2",path:"../ui/login/zb_1.jpg"},
wuping_3 : {name:"wuping_3",path:"../ui/login/zb_1.jpg"},
}
function get_user_beibao_data(){
var beibao_data_image = new Array()
for(var beibao_i in user_beibao_info_data){
beibao_data_image.push(user_beibao_info_data[beibao_i]);
}
return beibao_data_image;
}
var beibao_info_imgData = get_user_beibao_data();
function beibaoinfo_Layer_show(){
apply_button = true;
loadingLayer1 = new LoadingSample4();
addChild(loadingLayer1);
LLoadManage.load(beibao_info_imgData,
function(progress){
loadingLayer1.setProgress(progress);
},beibaoinfo_Layer_show_init);
}
function beibaoinfo_Layer_show_init(result){
var beibaoinfo_dataList = result;
if(loadingLayer1){
removeChild(loadingLayer1);
loadingLayer1 = null;
}
KEY_lock = false;
beibaoinfo_Layer = new LSprite();
backLayer.addChild(beibaoinfo_Layer);
var beibao_bk_bitmap = new LBitmap(new LBitmapData(dataList["beibao"]));
beibao_bk_bitmap.x = 60;
beibao_bk_bitmap.y = 50;
beibaoinfo_Layer.addChild(beibao_bk_bitmap);
var off_button_show = new LSprite();
beibaoinfo_Layer.addChild(off_button_show);
var off_button = new LButtonSample1(" 关闭 ",12);
off_button.backgroundColor = "#EA0000";
off_button.width = 20;
off_button.height = 10;
off_button.x = 390;
off_button.y = 90;
off_button_show.addChild(off_button);
off_button_show.addEventListener(LMouseEvent.MOUSE_UP,off_addation);
var beibao_title_L = " 玩家背包界面 ";
var beibaoinfo_Layer_title = new LTextField();
beibaoinfo_Layer_title.text = beibao_title_L;
beibaoinfo_Layer_title.size = 23
beibaoinfo_Layer_title.color = "#53FF53";
beibaoinfo_Layer_title.x = 180;
beibaoinfo_Layer_title.y = 100;
beibaoinfo_Layer.addChild(beibaoinfo_Layer_title);
var beibao_button1_bitmap = new LBitmap(new LBitmapData(dataList["beibao_button1"]));
var beibao_button_1 = new LButton(beibao_button1_bitmap);
beibao_button_1.x = 95;
beibao_button_1.y = 145;
beibaoinfo_Layer.addChild(beibao_button_1);
beibao_button_1.addEventListener(LMouseEvent.MOUSE_UP,function(){
console.log("打开背包一")
beibao_wupin_L_show(beibaoinfo_dataList,beibao_info_data.beibao_1);
});
var beibao_button2_bitmap = new LBitmap(new LBitmapData(dataList["beibao_button2"]));
var beibao_button_2 = new LButton(beibao_button2_bitmap);
beibao_button_2.x = 180;
beibao_button_2.y = 145;
beibaoinfo_Layer.addChild(beibao_button_2);
beibao_button_2.addEventListener(LMouseEvent.MOUSE_UP,function(){
console.log("打开背包二")
beibao_wupin_L_show(beibaoinfo_dataList,beibao_info_data.beibao_2);
});
var beibao_button3_bitmap = new LBitmap(new LBitmapData(dataList["beibao_button3"]));
var beibao_button_3 = new LButton(beibao_button3_bitmap);
beibao_button_3.x = 265;
beibao_button_3.y = 145;
beibaoinfo_Layer.addChild(beibao_button_3);
beibao_button_3.addEventListener(LMouseEvent.MOUSE_UP,function(){
console.log("打开背包三")
beibao_wupin_L_show(beibaoinfo_dataList,beibao_info_data.beibao_3);
});
var beibao_button4_bitmap = new LBitmap(new LBitmapData(dataList["beibao_button4"]));
var beibao_button_4 = new LButton(beibao_button4_bitmap);
beibao_button_4.x = 350;
beibao_button_4.y = 145;
beibaoinfo_Layer.addChild(beibao_button_4);
beibao_button_4.addEventListener(LMouseEvent.MOUSE_UP,function(){
console.log("打开背包四")
beibao_wupin_L_show(beibaoinfo_dataList,beibao_info_data.beibao_4);
});
beibao_wupin_L_show(beibaoinfo_dataList,beibao_info_data.beibao_1);
}
function beibao_wupin_L_show(beibaoinfo_dataList,beibao_arr){
if(beibao_wupin_Layer){
beibao_wupin_Layer.remove();
beibao_wupin_Layer = null;
}
beibao_wupin_Layer = new LSprite();
beibaoinfo_Layer.addChild(beibao_wupin_Layer);
var beibao_null_button_bitmap = new LBitmap(new LBitmapData(dataList["beibao_null"]));
var beibao_null_button = new LButton(beibao_null_button_bitmap);
for(i=1;i<6;i++){
for(j=1;j<6;j++){
if(beibao_arr[j-1][i-1]==0){
var beibao_null_button = beibao_null_button.clone();
beibao_null_button.x = 31+68*i;
beibao_null_button.y = 118+75*j;
beibao_wupin_Layer.addChild(beibao_null_button);
beibao_null_button.addEventListener(LMouseEvent.MOUSE_UP,function(event){
var self = this;
console.log(event);});
}
else{
var beibao_zb_name = beibao_arr[j-1][i-1];
zb_button(beibao_zb_name);
var beibaozb_name_title = new LTextField();
beibaozb_name_title.text = beibao_zb_name;
beibaozb_name_title.size = 8;
beibaozb_name_title.color = "#53FF53";
beibaozb_name_title.x = 31+68*i;
beibaozb_name_title.y = (118+75*j)-10;
beibao_wupin_Layer.addChild(beibaozb_name_title);
var beibaozb_number_title = new LTextField();
beibaozb_number_title.text = beibao_zb_data[beibao_zb_name];
beibaozb_number_title.size = 8;
beibaozb_number_title.color = "#53FF53";
beibaozb_number_title.x = 31+68*i;
beibaozb_number_title.y = (118+75*j)+40;
beibao_wupin_Layer.addChild(beibaozb_number_title);
}
}
}
function zb_button(beibao_zb_name){
var beibao_zb_button_bitmap = new LBitmap(new LBitmapData(beibaoinfo_dataList[beibao_zb_name]));
beibao_zb_button = new LButton(beibao_zb_button_bitmap);
beibao_zb_button.x = 31+68*i;
beibao_zb_button.y = 118+75*j;
beibao_wupin_Layer.addChild(beibao_zb_button);
beibao_zb_button.addEventListener(LMouseEvent.MOUSE_UP,function(event){
console.log(beibao_zb_name);
});
}
}
var zb_info_data = {
zb_beijin : "阿萨时间的话开局送的空间哈萨克道具卡塑胶地板萨德比US会丢爱神的箭不是的空间吧驾驶的客户卡手机端看见爱上打开手机",
zb_shuxing : ["+物理防御 : 100 "," +物理防御 : 100 "," +物理防御 : 100 "," +物理防御 : 100 "]
}
function zb_jieshao_show(zb_name){
if(userinfo_Layer){
userinfo_Layer.remove();
}
apply_button = true;
KEY_lock = false;
zb_jieshao_Layer = new LSprite();
backLayer.addChild(zb_jieshao_Layer);
var zb_jieshao_bk_bitmap = new LBitmap(new LBitmapData(dataList["zb_jieshao_bk"]));
zb_jieshao_bk_bitmap.x = 80;
zb_jieshao_bk_bitmap.y = 120;
zb_jieshao_Layer.addChild(zb_jieshao_bk_bitmap);
var off_button_show = new LSprite();
zb_jieshao_Layer.addChild(off_button_show);
var off_button = new LButtonSample1(" 关闭 ",12);
off_button.backgroundColor = "#EA0000";
off_button.width = 15;
off_button.height = 12;
off_button.x = 420;
off_button.y = 115;
off_button_show.addChild(off_button);
off_button_show.addEventListener(LMouseEvent.MOUSE_UP,off_zb_jieshao_show);
var usermenu_Layer_title = new LTextField();
usermenu_Layer_title.text = zb_name;
usermenu_Layer_title.size = 20
usermenu_Layer_title.color = "#53FF53";
usermenu_Layer_title.x = 200;
usermenu_Layer_title.y = 160;
zb_jieshao_Layer.addChild(usermenu_Layer_title);
var userinfo_title = new LTextField();
userinfo_title.setWordWrap(true);
userinfo_title.width= 300;
var html_data = " ";
for(var i in zb_info_data.zb_shuxing){
console.log("boss :",zb_info_data.zb_shuxing[i]);
html_data+=" "+zb_info_data.zb_shuxing[i]+"\n";
}
userinfo_title.htmlText = "【装备属性】 \n"+html_data+" \n\
<装备介绍>: "+zb_info_data.zb_beijin+" \n\
";
userinfo_title.x = 120;
userinfo_title.y = 380;
userinfo_title.textBaseline = "alphabetic";
zb_jieshao_Layer.addChild(userinfo_title);
}
商店
var user_shangdian_info_data = {
shangdian_bk_img : {name:"shangdian_show_bk",path:"../ui/login/shangdian_show_bk_1.png"},
wuping_img_1 : {name:"wp_1",path:"../ui/login/wp_1.jpg"},
}
function get_user_shangdian_data(){
var shangdian_data_image = new Array()
for(var shangdian_i in user_shangdian_info_data){
shangdian_data_image.push(user_shangdian_info_data[shangdian_i]);
}
return shangdian_data_image;
}
var shangdian_info_imgData = get_user_shangdian_data();
function shangdian_Layer_show(){
apply_button = true;
loadingLayer_shangdian = new LoadingSample4();
addChild(loadingLayer_shangdian);
var beibao_title_L = " 正在加载资源请稍后..... ";
var beibaoinfo_Layer_title = new LTextField();
beibaoinfo_Layer_title.text = beibao_title_L;
beibaoinfo_Layer_title.size = 25;
beibaoinfo_Layer_title.color = "#ffffff";
beibaoinfo_Layer_title.x = 100;
beibaoinfo_Layer_title.y = 300;
loadingLayer_shangdian.addChild(beibaoinfo_Layer_title);
LLoadManage.load(shangdian_info_imgData,
function(progress){
loadingLayer_shangdian.setProgress(progress);
},shangdian_Layer_show_init);
}
function shangdian_Layer_show_init(result){
var shangdianinfo_dataList = result;
if(loadingLayer_shangdian){
removeChild(loadingLayer_shangdian);
loadingLayer_shangdian = null;
}
KEY_lock = false;
shangdian_Layer = new LSprite();
backLayer.addChild(shangdian_Layer);
var beibao_bk_bitmap = new LBitmap(new LBitmapData(shangdianinfo_dataList["shangdian_show_bk"]));
beibao_bk_bitmap.x = 15;
beibao_bk_bitmap.y = 20;
shangdian_Layer.addChild(beibao_bk_bitmap);
var off_button_show = new LSprite();
shangdian_Layer.addChild(off_button_show);
var off_button = new LButtonSample1(" 关闭 ",12);
off_button.backgroundColor = "#EA0000";
off_button.width = 20;
off_button.height = 10;
off_button.x = 400;
off_button.y = 80;
off_button_show.addChild(off_button);
off_button_show.addEventListener(LMouseEvent.MOUSE_UP,off_addation);
var beibao_title_L = " 玩家商店界面 ";
var beibaoinfo_Layer_title = new LTextField();
beibaoinfo_Layer_title.text = beibao_title_L;
beibaoinfo_Layer_title.size = 23
beibaoinfo_Layer_title.color = "#53FF53";
beibaoinfo_Layer_title.x = 180;
beibaoinfo_Layer_title.y = 90;
shangdian_Layer.addChild(beibaoinfo_Layer_title);
var user_jinqian_table = new LTextField();
user_jinqian_table.text = " 余额 : 1,000,000 ";
user_jinqian_table.size = 25;
user_jinqian_table.color = "#ffffff";
user_jinqian_table.x = 200;
user_jinqian_table.y = 680;
shangdian_Layer.addChild(user_jinqian_table);
var scanf_button = new LButtonSample1(" 查询 ",15);
scanf_button.backgroundColor = "#000000";
scanf_button.width = 30;
scanf_button.height = 10;
scanf_button.x = 350;
scanf_button.y = 128;
shangdian_Layer.addChild(scanf_button);
scanf_button.addEventListener(LMouseEvent.MOUSE_UP,function(){
console.log("查询");
});
var inputLayer = new LSprite();
inputLayer.graphics.drawRect(1,"#fff",[0, 0, 220, 30]);
var theTextField = new LTextField();
theTextField.size = 25;
theTextField.color = "#FF0000";
theTextField.x = 130;
theTextField.y = 130;
theTextField.setType(LTextFieldType.INPUT,inputLayer);
shangdian_Layer.addChild(theTextField);
var shangdian_button_1 = new LButtonSample1(" 武器 ",18);
shangdian_button_1.backgroundColor = "#000";
shangdian_button_1.width = 30;
shangdian_button_1.height = 18;
shangdian_button_1.x = 55;
shangdian_button_1.y = 200;
shangdian_Layer.addChild(shangdian_button_1);
shangdian_button_1.addEventListener(LMouseEvent.MOUSE_UP,function(){
console.log("点击了 商店按钮");
});
var shangdian_button_1 = new LButtonSample1(" 衣服 ",18);
shangdian_button_1.backgroundColor = "#000";
shangdian_button_1.width = 30;
shangdian_button_1.height = 18;
shangdian_button_1.x = 55;
shangdian_button_1.y = 250;
shangdian_Layer.addChild(shangdian_button_1);
shangdian_button_1.addEventListener(LMouseEvent.MOUSE_UP,function(){
console.log("点击了 商店按钮");
});
var shangdian_button_1 = new LButtonSample1(" 首饰 ",18);
shangdian_button_1.backgroundColor = "#000";
shangdian_button_1.width = 30;
shangdian_button_1.height = 18;
shangdian_button_1.x = 55;
shangdian_button_1.y = 300;
shangdian_Layer.addChild(shangdian_button_1);
shangdian_button_1.addEventListener(LMouseEvent.MOUSE_UP,function(){
console.log("点击了 商店按钮");
});
var shangdian_button_1 = new LButtonSample1(" 消耗 ",18);
shangdian_button_1.backgroundColor = "#000";
shangdian_button_1.width = 30;
shangdian_button_1.height = 18;
shangdian_button_1.x = 55;
shangdian_button_1.y = 350;
shangdian_Layer.addChild(shangdian_button_1);
shangdian_button_1.addEventListener(LMouseEvent.MOUSE_UP,function(){
console.log("点击了 商店按钮");
});
var shangdian_button_1 = new LButtonSample1(" 宝石 ",18);
shangdian_button_1.backgroundColor = "#000";
shangdian_button_1.width = 30;
shangdian_button_1.height = 18;
shangdian_button_1.x = 55;
shangdian_button_1.y = 400;
shangdian_Layer.addChild(shangdian_button_1);
shangdian_button_1.addEventListener(LMouseEvent.MOUSE_UP,function(){
console.log("点击了 商店按钮");
});
shangdianinfo_listView = new LListView();
shangdian_Layer.addChild(shangdianinfo_listView);
shangdianinfo_listView.x = 130;
shangdianinfo_listView.y = 180;
shangdianinfo_listView.maxPerLine = 1;
shangdianinfo_listView.cellWidth = 320;
shangdianinfo_listView.cellHeight = 65;
shangdianinfo_listView.resize(320,480);
shangdianinfo_listView.graphics.drawRect(5, "#53FF53", [0, 0,
shangdianinfo_listView.clipping.width,shangdianinfo_listView.clipping.height]);
var list = [];
var task_info_list = ["【物品 1】 : 100",
"【物品 2】 : 100",
"【物品 3】 : 100",
"【物品 4】 : 100",
"【物品 5】 : 100",
"【物品 6】 : 100",
"【物品 7】 : 100",
"【物品 8】 : 100",
"【物品 9】 : 100"
]
var wuping_img_list = [ shangdianinfo_dataList["wp_1"],
shangdianinfo_dataList["wp_1"],
shangdianinfo_dataList["wp_1"],
shangdianinfo_dataList["wp_1"],
shangdianinfo_dataList["wp_1"],
shangdianinfo_dataList["wp_1"],
shangdianinfo_dataList["wp_1"],
shangdianinfo_dataList["wp_1"],
shangdianinfo_dataList["wp_1"]
]
if(task_info_list.length == 0 & wuping_img_list.length == 0){
var c = new shangdian_info_ListChildView("获取失败");
list.push(c);
}
for(var i=0;i<task_info_list.length;i++){
var c = new shangdian_info_ListChildView(task_info_list[i],wuping_img_list[i]);
list.push(c);
}
shangdianinfo_listView.updateList(list);
}
function shangdian_info_ListChildView(i,img){
var self = this;
base(self,LListChildView,[]);
self.graphics.drawRect(1, "#000000", [0, 0, 350, 65],
true,"#3C3C3C");
var t = new LTextField();
t.color = "#FFFFFF";
t.size = 15;
t.text = i;
t.x = 70;
t.y = 10;
self.addChild(t);
var shangpin_bitmap = new LBitmap(new LBitmapData(img));
shangpin_bitmap.x = 5;
shangpin_bitmap.y = 5;
self.addChild(shangpin_bitmap);
}
shangdian_info_ListChildView.prototype.onClick = function(event){
var self = this;
console.log(self.getChildAt(0).text);
};
玩家技能
var user_jineng_info_data = {
jineng_bk_img : {name:"jineng_show_bk",path:"../ui/login/jineng_show_bk_1.png"},
jineng_kp_show_bk : {name:"jineng_kapai_bk",path:"../ui/game/jineng_kapai_bk.png"},
jineng_kapai_tx : {name:"jineng_kapai_tx",path:"../ui/game/jineng_kapai_tx.png"},
}
function get_user_jineng_data(){
var jineng_data_image = new Array()
for(var jineng_i in user_jineng_info_data){
jineng_data_image.push(user_jineng_info_data[jineng_i]);
}
return jineng_data_image;
}
var jineng_info_imgData = get_user_jineng_data();
function jineng_Layer_show(){
apply_button = true;
loadingLayer_jineng = new LoadingSample4();
addChild(loadingLayer_jineng);
LLoadManage.load(jineng_info_imgData,
function(progress){
loadingLayer_jineng.setProgress(progress);
},jineng_Layer_show_init);
}
function jineng_Layer_show_init(result){
var jinenginfo_dataList = result;
if(loadingLayer_jineng){
removeChild(loadingLayer_jineng);
loadingLayer_jineng = null;
}
KEY_lock = false;
jineng_Layer = new LSprite();
backLayer.addChild(jineng_Layer);
var beibao_bk_bitmap = new LBitmap(new LBitmapData(jinenginfo_dataList["jineng_show_bk"]));
beibao_bk_bitmap.x = -30;
beibao_bk_bitmap.y = 50;
jineng_Layer.addChild(beibao_bk_bitmap);
var off_button_show = new LSprite();
jineng_Layer.addChild(off_button_show);
var off_button = new LButtonSample1(" 关闭 ",12);
off_button.backgroundColor = "#EA0000";
off_button.width = 20;
off_button.height = 10;
off_button.x = 430;
off_button.y = 100;
off_button_show.addChild(off_button);
off_button_show.addEventListener(LMouseEvent.MOUSE_UP,off_addation);
var beibao_title_L = " 玩家技能界面 ";
var beibaoinfo_Layer_title = new LTextField();
beibaoinfo_Layer_title.text = beibao_title_L;
beibaoinfo_Layer_title.size = 23
beibaoinfo_Layer_title.color = "#53FF53";
beibaoinfo_Layer_title.x = 180;
beibaoinfo_Layer_title.y = 120;
jineng_Layer.addChild(beibaoinfo_Layer_title);
var jineng_1_bitmap = new LBitmap(new LBitmapData(jinenginfo_dataList["jineng_kapai_bk"]));
jineng_1_button = new LButton(jineng_1_bitmap);
jineng_1_button.x = 100;
jineng_1_button.y = 185;
jineng_Layer.addChild(jineng_1_button);
jineng_1_button.addEventListener(LMouseEvent.MOUSE_UP,function(){
console.log("点击了技能");
});
var jineng_1_bitmap = new LBitmap(new LBitmapData(jinenginfo_dataList["jineng_kapai_tx"]));
jineng_1_bitmap.x = 90;
jineng_1_bitmap.y = 180;
jineng_Layer.addChild(jineng_1_bitmap);
}
玩家任务
var user_task_info_data = {
task_bk_img : {name:"task_show_bk",path:"../ui/login/task_show_bk_1.png"},
}
function get_user_task_data(){
var task_data_image = new Array()
for(var task_i in user_task_info_data){
task_data_image.push(user_task_info_data[task_i]);
}
return task_data_image;
}
var task_info_imgData = get_user_task_data();
function task_Layer_show(){
apply_button = true;
loadingLayer_task = new LoadingSample4();
addChild(loadingLayer_task);
LLoadManage.load(task_info_imgData,
function(progress){
loadingLayer_task.setProgress(progress);
},task_Layer_show_init);
}
function task_Layer_show_init(result){
var taskinfo_dataList = result;
if(loadingLayer_task){
removeChild(loadingLayer_task);
loadingLayer_task = null;
}
KEY_lock = false;
task_Layer = new LSprite();
backLayer.addChild(task_Layer);
var beibao_bk_bitmap = new LBitmap(new LBitmapData(taskinfo_dataList["task_show_bk"]));
beibao_bk_bitmap.x = 30;
beibao_bk_bitmap.y = 50;
task_Layer.addChild(beibao_bk_bitmap);
var off_button_show = new LSprite();
task_Layer.addChild(off_button_show);
var off_button = new LButtonSample1(" 关闭 ",12);
off_button.backgroundColor = "#EA0000";
off_button.width = 20;
off_button.height = 10;
off_button.x = 390;
off_button.y = 100;
off_button_show.addChild(off_button);
off_button_show.addEventListener(LMouseEvent.MOUSE_UP,off_addation);
var beibao_title_L = " 玩家任务界面 ";
var beibaoinfo_Layer_title = new LTextField();
beibaoinfo_Layer_title.text = beibao_title_L;
beibaoinfo_Layer_title.size = 23
beibaoinfo_Layer_title.color = "#53FF53";
beibaoinfo_Layer_title.x = 180;
beibaoinfo_Layer_title.y = 110;
task_Layer.addChild(beibaoinfo_Layer_title);
taskinfo_listView = new LListView();
task_Layer.addChild(taskinfo_listView);
taskinfo_listView.x = 80;
taskinfo_listView.y = 150;
taskinfo_listView.maxPerLine = 1;
taskinfo_listView.cellWidth = 350;
taskinfo_listView.cellHeight = 50;
taskinfo_listView.resize(350,420);
taskinfo_listView.graphics.drawRect(5, "#CE0000", [0, 0,
taskinfo_listView.clipping.width,taskinfo_listView.clipping.height]);
var list = [];
var task_info_list = ["【任务 - 1】 : asdasdasd",
"【任务 - 2】 : asdasdasd",
"【任务 - 3】 : asdasdasd",
"【任务 - 4】 : asdasdasd",
"【任务 - 5】 : asdasdasd",
"【任务 - 6】 : asdasdasd",
"【任务 - 7】 : asdasdasd",
"【任务 - 8】 : asdasdasd",
"【任务 - 9】 : asdasdasd",
"【任务 - 10】 : asdasdasd",
"【任务 - 11】 : asdasdasd",
"【任务 - 12】 : asdasdasd",
"【任务 - 13】 : asdasdasd",
"【任务 - 14】 : asdasdasd"
]
if(task_info_list.length==0){
var c = new task_info_ListChildView("获取失败");
list.push(c);
}
for(var i=0;i<task_info_list.length;i++){
var c = new task_info_ListChildView(task_info_list[i]);
list.push(c);
}
taskinfo_listView.updateList(list);
}
function task_info_ListChildView(i){
var self = this;
base(self,LListChildView,[]);
self.graphics.drawRect(1, "#000000", [0, 0, 350, 50],
true,"#3C3C3C");
var t = new LTextField();
t.color = "#FFFFFF";
t.size = 18;
t.text = i;
t.x = t.y = 5;
self.addChild(t);
}
task_info_ListChildView.prototype.onClick = function(event){
var self = this;
console.log(self.getChildAt(0).text);
};
玩家菜单
function user_menu_Layer_show(){
apply_button = true;
KEY_lock = false;
user_menu_Layer = new LSprite();
backLayer.addChild(user_menu_Layer);
var user_menu_bk_bitmap = new LBitmap(new LBitmapData(dataList["menu_bk"]));
user_menu_bk_bitmap.x = 80;
user_menu_bk_bitmap.y = 70;
user_menu_Layer.addChild(user_menu_bk_bitmap);
var off_button_show = new LSprite();
user_menu_Layer.addChild(off_button_show);
var off_button = new LButtonSample1(" 关闭 ",12);
off_button.backgroundColor = "#EA0000";
off_button.width = 15;
off_button.height = 12;
off_button.x = 350;
off_button.y = 140;
off_button_show.addChild(off_button);
off_button_show.addEventListener(LMouseEvent.MOUSE_UP,off_addation);
var usermenu_Layer_title = new LTextField();
usermenu_Layer_title.text = " 玩家菜单界面 ";
usermenu_Layer_title.size = 20
usermenu_Layer_title.color = "#53FF53";
usermenu_Layer_title.x = 180;
usermenu_Layer_title.y = 140;
user_menu_Layer.addChild(usermenu_Layer_title);
var menu_button_bitmap = new LBitmap(new LBitmapData(dataList["menu_button"]));
var menu_button = new LButton(menu_button_bitmap);
menu_button.x = 160;
menu_button.y = 200;
user_menu_Layer.addChild(menu_button);
menu_button.addEventListener(LMouseEvent.MOUSE_UP,function(){
user_menu_Layer.remove();
apply_button = true;
open_user_pg();
});
var usermenu_Layer_title = new LTextField();
usermenu_Layer_title.text = " 玩家信息 ";
usermenu_Layer_title.size = 20
usermenu_Layer_title.color = "#fff";
usermenu_Layer_title.x = 220;
usermenu_Layer_title.y = 225;
user_menu_Layer.addChild(usermenu_Layer_title);
var menu_button_bitmap = new LBitmap(new LBitmapData(dataList["menu_button"]));
var menu_button = new LButton(menu_button_bitmap);
menu_button.x = 160;
menu_button.y = 280;
user_menu_Layer.addChild(menu_button);
menu_button.addEventListener(LMouseEvent.MOUSE_UP,function(){
user_menu_Layer.remove();
apply_button = true;
open_beibao_pg();
});
var usermenu_Layer_title = new LTextField();
usermenu_Layer_title.text = " 背 包 ";
usermenu_Layer_title.size = 20
usermenu_Layer_title.color = "#fff";
usermenu_Layer_title.x = 220;
usermenu_Layer_title.y = 305;
user_menu_Layer.addChild(usermenu_Layer_title);
var menu_button_bitmap = new LBitmap(new LBitmapData(dataList["menu_button"]));
var menu_button = new LButton(menu_button_bitmap);
menu_button.x = 160;
menu_button.y = 360;
user_menu_Layer.addChild(menu_button);
menu_button.addEventListener(LMouseEvent.MOUSE_UP,function(){
user_menu_Layer.remove();
apply_button = true;
open_task_pg();
});
var usermenu_Layer_title = new LTextField();
usermenu_Layer_title.text = " 任 务 ";
usermenu_Layer_title.size = 20
usermenu_Layer_title.color = "#fff";
usermenu_Layer_title.x = 220;
usermenu_Layer_title.y = 385;
user_menu_Layer.addChild(usermenu_Layer_title);
var menu_button_bitmap = new LBitmap(new LBitmapData(dataList["menu_button"]));
var menu_button = new LButton(menu_button_bitmap);
menu_button.x = 160;
menu_button.y = 440;
user_menu_Layer.addChild(menu_button);
menu_button.addEventListener(LMouseEvent.MOUSE_UP,function(){
user_menu_Layer.remove();
apply_button = true;
open_jineng_pg();
});
var usermenu_Layer_title = new LTextField();
usermenu_Layer_title.text = " 技 能 ";
usermenu_Layer_title.size = 20
usermenu_Layer_title.color = "#fff";
usermenu_Layer_title.x = 220;
usermenu_Layer_title.y = 465;
user_menu_Layer.addChild(usermenu_Layer_title);
var menu_button_bitmap = new LBitmap(new LBitmapData(dataList["menu_button"]));
var menu_button = new LButton(menu_button_bitmap);
menu_button.x = 160;
menu_button.y = 520;
user_menu_Layer.addChild(menu_button);
menu_button.addEventListener(LMouseEvent.MOUSE_UP,function(){
user_menu_Layer.remove();
apply_button = true;
open_shangdian_pg();
});
var usermenu_Layer_title = new LTextField();
usermenu_Layer_title.text = " 商 店 ";
usermenu_Layer_title.size = 20
usermenu_Layer_title.color = "#fff";
usermenu_Layer_title.x = 220;
usermenu_Layer_title.y = 545;
user_menu_Layer.addChild(usermenu_Layer_title);
}
游戏菜单
function game_menu_Layer_show(){
apply_button = true;
KEY_lock = false;
game_menu_Layer = new LSprite();
backLayer.addChild(game_menu_Layer);
var user_menu_bk_bitmap = new LBitmap(new LBitmapData(dataList["menu_bk"]));
user_menu_bk_bitmap.x = 80;
user_menu_bk_bitmap.y = 70;
game_menu_Layer.addChild(user_menu_bk_bitmap);
var off_button_show = new LSprite();
game_menu_Layer.addChild(off_button_show);
var off_button = new LButtonSample1(" 关闭 ",12);
off_button.backgroundColor = "#EA0000";
off_button.width = 15;
off_button.height = 12;
off_button.x = 350;
off_button.y = 140;
off_button_show.addChild(off_button);
off_button_show.addEventListener(LMouseEvent.MOUSE_UP,off_addation);
var usermenu_Layer_title = new LTextField();
usermenu_Layer_title.text = " 游戏菜单界面 ";
usermenu_Layer_title.size = 20
usermenu_Layer_title.color = "#53FF53";
usermenu_Layer_title.x = 180;
usermenu_Layer_title.y = 140;
game_menu_Layer.addChild(usermenu_Layer_title);
var menu_button_bitmap = new LBitmap(new LBitmapData(dataList["menu_button"]));
var menu_button = new LButton(menu_button_bitmap);
menu_button.x = 160;
menu_button.y = 200;
game_menu_Layer.addChild(menu_button);
var usermenu_Layer_title = new LTextField();
usermenu_Layer_title.text = " 关闭声音 ";
usermenu_Layer_title.size = 20
usermenu_Layer_title.color = "#fff";
usermenu_Layer_title.x = 220;
usermenu_Layer_title.y = 225;
game_menu_Layer.addChild(usermenu_Layer_title);
var menu_button_bitmap = new LBitmap(new LBitmapData(dataList["menu_button"]));
var menu_button = new LButton(menu_button_bitmap);
menu_button.x = 160;
menu_button.y = 280;
game_menu_Layer.addChild(menu_button);
var usermenu_Layer_title = new LTextField();
usermenu_Layer_title.text = " 游戏介绍 ";
usermenu_Layer_title.size = 20
usermenu_Layer_title.color = "#fff";
usermenu_Layer_title.x = 220;
usermenu_Layer_title.y = 305;
game_menu_Layer.addChild(usermenu_Layer_title);
var menu_button_bitmap = new LBitmap(new LBitmapData(dataList["menu_button"]));
var menu_button = new LButton(menu_button_bitmap);
menu_button.x = 160;
menu_button.y = 360;
game_menu_Layer.addChild(menu_button);
var usermenu_Layer_title = new LTextField();
usermenu_Layer_title.text = " 广告招商 ";
usermenu_Layer_title.size = 20
usermenu_Layer_title.color = "#fff";
usermenu_Layer_title.x = 220;
usermenu_Layer_title.y = 385;
game_menu_Layer.addChild(usermenu_Layer_title);
var menu_button_bitmap = new LBitmap(new LBitmapData(dataList["menu_button"]));
var menu_button = new LButton(menu_button_bitmap);
menu_button.x = 160;
menu_button.y = 440;
game_menu_Layer.addChild(menu_button);
var usermenu_Layer_title = new LTextField();
usermenu_Layer_title.text = " 投资合伙 ";
usermenu_Layer_title.size = 20
usermenu_Layer_title.color = "#fff";
usermenu_Layer_title.x = 220;
usermenu_Layer_title.y = 465;
game_menu_Layer.addChild(usermenu_Layer_title);
var menu_button_bitmap = new LBitmap(new LBitmapData(dataList["menu_button"]));
var menu_button = new LButton(menu_button_bitmap);
menu_button.x = 160;
menu_button.y = 520;
game_menu_Layer.addChild(menu_button);
var usermenu_Layer_title = new LTextField();
usermenu_Layer_title.text = " 关于我们 ";
usermenu_Layer_title.size = 20
usermenu_Layer_title.color = "#fff";
usermenu_Layer_title.x = 220;
usermenu_Layer_title.y = 545;
game_menu_Layer.addChild(usermenu_Layer_title);
}
NPC对话
function task_show(npc_x,npc_y){
if(task_L_show){
task_L_show.remove();
}
task_L_show = new LSprite();
npc_1_L.addChild(task_L_show)
var deng_image = new image_in_turn(dataList["task_now"],dataList["task_now"]);
deng_image.x = npc_x;
deng_image.y = npc_y;
task_L_show.addChild(deng_image);
}
function image_in_turn(bg01,bg02){
var self = this;
base(self,LSprite,[]);
self.bitmapBG01 = new LBitmap(new LBitmapData(bg01));
self.addChild(self.bitmapBG01);
self.bitmapBG02 = new LBitmap(new LBitmapData(bg02));
self.addChild(self.bitmapBG02);
self.run();
}
image_in_turn.prototype.run = function(){
var self = this;
var tween = LTweenLite.to(self.bitmapBG02,0.5,{alpha:0,ease:Bounce.easeIn,loop:true}).
to(self.bitmapBG02,0.5,{alpha:1,ease:Bounce.easeIn});
}
function npc_salk_button(play_x,play_y){
npc_x=1;
npc_y=3;
if((play_x==npc_x-1||play_x==npc_x+1||play_x==npc_x)&(play_y==npc_y-1||play_y==npc_y+1||play_y==npc_y)){
salk_button_L_show_yes("npc_1");
}
else{
if(salk_button){
salk_button_L_show_no();
}
}
}
function npc_duihua_show(npc_duihua_L_bk,npc_name,duihua_data){
if(npc_duihua_L){
npc_duihua_L.remove();
npc_duihua_L = null;
}
npc_duihua_L = new LSprite();
backLayer.addChild(npc_duihua_L);
var npc_duihua_L_bitmap = new LBitmap(new LBitmapData(npc_duihua_L_bk));
npc_duihua_L.x = 20;
npc_duihua_L.y = 300;
npc_duihua_L.addChild(npc_duihua_L_bitmap);
var npc_nameTextField = new LTextField();
npc_nameTextField.text = "对话 : "+npc_name;
npc_nameTextField.x = 120;
npc_nameTextField.y = 5;
npc_nameTextField.size = 25;
npc_nameTextField.color = "#ffffff";
npc_duihua_L.addChild(npc_nameTextField);
var theTextField = new LTextField();
theTextField.setWordWrap(true);
theTextField.text = duihua_data;
theTextField.speed = 1;
theTextField.width = 350;
theTextField.wind();
theTextField.x = 30;
theTextField.y = 60;
theTextField.size = 20;
theTextField.color = "#ffffff";
npc_duihua_L.addChild(theTextField);
theTextField.addEventListener(LTextEvent.WIND_COMPLETE, function(){
var duihua_end_button = new LButtonSample1(" 结束 ",18);
duihua_end_button.backgroundColor = "#000";
duihua_end_button.width = 80;
duihua_end_button.height = 30;
duihua_end_button.x = 330;
duihua_end_button.y = 200;
npc_duihua_L.addChild(duihua_end_button);
duihua_end_button.addEventListener(LMouseEvent.MOUSE_UP,function(){
if(npc_duihua_L){
npc_duihua_L.remove();
npc_duihua_L = null;
}
});
});
}
function attack_button_show_event(event_type,now_boss_name){
if(event_type){
attack_button_L_show_yes(now_boss_name);
}
else{
attack_button_L_show_no();
}
}
function removed(event){
console.log("Boss Name:",event.currentTarget.objectIndex);
}
function all_getboss_attack(play_x,play_y){
for(var p in boss_arr){
if(getboss_attack(boss_arr[p].x,boss_arr[p].y,play_x,play_y)){
var attack_info = Array;
attack_info[0] = true;
attack_info[1] = boss_arr[p].name;
return attack_info;
}
}
return false;
}
function getboss_attack(salk_x,salk_y,play_x,play_y){
if((play_x==salk_x-1||play_x==salk_x+1||play_x==salk_x)
&
(play_y==salk_y-1||play_y==salk_y+1||play_y==salk_y)){
return true;
}
else{
return false;
}
}
function get_npc_name(name){
console.log("NPC Name:",name);
}
function now_info_Layer_show(){
now_info_Layer = new LSprite();
backLayer.addChild(now_info_Layer);
play_Layer_height = LGlobal.width/10;
set_posi(1,1);
}
function set_posi(posi1,posi2){
if(play_position_L){
play_position_L.remove();
}
play_position_L = new LSprite()
now_info_Layer.addChild(play_position_L);
var play_position = new LTextField();
play_position.text = "X:"+posi1+",Y:"+posi2;
play_position.size = 10
play_position.color = "#ffffff";
play_position.x = 330;
play_position.y = 95;
play_position_L.addChild(play_position);
}