首页 > 代码库 > 抱歉,马斯克,你的特斯拉归我了
抱歉,马斯克,你的特斯拉归我了
火爆朋友圈的? ? ? 特斯拉.rar分析
相信最近安全圈的朋友的朋友圈被这个连接给刷屏了
【? ? ? 特斯拉.rar】:http://omgmkt.qq.com/car/?from=timeline</font>
很多做前端的朋友都可能认为这是基于FLASH实现的,然而并不是,整个页面加载了超过300张图片,这一点可以通过浏览器自带的开发人员工具中network选项卡证实
【3335行代码预警】
而实现这个效果最主要的JS文件是http://omgmkt.qq.com/car/js/main.js代码如下:
FastClick.attach(document.body);//点击屏幕阻止页面跳动
$("body").on("touchmove",function(e){
e.preventDefault();
});
/**
* 屏幕自适应
*/
if(isPC)
LGlobal.stageScale = LStageScaleMode.NO_SCALE;
else
LGlobal.stageScale = LStageScaleMode.EXACT_FIT;
LSystem.screen(LStage.FULL_SCREEN);
/**
* 初始化游戏
*/
var speedMain = 5;
var gameWidth = 640;
var gameHeight,WHrate;
if(isPC){
gameHeight = 1040;
WHrate = gameWidth/gameHeight;
}else{
gameHeight = window.innerHeight * gameWidth / window.innerWidth;
}
// 全局变量
var initFlag = true;
var portrait = false;
//判断横屏
function orien() {
if(window.orientation== 90 || window.orientation == -90) {
if(initFlag) {
initFlag = false;
portrait = true;
}
$("#landscape").show();
} else {
$("#landscape").hide();
if(portrait) {
location.reload();
} else {
if(initFlag) {
initFlag = false;
}
}
}
}
orien();
$(window).on("orientationchange", orien);
LInit(1000/60, "main", gameWidth, gameHeight,main);
if(isPC){
window.onresize = resizeEl;
}
function resizeEl(){
var hh = window.innerHeight;
var ww = WHrate*hh;
LGlobal.resize(ww,hh);
var Hrate = hh/gameHeight;
}
//添加后可以定义Zepto swipe事件
LGlobal.touchHandler = function(){};
/**层变量*/
var containerLayer,footLayer,loadingLayer,publicLayer,loaderStep=0,codeLayer,codeLayer_mask;
//loading层图片
var loading_imgData = http://www.mamicode.com/new Array();
var loading_imglist = {};
loading_imgData.push({name: "code",path: "img/loading/code.png"});
for(var i=0;i<loading_imgData.length;i++){
loading_imgData[i].path = prefix+loading_imgData[i].path+version;
}
function main(){
LMouseEventContainer.set(LMouseEvent.MOUSE_UP, false);
LMouseEventContainer.set(LMouseEvent.MOUSE_DOWN, false);
LLoadManage.load(
loading_imgData,
function(progress) {
},
function(result) {
loading_imglist = result;
loadingInit();
}
);
}
/**
* 内容图片path数组
*/
var imgData = http://www.mamicode.com/new Array();
var imglist = {};
imgData = http://www.mamicode.com/[
// 、、、、、、、、、、、、、、、、、、、、、、黑入、、、、、、、、、、、、、、、、、、、
{name:"end_bg",path:"img/end_bg.jpg"},
{name:"check",path:"img/car_control/check.jpg"},
{name:"music",path:"img/car_control/music.jpg"},
{name:"music_off_black",path:"img/car_control/music_off_black.png"},
{name:"music_off_white",path:"img/car_control/music_off_white.png"},
{name:"music_on_black",path:"img/car_control/music_on_black.png"},
{name:"music_on_white",path:"img/car_control/music_on_white.png"},
// 、、、、、、、、、、、、、、、、、、开始界面、、、、、、、、、、、、、、、、、
{name:"model_s",path:"img/car_select/model_s.png"},
{name:"model_x",path:"img/car_select/model_x.png"},
{name:"progress",path:"img/car_control/progress.png"},
{name:"select",path:"img/car_select/select.png"},
// .......................................map1/////////////////////////////////////////
{name:"startP",path:"img/start/start.png"},
{name:"positionMap",path:"img/start/position/start2.jpg"},
{name:"clock_black",path:"img/car_control/clock_black.jpg"},
{name:"zhuanxiang_blake",path:"img/car_control/zhuanxiang_blake.jpg"},
// {name:"yugua",path:"img/car_control/yugua.jpg"},
{name:"zuoyi_clock",path:"img/car_control/zuoyi_clock.jpg"},
{name:"shache_clock",path:"img/car_control/shache_clock.jpg"},
{name:"door_clock",path:"img/car_control/door_clock.jpg"},
{name:"finishi_clock",path:"img/car_control/finishi_clock.jpg"},
{name:"bottom_words",path:"img/bottom_words.jpg"},
{name:"tencent",path:"img/tencent.jpg"}
// {name:"mirrorBack_clock",path:"img/car_control/mirrorBack_clock.jpg"}
];
for(var k = 0;k < 35; k ++){
var str_name = "black_in" + k;
var path = "img/car_select/black_in/loop/" + k + ".jpg";
imgData.push({name:str_name,path:path});
}
for(var k = 0;k < 103; k ++){
var str_name = "start_loading" + k;
var path = "img/start/loading_start/" + k + ".jpg";
imgData.push({name:str_name,path:path});
}
for(var k = 0;k < 51;k ++){
var str_name = "start_loop" + k;
var path = "img/start/start_loop/" + k + ".jpg";
imgData.push({name:str_name,path:path});
}
for(var k = 0;k < 76; k ++){
var str_name = "map1_loop" + k;
var path = "img/car_select/map1_loop/" + k + ".jpg";
imgData.push({name:str_name,path:path});
}
//for(var k = 0;k < 76; k ++){
// var str_name = "map2_loop" + k;
// var path = "img/car_select/map2_loop/" + k + ".jpg";
// imgData.push({name:str_name,path:path});
//}
//for(var k = 0;k < 74; k ++){
// var str_name = "map3_loop" + k;
// var path = "img/car_select/map3_loop/" + k + ".jpg";
// imgData.push({name:str_name,path:path});
//}
for(var k = 0;k < 27; k ++){
var str_name = "map1_start" + k;
var path = "img/car_select/map1_start/" + k + ".jpg";
imgData.push({name:str_name,path:path});
}
//for(var k = 0;k < 27; k ++){
// var str_name = "map2_start" + k;
// var path = "img/car_select/map2_start/" + k + ".jpg";
// imgData.push({name:str_name,path:path});
//}
//for(var k = 0;k < 27; k ++){
// var str_name = "map3_start" + k;
// var path = "img/car_select/map3_start/" + k + ".jpg";
// imgData.push({name:str_name,path:path});
//}
for(var k = 0;k < 26;k ++){
var str_name = "scanX" + k;
var path = "img/car_select/scanX/" + k + ".jpg";
imgData.push({name:str_name,path:path});
}
for(var k = 0;k< 26;k ++){
var str_name = "scanX_loop" + k;
var path = "img/car_select/scanX_loop/" + k + ".jpg";
imgData.push({name:str_name,path:path});
}
for(var k = 0;k< 19;k ++){
var str_name = "endLoop" + k;
var path = "img/endLoop/" + k + ".jpg";
imgData.push({name:str_name,path:path});
}
for(var k = 0;k< 220;k ++){
var str_name = "ghost" + k;
var path = "img/ghost/" + k + ".jpg";
imgData.push({name:str_name,path:path});
}
for(var k = 0;k < 20; k ++){
var str_name = "re_loading" + k;
var path = "img/car_select/loading/" + k + ".png";
imgData.push({name:str_name,path:path});
}
for(var k = 0;k < 76; k ++){
var str_name = "carSmall_s" + k;
var path = "img/car_select/car_s/" + k + ".jpg";
imgData.push({name:str_name,path:path});
}
for(var i=0;i<imgData.length;i++){
imgData[i].path = prefix+imgData[i].path+version;
}
/**
* loading
*/
var loading0,loading;
function loadingInit(){
if(isPC){
LMouseEventContainer.set(LMouseEvent.MOUSE_MOVE,false);
resizeEl();
}
footLayer = new LSprite();
addChild(footLayer);
containerLayer = new LSprite();
containerLayer.y = gameHeight - 1040;
addChild(containerLayer);
loadingLayer = new LSprite();
addChild(loadingLayer);
loadingLayer.graphics.drawRect(0,‘#1c1c20‘,[0,0,gameWidth,gameHeight],true,‘#1c1c20‘);
publicLayer = new LSprite();
addChild(publicLayer);
codeLayer = new LSprite();
loadingLayer.addChild(codeLayer);
codeLayer.x = 42;
codeLayer.y = 42;
loading = new LSprite();
codeLayer.addChild(loading);
loading0 = new LBitmap(new LBitmapData(loading_imglist[‘code‘]));
loading.addChild(loading0);
var loading_mask = new LSprite();
codeLayer.addChild(loading_mask);
loading_mask.graphics.drawRect(0,‘#fff‘,[0,0,gameWidth,3212]);
loading.mask = loading_mask;
loading_mask.y = -3212;
var timer1 = setInterval(loading_mask_run,50);
var is_run = false;
var is_stop = false;
var ani_up = null;
var textArr = [
[
‘sdfsdfsa45934iorejg0e9g‘,‘要进行颠覆性创新的时候,我才会去做必要的颠覆,‘
],
[
‘uejgo‘,‘必要的破坏‘
],
[
‘ijoegu09erug0eu‘,‘——特斯拉创始人 埃隆·马斯克‘
],
[
‘sdffewfewewd‘,‘并非所有黑客都用心险恶,‘
],
[
‘rttewt43tefd‘,‘他们只是喜欢不断地超越自己 ‘
],
[
‘aewfwe4r43tr43t3‘,‘——世界头号黑客 凯文·米特尼克‘
],
[
‘43t34gergfey45yegfer‘,‘我想不出有什么东西比做为神更让人上瘾的了‘
],
[
‘ryry45y‘,‘——凯文·凯利‘
]
];
var text11 = new LTextField();
loading.addChild(text11);
text11.size = 24;
text11.color = ‘#00fcff‘;
text11.font = ‘TinyPixy‘;
text11.y = 900;
text11.text = textArr[0][1];
var text12 = text11.clone();
loading.addChild(text12);
text12.y = 940;
text12.text = textArr[1][1];
var text13 = text11.clone();
loading.addChild(text13);
text13.y = 980;
text13.text = textArr[2][1];
var text21 = text11.clone();
loading.addChild(text21);
text21.y = 1890;
text21.text = textArr[3][1];
var text22 = text11.clone();
loading.addChild(text22);
text22.y = 1930;
text22.text = textArr[4][1];
var text23 = text11.clone();
loading.addChild(text23);
text23.y = 1970;
text23.text = textArr[5][1];
var text31 = text11.clone();
loading.addChild(text31);
text31.y = 2970;
text31.text = textArr[6][1];
var text32 = text11.clone();
loading.addChild(text32);
text32.y = 3010;
text32.text = textArr[7][1];
function loading_mask_run(){
if(is_stop)return false;
loading_mask.y += 20;
if(loading_mask.y == -3212+80){
var textField1 = new LTextField();
loading.addChild(textField1);
textField1.size = 24;
textField1.color = ‘#00fcff‘;
textField1.font = ‘TinyPixy‘;
textField1.y = 60-8;
textField1.text = ‘[0%]‘;
var num = 0;
textField1.text = ‘[‘+num+‘%]‘;
var timer = setInterval(function(){
num = parseFloat((num + 0.01).toFixed(2));
textField1.text = ‘[‘+ num +‘%]‘;
if(num == 7){
clearInterval(timer);
}
},1);
}
if(loading_mask.y == -3212+200){
var textField1 = new LTextField();
loading.addChild(textField1);
textField1.size = 24;
textField1.color = ‘#00fcff‘;
textField1.font = ‘TinyPixy‘;
textField1.y = 180-8;
var num = 7;
textField1.text = ‘[‘+num+‘%]‘;
var timer = setInterval(function(){
num = parseFloat((num + 0.01).toFixed(2));
textField1.text = ‘[‘+ num +‘%]‘;
if(num == 13.33){
clearInterval(timer);
}
},1);
}
if(loading_mask.y == -3212+280){
var textField1 = new LTextField();
loading.addChild(textField1);
textField1.size = 24;
textField1.color = ‘#00fcff‘;
textField1.font = ‘TinyPixy‘;
textField1.y = 260-8;
var num = 13.33;
textField1.text = ‘[‘+num+‘%]‘;
var timer = setInterval(function(){
num = parseFloat((num + 0.01).toFixed(2));
textField1.text = ‘[‘+ num +‘%]‘;
if(num == 22.10){
clearInterval(timer);
}
},1);
}
if(loading_mask.y == -3212+1160){
var textField1 = new LTextField();
loading.addChild(textField1);
textField1.size = 24;
textField1.color = ‘#00fcff‘;
textField1.font = ‘TinyPixy‘;
textField1.y = 1140-8;
var num = 22.10;
textField1.text = ‘[‘+num+‘%]‘;
var timer = setInterval(function(){
num = parseFloat((num + 0.01).toFixed(2));
textField1.text = ‘[‘+ num +‘%]‘;
if(num == 37){
clearInterval(timer);
}
},1);
}
if(loading_mask.y == -3212+1680){
var textField1 = new LTextField();
loading.addChild(textField1);
textField1.size = 24;
textField1.color = ‘#00fcff‘;
textField1.font = ‘TinyPixy‘;
textField1.y = 1660-8;
var num = 37;
textField1.text = ‘[‘+num+‘%]‘;
var timer = setInterval(function(){
num = parseFloat((num + 0.01).toFixed(2));
textField1.text = ‘[‘+ num +‘%]‘;
if(num == 42.4){
clearInterval(timer);
}
},1);
}
if(loading_mask.y == -3212+2100){
var textField1 = new LTextField();
loading.addChild(textField1);
textField1.size = 24;
textField1.color = ‘#00fcff‘;
textField1.font = ‘TinyPixy‘;
textField1.y = 2080-8;
var num = 42.4;
textField1.text = ‘[‘+num+‘%]‘;
var timer = setInterval(function(){
num = parseFloat((num + 0.01).toFixed(2));
textField1.text = ‘[‘+ num +‘%]‘;
if(num == 56.2){
clearInterval(timer);
}
},1);
}
if(loading_mask.y == -3212+2240){
var textField1 = new LTextField();
loading.addChild(textField1);
textField1.size = 24;
textField1.color = ‘#00fcff‘;
textField1.font = ‘TinyPixy‘;
textField1.y = 2220-8;
var num = 56.2;
textField1.text = ‘[‘+num+‘%]‘;
var timer = setInterval(function(){
num = parseFloat((num + 0.01).toFixed(2));
textField1.text = ‘[‘+ num +‘%]‘;
if(num == 66.2){
clearInterval(timer);
}
},1);
}
if(loading_mask.y == -3212+2660){
var textField1 = new LTextField();
loading.addChild(textField1);
textField1.size = 24;
textField1.color = ‘#00fcff‘;
textField1.font = ‘TinyPixy‘;
textField1.y = 2640-8;
var num = 66.2;
textField1.text = ‘[‘+num+‘%]‘;
var timer = setInterval(function(){
num = parseFloat((num + 0.01).toFixed(2));
textField1.text = ‘[‘+ num +‘%]‘;
if(num == 73.5){
clearInterval(timer);
}
},1);
}
if(loading_mask.y == -3212+3140){
is_stop = true;
textField_percent = new LTextField();
loading.addChild(textField_percent);
textField_percent.size = 24;
textField_percent.color = ‘#00fcff‘;
textField_percent.font = ‘TinyPixy‘;
textField_percent.y = 3120-8;
var num = 73.5;
textField_percent.text = ‘[‘+loaderStep+‘%]‘;
var timer = setInterval(function(){
textField_percent.text = ‘[‘+ loaderStep +‘%]‘;
if(loaderStep == 100){
clearInterval(timer);
setTimeout(function(){
textField_percent.text = ‘[‘+loaderStep+‘%]‘;
is_stop = false;
},1);
}
// if(loaderStep<num)return false;
// num = parseFloat((num + 0.01).toFixed(2));
// textField_percent.text = ‘[‘+ num +‘%]‘;
// if(num == 100){
// textField_percent.text = ‘[‘+num+‘%]‘;
// clearInterval(timer);
// is_stop = false;
// }
},1);
}
if(loading_mask.y >= 20){
clearInterval(timer1);
setTimeout(gameInit,1);
}
if(loading_mask.y >= gameHeight-3212-42-150){
if(is_run)return false;
is_run = true;
ani_up = LTweenLite.to(codeLayer,6,{y:gameHeight - 3212 - 42});
}
}
codeLayer_mask = new LSprite();
loadingLayer.addChild(codeLayer_mask);
codeLayer_mask.graphics.drawRect(0,‘#00fcff‘,[42,42,gameWidth,gameHeight-42]);
codeLayer.mask = codeLayer_mask;
LLoadManage.load(
imgData,
function(progress) {
loaderStep = progress;
},
function(result) {
imglist = result;
}
);
}
function gameInit() {
background.play();
if(gameHeight > 1040){
LTweenLite.to(loadingLayer,0.5,{y:-gameHeight}).to(loadingLayer,.5,{y:-gameHeight+100+(gameHeight - 1040),ease:LEasing.Sine.easeOut})
.to(loading,0,{alpha:0});
}else{
LTweenLite.to(loadingLayer,0.5,{y:-gameHeight}).to(loadingLayer,.5,{y:-gameHeight+100,ease:LEasing.Sine.easeOut});
}
LTweenLite.to(codeLayer,0,{y:gameHeight - 3212 - 42 + 20 - 10,delay:0.5})
.to(loading0,0,{y:-110});
LTweenLite.to(codeLayer_mask,0,{y:-20,delay:0.5});
audio3.play();
audio2.play();
// 、、、、、、、、、、、、、、、、、、、、、、、、loading屏幕上部图片文字、、、、、、、、、、、、、、、、、、、
var arr_text = [
{old:"abslriodjghsito",new:"抱歉,马斯克,你的特斯拉归我了"},//0
{old:"alsieosjgflsr",new:"正在搜索GPS信号,调取你的坐标以定位特斯拉..."},//1
{old:"seodigfngdehjkj",new:"正在解析你的位置..."},//2
{old:"iglid",new:"定位完毕:"},
{old:"wodjfhgiurjwnded",new:"扫描你半径3公里内的特斯拉..."},
{old:"jdiijgudnghds",new:"选择你要接入的特斯拉..."},
{old:"hghnesj",new:"连接中.../"},//6
{old:"nsodkgjdurh",new:"热感镜头调用中.../"},
{old:"nsieoskdjfh",new:"监听模块开启中.../"},
{old:"jdnsid",new:"[接入成功]"},//9
{old:"jsncisj",new:"[转向灯开启]"},
{old:"nghdisjudyew",new:"转向灯系统接入中.../"},
{old:"jsiowjs",new:"派对开始:-)"},//12
{old:"woidjrh",new:"[雨刷器打开]"},
{old:"bndjksiehs",new:"雨刷器接入中.../"},
{old:"jwidjgn",new:"摇摆起来:-)"},//15
{old:"wodkjf",new:"[座椅调整]"},
{old:"owkdngjuews",new:"电动座椅接入中.../"},
{old:"bnsldk",new:"坐稳了:-)"},//18
{old:"idksne",new:"[车门开启]"},
{old:"ieoskdjfnsl",new:"车门系统解锁中.../"},
{old:"jidowkd",new:"芝麻开门:-)"},//21
{old:"ngksiuh",new:"[后视镜折叠]"},
{old:"okjidwnsld",new:"后视镜收起中.../"},
{old:"oijdnghdiusn",new:"别回头,后果很严重:-)"},//24
{old:"bjsowk",new:"[刹车控制]"},
{old:"woqkdngks",new:"刹车制动中.../"},
{old:"nbkdig",new:"定身术:-)"},//27
{old:"ujgisoaldn",new:"接入进度[100%]"},
{old:"bjsoeisngk",new:"[科恩破解特斯拉实录]"},
{old:"gidoslengkse",new:"召唤加入黑客阵营.../"}
]
var startP1 = new LSprite();
codeLayer.addChild(startP1);
var startP1_son = new LSprite();
startP1.addChild(startP1_son);
var ImgStartP1 = new LBitmap(new LBitmapData(imglist[‘startP‘]));//图片
startP1_son.addChild(ImgStartP1);
startP1.y = 3226;
var textOne = new LTextField();
startP1_son.addChild(textOne);
textOne.size = 24;
textOne.color = ‘#00fcff‘;
textOne.font = ‘TinyPixy‘;
textOne.y = 113;
textOne.text = arr_text[0].old;
var textTwo = new LTextField();
startP1_son.addChild(textTwo);
textTwo.size = 24;
textTwo.color = ‘#00fcff‘;
textTwo.font = ‘TinyPixy‘;
textTwo.y = 291;
textTwo.text = arr_text[1].old;
var textThree = new LTextField();
startP1_son.addChild(textThree);
textThree.size = 24;
textThree.color = ‘#00fcff‘;
textThree.font = ‘TinyPixy‘;
textThree.y = 434;
textThree.text = arr_text[2].old;
var textFour = new LTextField();
startP1_son.addChild(textFour);
textFour.size = 24;
textFour.color = ‘#00fcff‘;
textFour.font = ‘TinyPixy‘;
textFour.y = 573;
textFour.text = arr_text[3].old;
var textFive = new LTextField();
startP1_son.addChild(textFive);
textFive.size = 24;
textFive.color = ‘#00fcff‘;
textFive.font = ‘TinyPixy‘;
textFive.y = 773;
textFive.text = arr_text[4].old;
var textSix = new LTextField();
startP1_son.addChild(textSix);
textSix.size = 24;
textSix.color = ‘#00fcff‘;
textSix.font = ‘TinyPixy‘;
textSix.y = 1013;
textSix.text = arr_text[5].old;
////////////////////////////////////////////////////////////////////////////////////
var textSeven = new LTextField();
startP1_son.addChild(textSeven);
textSeven.size = 24;
textSeven.color = ‘#00fcff‘;
textSeven.font = ‘TinyPixy‘;
textSeven.y = 1210;
textSeven.text = arr_text[6].old;
var textEight = new LTextField();
startP1_son.addChild(textEight);
textEight.size = 24;
textEight.color = ‘#00fcff‘;
textEight.font = ‘TinyPixy‘;
textEight.y = 1310;
textEight.text = arr_text[7].old;
var textNine = new LTextField();
startP1_son.addChild(textNine);
textNine.size = 24;
textNine.color = ‘#00fcff‘;
textNine.font = ‘TinyPixy‘;
textNine.y = 1430;
textNine.text = arr_text[8].old;
var textTen = new LTextField();
startP1_son.addChild(textTen);
textTen.size = 24;
textTen.color = ‘#00fcff‘;
textTen.font = ‘TinyPixy‘;
textTen.y = 1530;
textTen.text = arr_text[9].old;
//ok 接入成功
var textEleven = new LTextField();
startP1_son.addChild(textEleven);
textEleven.size = 24;
textEleven.color = ‘#00fcff‘;
textEleven.font = ‘TinyPixy‘;
textEleven.y = 1750;
textEleven.text = arr_text[10].old;
var textTwelve = new LTextField();
startP1_son.addChild(textTwelve);
textTwelve.size = 24;
textTwelve.color = ‘#00fcff‘;
textTwelve.font = ‘TinyPixy‘;
textTwelve.y = 1850;
textTwelve.text = arr_text[11].old;
var textThirteen = new LTextField();
startP1_son.addChild(textThirteen);
textThirteen.size = 24;
textThirteen.color = ‘#00fcff‘;
textThirteen.font = ‘TinyPixy‘;
textThirteen.y = 1970;
textThirteen.text = arr_text[12].old;
var textFourteen = new LTextField();
startP1_son.addChild(textFourteen);
textFourteen.size = 24;
textFourteen.color = ‘#00fcff‘;
textFourteen.font = ‘TinyPixy‘;
textFourteen.y = 2130;
textFourteen.text = arr_text[13].old;
var textFifteen = new LTextField();
startP1_son.addChild(textFifteen);
textFifteen.size = 24;
textFifteen.color = ‘#00fcff‘;
textFifteen.font = ‘TinyPixy‘;
textFifteen.y = 2230;
textFifteen.text = arr_text[14].old;
var textSixteen = new LTextField();
startP1_son.addChild(textSixteen);
textSixteen.size = 24;
textSixteen.color = ‘#00fcff‘;
textSixteen.font = ‘TinyPixy‘;
textSixteen.y = 2350;
textSixteen.text = arr_text[15].old;
//ok
////////////////////////////////////////////////////////////////////////////////////
var textSeventeen = new LTextField();
startP1_son.addChild(textSeventeen);
textSeventeen.size = 24;
textSeventeen.color = ‘#00fcff‘;
textSeventeen.font = ‘TinyPixy‘;
textSeventeen.y = 2510;
textSeventeen.text = arr_text[16].old;
var textEightteen = new LTextField();
startP1_son.addChild(textEightteen);
textEightteen.size = 24;
textEightteen.color = ‘#00fcff‘;
textEightteen.font = ‘TinyPixy‘;
textEightteen.y = 2610;
textEightteen.text = arr_text[17].old;
var textNineteen = new LTextField();
startP1_son.addChild(textNineteen);
textNineteen.size = 24;
textNineteen.color = ‘#00fcff‘;
textNineteen.font = ‘TinyPixy‘;
textNineteen.y = 2710;
textNineteen.text = arr_text[18].old;
var textTwenty = new LTextField();
startP1_son.addChild(textTwenty);
textTwenty.size = 24;
textTwenty.color = ‘#00fcff‘;
textTwenty.font = ‘TinyPixy‘;
textTwenty.y = 2890;
textTwenty.text = arr_text[19].old;
var textTwenty_one = new LTextField();
startP1_son.addChild(textTwenty_one);
textTwenty_one.size = 24;
textTwenty_one.color = ‘#00fcff‘;
textTwenty_one.font = ‘TinyPixy‘;
textTwenty_one.y = 2990;
textTwenty_one.text = arr_text[20].old;
var textTwenty_two = new LTextField();
startP1_son.addChild(textTwenty_two);
textTwenty_two.size = 24;
textTwenty_two.color = ‘#00fcff‘;
textTwenty_two.font = ‘TinyPixy‘;
textTwenty_two.y = 3110;
textTwenty_two.text = arr_text[21].old;
//ok
var textTwenty_three = new LTextField();
startP1_son.addChild(textTwenty_three);
textTwenty_three.size = 24;
textTwenty_three.color = ‘#00fcff‘;
textTwenty_three.font = ‘TinyPixy‘;
textTwenty_three.y = 3310;
textTwenty_three.text = arr_text[22].old;
var textTwenty_four = new LTextField();
startP1_son.addChild(textTwenty_four);
textTwenty_four.size = 24;
textTwenty_four.color = ‘#00fcff‘;
textTwenty_four.font = ‘TinyPixy‘;
textTwenty_four.y = 3410;
textTwenty_four.text = arr_text[23].old;
var textTwenty_five = new LTextField();
startP1_son.addChild(textTwenty_five);
textTwenty_five.size = 24;
textTwenty_five.color = ‘#00fcff‘;
textTwenty_five.font = ‘TinyPixy‘;
textTwenty_five.y = 3530;
textTwenty_five.text = arr_text[24].old;
var textTwenty_six = new LTextField();
startP1_son.addChild(textTwenty_six);
textTwenty_six.size = 24;
textTwenty_six.color = ‘#00fcff‘;
textTwenty_six.font = ‘TinyPixy‘;
textTwenty_six.y = 3710;
textTwenty_six.text = arr_text[25].old;
////////////////////////////////////////////////////////////////////////////////////
var textTwenty_seven = new LTextField();
startP1_son.addChild(textTwenty_seven);
textTwenty_seven.size = 24;
textTwenty_seven.color = ‘#00fcff‘;
textTwenty_seven.font = ‘TinyPixy‘;
textTwenty_seven.y = 3830;
textTwenty_seven.text = arr_text[26].old;
var textTwenty_eight = new LTextField();
startP1_son.addChild(textTwenty_eight);
textTwenty_eight.size = 24;
textTwenty_eight.color = ‘#00fcff‘;
textTwenty_eight.font = ‘TinyPixy‘;
textTwenty_eight.y = 3950;
textTwenty_eight.text = arr_text[27].old;
var textTwenty_nine = new LTextField();
startP1_son.addChild(textTwenty_nine);
textTwenty_nine.size = 24;
textTwenty_nine.color = ‘#00fcff‘;
textTwenty_nine.font = ‘TinyPixy‘;
textTwenty_nine.y = 4170;
textTwenty_nine.text = arr_text[28].old;
var textTirty = new LTextField();
startP1_son.addChild(textTirty);
textTirty.size = 24;
textTirty.color = ‘#00fcff‘;
textTirty.font = ‘TinyPixy‘;
textTirty.y = 4530;
textTirty.text = arr_text[29].old;
var textTirty_one = new LTextField();
startP1_son.addChild(textTirty_one);
textTirty_one.size = 24;
textTirty_one.color = ‘#00fcff‘;
textTirty_one.font = ‘TinyPixy‘;
textTirty_one.y = 4570;
textTirty_one.text = arr_text[30].old;
//loading完开始场景
var startTesla = createPlayer("start_loading",imglist,104,320,520);
startTesla.scaleX = startTesla.scaleY = 2;
startTesla.speed = speedMain;
var positionPlayer = createPlayer("start_loop",imglist,51,320,520);
positionPlayer.scaleX = positionPlayer.scaleY = 2;
positionPlayer.speed = speedMain;
positionPlayer.stop();
startTesla.stop();
//选择两辆特斯拉场景;
var lookingFor = new LSprite();
var blacke_in = new LSprite();
lookingFor.addChild(blacke_in);
blacke_in.graphics.drawRect(0,"#ff0000",[414,790,180,170]);
var caseBlakeIn = "man";
// "man"为男性
// "woman"为女性;
//点击黑入按钮进入互动界面;
var loadingContain = new LSprite();
var loadingCircle = createPlayer("re_loading",imglist,20,100,22);
loadingContain.graphics.drawRect(0,"#ffffff",[0,0,170,170],true,"rgba(0,0,0,0.8)");
loadingContain.x = 419;
loadingContain.y = 785;
loadingContain.addChild(loadingCircle);
loadingCircle.x = 452-419;
loadingCircle.y = 863-785;
var loadingContain_text = new LTextField();
loadingContain.addChild(loadingContain_text);
loadingContain_text.size = 30;
loadingContain_text.color = ‘#fff‘;
loadingContain_text.font = ‘TinyPixy‘;
loadingContain_text.y = 100;
loadingContain_text.x = 65;
loadingContain_text.text = ‘0%‘;
var arr_loadBreakPoint = [], re_arr_loadBreakPoint = [],obj_arr_loadBreakPoint={};
var arr_doorMan = [],arr_doorWoman = [],obj_arrDoor={};
var arr_zuoyiMan = [],arr_zuoyiWoman = [],obj_arrZuoyi = {};
var arr_shacheMan = [],arr_shacheWoman = [],obj_arrShache = {};
var arr_finish = [],arr_finishW = [], obj_arrFinish = {};
// 、、、、、、、、、、、、、、、、、、、、、、、男驾驶员、、、、、、、、、、、、、、、、、、、、、、、、、、、
//、、、、、、、、、、、、、、、、、、、、、、、、转向灯、、、、、、、、、、、、、、、、、、
for(var k = 0;k < 18;k ++){
var str_name = "selectToControl_man" + k;
var path = "img/car_control/selectToControl_man/" + k + ".jpg"
arr_loadBreakPoint.push({name:str_name,path:path});
}
for(var k = 0;k < 33;k ++){
var str_name = "driverMan" + k;
var path = "img/car_control/driverManLoop/" + k + ".jpg";
arr_loadBreakPoint.push({name:str_name,path:path});
}
for(var k = 0;k < 17;k ++){
var str_name = "intoMan" + k;
var path = "img/car_control/intoMan/" + k + ".jpg";
arr_loadBreakPoint.push({name:str_name,path:path});
}
for(var k = 0;k < 22;k ++){
var str_name = "intoLoopMan" + k;
var path = "img/car_control/intoLoopMan/" + k + ".jpg";
arr_loadBreakPoint.push({name:str_name,path:path});
}
for(var k = 0;k < 59;k ++){
var str_name = "zhuanxiang" + k;
var path = "img/car_control/zhuanxiang/" + k + ".jpg";
arr_loadBreakPoint.push({name:str_name,path:path});
}
for(var k = 0;k < 48;k ++){
var str_name = "zhuanxiangMan" + k;
var path = "img/car_control/zhuanxiangMan/" + k + ".jpg";
arr_loadBreakPoint.push({name:str_name,path:path});
}
for(var k = 0;k < 41;k ++){
var str_name = "Xzhuanxiangdeng" + k;
var path = "img/car_control/Xzhuanxiangdeng/" + k + ".jpg";
arr_loadBreakPoint.push({name:str_name,path:path});
}
for(var k = 0;k < 48;k ++){
var str_name = "zhuanCenter" + k;
var path = "img/car_control/zhuanCenter/" + k + ".jpg";
arr_loadBreakPoint.push({name:str_name,path:path});
}
for(var k = 0;k < 33;k ++){
var str_name = "zhuanxiangdengLoop" + k;
var path = "img/car_control/zhuanxiangdengLoop/" + k + ".jpg";
arr_loadBreakPoint.push({name:str_name,path:path});
}
// 、、、、、、、、、、、、、、、、、、、、、车门、、、、、、、、、、、、、、、、、、、、、
for(var k = 0;k < 59;k ++){
var str_name = "door" + k;
var path = "img/car_control/door/" + k + ".jpg";
arr_doorMan.push({name:str_name,path:path});
}
for(var k = 0;k < 174;k ++){
var str_name = "doorMan" + k;
var path = "img/car_control/doorMan/" + k + ".jpg";
arr_doorMan.push({name:str_name,path:path});
}
for(var k = 0;k < 42;k ++){
var str_name = "Xdoor" + k;
var path = "img/car_control/Xdoor/" + k + ".jpg";
arr_doorMan.push({name:str_name,path:path});
}
for(var k = 0;k < 42;k ++){
var str_name = "XdoorLoop" + k;
var path = "img/car_control/XdoorLoop/" + k + ".jpg";
arr_doorMan.push({name:str_name,path:path});
}
//、、、、、、、、、、、、、、、、、、、、、、、、、、、结束按钮、、、、、、、、、、、、、、、、、、、、
for(var k = 0;k < 55;k ++){
var str_name = "finish" + k;
var path = "img/car_control/finish/" + k + ".jpg";
arr_finishW.push({name:str_name,path:path});
}
for(var k = 0;k < 51;k ++){
var str_name = "finishLoop" + k;
var path = "img/car_control/finishLoop/" + k + ".jpg";
arr_finish.push({name:str_name,path:path});
}
// 、、、、、、、、、、、、、、、、、、、、、、、、、、、、 刹车、、、、、、、、、、、、、、、、、、、、、、
for(var k = 0;k < 59;k ++){
var str_name = "shache" + k;
var path = "img/car_control/shache/" + k + ".jpg";
arr_shacheMan.push({name:str_name,path:path});
}
for(var k = 0;k < 162;k ++){
var str_name = "shacheMan" + k;
var path = "img/car_control/shacheMan/" + k + ".jpg";
arr_shacheMan.push({name:str_name,path:path});
}
//..........................................座椅、、、、、、、、、、、、、、、、、、、、、
for(var k = 0;k < 59;k ++){
var str_name = "zuoyi" + k;
var path = "img/car_control/zuoyi/" + k + ".jpg";
arr_zuoyiMan.push({name:str_name,path:path});
}
for(var k = 0;k < 181;k ++){
var str_name = "zuoyiMan" + k;
var path = "img/car_control/zuoyiMan/" + k + ".jpg";
arr_zuoyiMan.push({name:str_name,path:path});
}
for(var k = 0;k < 39;k ++){
var str_name = "Xzuoyi" + k;
var path = "img/car_control/Xzuoyi/" + k + ".jpg";
arr_zuoyiMan.push({name:str_name,path:path});
}
for(var k = 0;k < 39;k ++){
var str_name = "XzuoyiLoop" + k;
var path = "img/car_control/XzuoyiLoop/" + k + ".jpg";
arr_zuoyiMan.push({name:str_name,path:path});
}
//开车人
var lengthMan = arr_loadBreakPoint.length;
for(var a = 0;a < lengthMan;a ++){
arr_loadBreakPoint[a].path = prefix + arr_loadBreakPoint[a].path+version;
}
// 、、、、、、、、、、、、、、、、、、、女驾驶员对象数组、、、、、、、、、、、、、、、、、、
// 、、、、、、、、、、、、、、、、、、、、、转向灯、、、、、、、、、、、、、、、、、、、、、、
for(var k = 0;k < 18;k ++){
var str_name = "selectToControl_man" + k;
var path = "img/woman/selectToControl_man/" + k + ".jpg"
re_arr_loadBreakPoint.push({name:str_name,path:path});
}
for(var k = 0;k < 53;k ++){
var str_name = "intoMan" + k;
var path = "img/woman/intoMan/" + k + ".jpg";
re_arr_loadBreakPoint.push({name:str_name,path:path});
}
for(var k = 0;k < 51;k ++){
var str_name = "intoLoopMan" + k;
var path = "img/woman/intoLoopMan/" + k + ".jpg";
re_arr_loadBreakPoint.push({name:str_name,path:path});
}
for(var k = 0;k < 59;k ++){
var str_name = "zhuanxiang" + k;
var path = "img/car_control/zhuanxiang/" + k + ".jpg";
re_arr_loadBreakPoint.push({name:str_name,path:path});
}
for(var k = 0;k < 48;k ++){
var str_name = "zhuanxiangMan" + k;
var path = "img/woman/zhuanxiangMan/" + k + ".jpg";
re_arr_loadBreakPoint.push({name:str_name,path:path});
}
for(var k = 0;k < 42;k ++){
var str_name = "Xzhuanxiangdeng" + k;
var path = "img/woman/Xzhuanxiangdeng/" + k + ".jpg";
re_arr_loadBreakPoint.push({name:str_name,path:path});
}
for(var k = 0;k < 48;k ++){
var str_name = "zhuanCenter" + k;
var path = "img/car_control/zhuanCenter/" + k + ".jpg";
re_arr_loadBreakPoint.push({name:str_name,path:path});
}
for(var k = 0;k < 34;k ++){
var str_name = "zhuanxiangdengLoop" + k;
var path = "img/woman/zhuanxiangdengLoop/" + k + ".jpg";
re_arr_loadBreakPoint.push({name:str_name,path:path});
}
for(var k = 0;k < 33;k ++){
var str_name = "driverMan" + k;
var path = "img/woman/driverMan/" + k + ".jpg";
re_arr_loadBreakPoint.push({name:str_name,path:path});
}
//////////////////////////////////////////////车门、、、、、、、、、、、、、、、、、、、、、、、、、、、、
for(var k = 0;k < 59;k ++){
var str_name = "door" + k;
var path = "img/car_control/door/" + k + ".jpg";
arr_doorWoman.push({name:str_name,path:path});
}
for(var k = 0;k < 73;k ++){
var str_name = "doorMan" + k;
var path = "img/woman/doorMan/" + k + ".jpg";
arr_doorWoman.push({name:str_name,path:path});
}
for(var k = 0;k < 42;k ++){
var str_name = "Xdoor" + k;
var path = "img/woman/Xdoor/" + k + ".jpg";
arr_doorWoman.push({name:str_name,path:path});
}
for(var k = 0;k < 42;k ++){
var str_name = "XdoorLoop" + k;
var path = "img/woman/XdoorLoop/" + k + ".jpg";
arr_doorWoman.push({name:str_name,path:path});
}
// 、、、、、、、、、、、、、、、、、、、、、、、、、、、结束、、、、、、、、、、、、、、、、、、、、、、、
for(var k = 0;k < 55;k ++){
var str_name = "finish" + k;
var path = "img/car_control/finish/" + k + ".jpg";
arr_finish.push({name:str_name,path:path});
}
for(var k = 0;k < 51;k ++){
var str_name = "finishLoop" + k;
var path = "img/car_control/finishLoop/" + k + ".jpg";
arr_finishW.push({name:str_name,path:path});
}
// 。。。。。。。。。。。。。。。。。。。。。刹车、、、、、、、、、、、、、、、、、、、、、、、、、、、、
for(var k = 0;k < 59;k ++){
var str_name = "shache" + k;
var path = "img/car_control/shache/" + k + ".jpg";
arr_shacheWoman.push({name:str_name,path:path});
}
for(var k = 0;k < 165;k ++){
var str_name = "shacheMan" + k;
var path = "img/woman/shacheMan/" + k + ".jpg";
arr_shacheWoman.push({name:str_name,path:path});
}
for(var k = 0;k < 58;k ++){
var str_name = "XshacheLoop" + k;
var path = "img/woman/XshacheLoop/" + k + ".jpg";
arr_shacheWoman.push({name:str_name,path:path});
}
for(var k = 0;k < 55;k ++){
var str_name = "Xshache" + k;
var path = "img/woman/Xshache/" + k + ".jpg";
arr_shacheWoman.push({name:str_name,path:path});
}
//、、、、、、、、、、、、、、、、、、、、、、、、、座椅、、、、、、、、、、、、、、、、、、、、、、、、
for(var k = 0;k < 59;k ++){
var str_name = "zuoyi" + k;
var path = "img/car_control/zuoyi/" + k + ".jpg";
arr_zuoyiWoman.push({name:str_name,path:path});
}
for(var k = 0;k < 109;k ++){
var str_name = "zuoyiMan" + k;
var path = "img/woman/zuoyiMan/" + k + ".jpg";
arr_zuoyiWoman.push({name:str_name,path:path});
}
for(var k = 0;k < 39;k ++){
var str_name = "Xzuoyi" + k;
var path = "img/woman/Xzuoyi/" + k + ".jpg";
arr_zuoyiWoman.push({name:str_name,path:path});
}
for(var k = 0;k < 39;k ++){
var str_name = "XzuoyiLoop" + k;
var path = "img/woman/XzuoyiLoop/" + k + ".jpg";
arr_zuoyiWoman.push({name:str_name,path:path});
}
var lengthWoman = re_arr_loadBreakPoint.length;
for(var a = 0;a < lengthWoman;a ++){
re_arr_loadBreakPoint[a].path = prefix + re_arr_loadBreakPoint[a].path+version;
}
function blacke_inFunc(){
blacke_in.removeEventListener(LMouseEvent.MOUSE_DOWN,blacke_inFunc);
lookingFor.addChild(loadingContain);
if(caseBlakeIn == "man"){
LLoadManage.load(
arr_loadBreakPoint,
function(p){
loadingContain_text.text = Math.floor(p)+‘%‘;
},
function(result){
// return false;
obj_arr_loadBreakPoint = result;
loadOk();
}
)
}else if(caseBlakeIn == "woman"){
LLoadManage.load(
re_arr_loadBreakPoint,
function(p){
loadingContain_text.text = Math.floor(p)+‘%‘;
},
function(result){
// return false;
obj_arr_loadBreakPoint = result;
loadOk2();
}
)
}
}
var lookingFor1 = new LSprite();
var lookingFor2 = new LSprite();
var lookingFor3 = new LSprite();
var containSelectRect1 = new LSprite();
var selectRect1 = new LBitmap(new LBitmapData(imglist[‘select‘]));
containSelectRect1.addChild(selectRect1);
selectRect1.x = -selectRect1.width/2;
selectRect1.y = -selectRect1.height/2;
var containSelectRect2 = containSelectRect1.clone();
var containSelectRect3 = containSelectRect1.clone();
var scanX = createPlayer("scanX",imglist,26,273,183);
scanX.x = 48;
scanX.y = 786;
scanX.stop();
var scanX_loop = createPlayer("scanX_loop",imglist,26,273,183);
scanX_loop.x = 48;
scanX_loop.y = 786;
scanX_loop.stop();
scanX.addEventListener(LEvent.COMPLETE,function(){
scanX.stop();
scanX.alpha = 0;
scanX_loop.alpha = 1;
scanX_loop.play();
})
// 三张地图,三个序列帧;
// ////////////////////////////////////////////////地图1序列帧容器///////////////////////////////////////////
var road1Player = createPlayer("map1_loop",imglist,76,320,520);
var road1Start = createPlayer("map1_start",imglist,27,320,520);
road1Player.scaleX = road1Player.scaleY = 2;
road1Player.speed = speedMain;
road1Start.scaleX = road1Start.scaleY = 2;
road1Start.speed = speedMain;
road1Player.stop();
road1Start.stop();
// 矩形透明选择框;
var selectAuto1 = new LSprite();
selectAuto1.graphics.drawRect(0,"#ffffff",[422,182,120,120],true,"rgba(0,0,0,0)");
var selectAuto12 = new LSprite();
selectAuto12.graphics.drawRect(0,"#ffffff",[352,572,120,120],true,"rgba(0,0,0,0)");
lookingFor1.addChild(road1Player);
lookingFor1.addChild(containSelectRect1);
lookingFor1.addChild(selectAuto1);
lookingFor1.addChild(selectAuto12);
containSelectRect1.y = 242;
containSelectRect1.x = 488;
lookingFor1.addChild(road1Start);
road1Start.addEventListener(LEvent.COMPLETE,road1Startfunc);
function road1Startfunc(){
road1Start.stop();
lookingFor1.removeChild(road1Start);
road1Player.play();
var carSmall_s = createPlayer("carSmall_s",imglist,76,273,183);
lookingFor1.addChild(carSmall_s);
carSmall_s.x = 48;
carSmall_s.y = 786;
// carSmall_s.stop();
lookingFor1.addChild(scanX_loop);
lookingFor1.addChild(scanX);
scanX.play();
}
var black_in = createPlayer("black_in",imglist,35,180,180);
lookingFor1.addChild(black_in);
black_in.x = 411;
black_in.y = 786;
black_in.alpha = 0;
black_in.stop();
var selectRectModel_s = new LBitmap(new LBitmapData(imglist[‘model_s‘]));
var selectRectModel_x = new LBitmap(new LBitmapData(imglist[‘model_x‘]));
lookingFor1.addChild(selectRectModel_x);
selectRectModel_x.x = 284;
selectRectModel_x.y = 657;
containSelectRect1.y = 636;
containSelectRect1.x = 418;
selectAuto1.addEventListener(LMouseEvent.MOUSE_DOWN, function(){
if(caseBlakeIn == "woman")return false;
lookingFor1.addChild(selectRectModel_s);
lookingFor1.removeChild(selectRectModel_x);
selectRectModel_s.x = 520;
selectRectModel_s.y = 280;
containSelectRect1.y = 242;
containSelectRect1.x = 488;
caseBlakeIn = "woman";
scanX_loop.stop();
scanX_loop.alpha = 0;
})
selectAuto12.addEventListener(LMouseEvent.MOUSE_DOWN, function(){
if(caseBlakeIn == "man")return false;
lookingFor1.addChild(selectRectModel_x);
lookingFor1.removeChild(selectRectModel_s);
selectRectModel_x.x = 284;
selectRectModel_x.y = 657;
containSelectRect1.y = 636;
containSelectRect1.x = 418;
scanX.alpha = 1;
scanX.play();
caseBlakeIn = "man";
})
// //////////////////////////////////////////////////////////地图2序列帧容器/////////////////////////////////
var road2Player = createPlayer("map2_loop",imglist,76,320,520);
var road2Start = createPlayer("map2_start",imglist,27,320,520);
road2Player.scaleX = road2Player.scaleY = 2;
road2Player.speed = speedMain;
road2Player.stop();
road2Start.stop();
road2Start.scaleX = road2Start.scaleY = 2;
road2Start.speed = speedMain;
road2Start.addEventListener(LEvent.COMPLETE,road2StartFunc);
function road2StartFunc(){
road2Start.visible = false;
road2Player.play();
lookingFor2.removeChild(road2Start);
}
// 矩形透明选择框
var selectAuto2 = new LSprite();
selectAuto2.graphics.drawRect(0,"#ffffff",[116,228,120,120],true,"rgba(0,0,0,0)");
var selectAuto22 = new LSprite();
selectAuto22.graphics.drawRect(0,"#ffffff",[442,496,120,120],true,"rgba(0,0,0,0)");
lookingFor2.addChild(road2Player);
lookingFor2.addChild(containSelectRect2);
lookingFor2.addChild(selectAuto2);
lookingFor2.addChild(selectAuto22);
lookingFor2.addChild(road2Start);
var carSmall_s = createPlayer("carSmall_s",imglist,76,273,183);
lookingFor2.addChild(carSmall_s);
carSmall_s.x = 48;
carSmall_s.y = 786;
carSmall_s.stop();
containSelectRect2.y = 308;
containSelectRect2.x = 176;
selectAuto2.addEventListener(LMouseEvent.MOUSE_DOWN, function(){
lookingFor2.addChild(selectRectModel_x);
lookingFor2.removeChild(selectRectModel_s);
selectRectModel_x.x = 48;
selectRectModel_x.y = 328;
containSelectRect2.y = 308;
containSelectRect2.x = 176;
caseBlakeIn = "man";
lookingFor2.addChild(scanX_loop);
lookingFor2.addChild(scanX);
scanX.play();
})
selectAuto22.addEventListener(LMouseEvent.MOUSE_DOWN, function(){
lookingFor2.addChild(selectRectModel_s);
lookingFor2.removeChild(selectRectModel_x);
selectRectModel_s.x = 370;
selectRectModel_s.y = 596;
containSelectRect2.y = 556;
containSelectRect2.x = 502;
caseBlakeIn = "woman";
// lookingFor2.removeChild(scanX);
// lookingFor2.removeChild(scanX_loop);
scanX_loop.stop();
scanX_loop.visible=false;
})
/////////////////////////////////////////////////// 地图3序列帧容器/////////////////////////////////////
var road3Player = createPlayer("map3_loop",imglist,74,320,520);
var road3Start = createPlayer("map3_start",imglist,27,320,520);
road3Player.scaleX = road3Player.scaleY = 2;
road3Player.speed = speedMain;
road3Player.stop();
road3Start.stop();
road3Start.speed = speedMain;
road3Start.scaleX = road3Start.scaleY = 2;
road3Start.addEventListener(LEvent.COMPLETE,road3StartFunc);
function road3StartFunc(){
road3Start.visible = false;
road3Player.play();
lookingFor3.removeChild(road3Start);
}
// 矩形透明选择框
var selectAuto3 = new LSprite();
selectAuto3.graphics.drawRect(0,"#ffffff",[170,194,120,120],true,"rgba(0,0,0,0)");
var selectAuto32 = new LSprite();
selectAuto32.graphics.drawRect(0,"#ffffff",[454,500,120,120],true,"rgba(0,0,0,0)");
lookingFor3.addChild(road3Player);
lookingFor3.addChild(containSelectRect3);
lookingFor3.addChild(selectAuto3);
lookingFor3.addChild(selectAuto32);
lookingFor3.addChild(road3Start);
containSelectRect3.y = 254;
containSelectRect3.x = 230;
selectAuto3.addEventListener(LMouseEvent.MOUSE_DOWN, function(){
lookingFor3.addChild(selectRectModel_x);
lookingFor3.removeChild(selectRectModel_s);
selectRectModel_x.x = 262;
selectRectModel_x.y = 278;
containSelectRect3.y = 254;
containSelectRect3.x = 230;
caseBlakeIn = "man";
lookingFor3.addChild(scanX_loop);
lookingFor3.addChild(scanX);
scanX.play();
})
selectAuto32.addEventListener(LMouseEvent.MOUSE_DOWN, function(){
lookingFor3.addChild(selectRectModel_s);
lookingFor3.removeChild(selectRectModel_x);
selectRectModel_s.x = 390;
selectRectModel_s.y = 586;
containSelectRect3.y = 560;
containSelectRect3.x = 514;
caseBlakeIn = "woman";
// console.log("222222222222222");
// lookingFor3.removeChild(scanX);
// lookingFor3.removeChild(scanX_loop);
scanX_loop.stop();
scanX_loop.visible=false;
})
//随机地图序列帧;
var arrRandom = [lookingFor1,lookingFor2,lookingFor3];
// var roadPlayerRandom = arrRandom[Math.floor(Math.random() * 3)];
var roadPlayerRandom = lookingFor1;
lookingFor.addChildAt(roadPlayerRandom,0);
var lat,lag;//纬度,经度
loadingEnd();
// 、、、、、、、、、、、、、、、、、、、、、、加载完loading后的第一二个序列帧、、、、、、、、、、、、、、、、、
function loadingEnd(){
containerLayer.addChild(positionPlayer);
containerLayer.addChild(startTesla);
startTesla.play();
//第二场景出现,移出第一场景;
startTesla.addEventListener(LEvent.COMPLETE, function(){
positionPlayer.play();
containerLayer.removeChild(startTesla);
upCodes(-180,1,true,function(inter2){
//开始定位;
// getLocation(inter2);
showError();
});
});
///////////////////////////////////。。。。。。。。。。 头部显示正在定位///////////////////////////////
var once_codeLoading = setInterval(function(){
if(codeLayer.y == gameHeight - 3212 - 42 + 20 - 150){
clearInterval(once_codeLoading);
upCodes(0,0,false);
}else{
codeLayer.y -= 20;
}
},200)
// },1000);
}
//////////////////////////////////////////////页面顶部代码翻页方法,////////////////////////////////////////
function upCodes(distance_main,index,entering,func){
var up_inter = setInterval(function(){
if(startP1_son.y <= distance_main){
clearInterval(up_inter);
var until = arr_text[index].new.length;
var num = 0;
setTimeout(function(){
var inter = setInterval(function(){
num ++;
var re_tex = sortText(arr_text[index].old);
startP1_son.getChildAt(index + 1).text = arr_text[index].new.substring(0,num) + re_tex.substring(num);
if(num == until){
clearInterval(inter);
if(entering){
var num2 = 0;
var str = "";
var inter2 = setInterval(function(){
if(num2 >3 ){
num2 = 0;
str = "";
}
startP1_son.getChildAt(index + 1).text = arr_text[index].new.substring(0,num - 3) + str;
num2 ++;
str += ".";
// console.log("dddd")
},200)//省略号速度;
func(inter2);
}
}
},100)//代码左右换字的速度
},0)//头部代码不再往上顶之后延迟几秒开始代码左右换字
}else{
startP1_son.y -= 20;
}
},50)//头部代码往上顶的 速度
}
// ///////////////////////////////////////////////////////序列帧元素图片对象数组方法/////////////////////////////
function arrImg(name){
var arr = [];
var reg = new RegExp("^" + name);
for(var i in imglist){
if(reg.test(i)){
arr.push(imglist[i]);
}
}
// console.log(reg,arr);
return arr;
}
// ////////////////////////////////////////////////获取地理经纬度//////////////////////////////
function getLocation(inter2){
var geolocation = new qq.maps.Geolocation("WF3BZ-PPHW6-NQJS7-MGUXB-E7VBS-EDFJQ", "myapp");
geolocation.getLocation(function(position){
lat = position.lat; //纬度
lng = position.lng; //经度
clearInterval(inter2);
startP1_son.getChildAt(1 + 1).text = arr_text[1].new + "/";
upCodes(-320,2,true,function(inter){
// 解析地址
qq.maps.convertor.translate(new qq.maps.LatLng(lat,lng), 1, function(res){
//取出经纬度并且赋值
latlng = res[0];
var geocoder = new qq.maps.Geocoder({
complete:function(result){
clearInterval(inter);
// ///////////////////////////////////定位成功开始显示位置//////////////////////////////////////
startP1_son.getChildAt(2 + 1).text = arr_text[2].new + "/";
arr_text[3].new = "定位完毕 : <"+ result.detail.address + ">";
arr_text[3].old = "";
var leng = arr_text[3].new.length;
var arr_w = "lkjiwejrlkngafdadfkng";
for(var k = 0;k < leng;k ++){
arr_text[3].old += arr_w.charAt(Math.floor(Math.random()*21));
}
upCodes(-460,3,false);
// 定位结束,延时10s进入下一场;
setTimeout(function(){
// 扫描你定位3公里的特斯拉啊;
upCodes(-660,4,true,function(inter){
setTimeout(function(){
LTweenLite.to(black_in,2,{alpha:1,onComplete:function(){
black_in.play();
}});
clearInterval(inter);
startP1_son.getChildAt(4 + 1).text = arr_text[4].new + "/";
var objSon = roadPlayerRandom.getChildAt(1);
containerLayer.addChildAt(lookingFor,0);
roadPlayerRandom.getChildAt(4).play();
// console.log(objSon);
LTweenLite.to(objSon,1,{scaleX:1.2,scaleY:1.2,ease:LEasing.Sine.easeInOut,loop:true})
.to(objSon,1,{scaleX:1,scaleY:1,ease:LEasing.Sine.easeInOut});
containerLayer.removeChild(positionPlayer);
// 扫描结束,开始进入选择入侵车辆
upCodes(-900,5,true,function(inter){
blacke_in.addEventListener(LMouseEvent.MOUSE_DOWN,function(inter){
audio2.play();
blacke_inFunc();
clearInterval(inter);
upCodes(-1097,6,false);
setTimeout(function(){
upCodes(-1197,7,false);
},3000);
setTimeout(function(){
upCodes(-1317,8,false);
},6000);
setTimeout(function(){
upCodes(-1417,9,false);
},9000)
});
// ////////////////////////待写////////////////////////////////
})
},1000)
})
},5000)
}
});
var coord=new qq.maps.LatLng(latlng.lat,latlng.lng);
geocoder.getAddress(coord);
// console.log(coord);
})
});
},showError);
}
function showError(error){
// clearInterval(inter);
// ///////////////////////////////////定位成功开始显示位置//////////////////////////////////////
// startP1_son.getChildAt(2 + 1).text = arr_text[2].new + "/";
// arr_text[3].new = "定位完毕 : <"+ result.detail.address + ">";
// arr_text[3].old = "";
// var leng = arr_text[3].new.length;
// var arr_w = "lkjiwejrlkngafdadfkng";
// for(var k = 0;k < leng;k ++){
// arr_text[3].old += arr_w.charAt(Math.floor(Math.random()*21));
// }
// upCodes(-460,4,false);
// 定位结束,延时10s进入下一场;
// setTimeout(function(){
// 扫描你定位3公里的特斯拉啊;
upCodes(-660,4,true,function(inter){
setTimeout(function(){
LTweenLite.to(black_in,2,{alpha:1,onComplete:function(){
black_in.play();
}});
clearInterval(inter);
startP1_son.getChildAt(4 + 1).text = arr_text[4].new + "/";
var objSon = roadPlayerRandom.getChildAt(1);
containerLayer.addChildAt(lookingFor,0);
roadPlayerRandom.getChildAt(4).play();
// console.log(objSon);
LTweenLite.to(objSon,1,{scaleX:1.2,scaleY:1.2,ease:LEasing.Sine.easeInOut,loop:true})
.to(objSon,1,{scaleX:1,scaleY:1,ease:LEasing.Sine.easeInOut});
containerLayer.removeChild(positionPlayer);
// 扫描结束,开始进入选择入侵车辆
upCodes(-900,5,true,function(inter){
blacke_in.addEventListener(LMouseEvent.MOUSE_DOWN,function(inter){
audio2.play();
blacke_inFunc();
clearInterval(inter);
upCodes(-1097,6,false);
setTimeout(function(){
upCodes(-1197,7,false);
},3000);
setTimeout(function(){
upCodes(-1317,8,false);
},6000);
setTimeout(function(){
upCodes(-1417,9,false);
},9000)
});
// ////////////////////////待写////////////////////////////////
})
},1000)
})
// },5000)
}
// 、、、、、、、、、、、、、、、、、男驾驶员、、、、、、、、、、、、、、、、、、、、、、;
function loadOk(){
audio3.play();
containerLayer.removeAllChild();
var length_num = 0;
var interact = new LSprite();
var bottom = new LSprite();
bottom.graphics.drawRect(0,‘#1c1c20‘,[0,0,gameWidth,233],true,‘#000‘);
bottom.y = 806;
var mask_pa = new LSprite();
var progress1= new LSprite();
var progressImg = new LBitmap(new LBitmapData(imglist[‘progress‘]));
progressImg.scaleX = 64/60;
var progress_mask = new LSprite();
progress_mask.graphics.drawVertices(0,"#fff",[[0,0],[0,10],[633,10],[640,5],[633,0]]);
progress_mask.x = -640;
progress1.mask = progress_mask;
var textProgress = new LTextField();
textProgress.size = 15;
textProgress.color = ‘#fff‘;
textProgress.font = ‘TinyPixy‘;
textProgress.text = "0%";
progress1.addChild(progressImg);
mask_pa.addChild(progress1);
mask_pa.addChild(progress_mask);
mask_pa.addChild(textProgress);
textProgress.x = 0;
textProgress.y = -5;
var leftBottom = new LSprite();
var rightBottom = new LSprite();
var intoManPlayer = createPlayer("intoMan",obj_arr_loadBreakPoint,17,273,221);
var intoLoopManPlayer = createPlayer("intoLoopMan",obj_arr_loadBreakPoint,22,273,221);
intoLoopManPlayer.stop();
// leftBottom.graphics.drawRect(1,"#000",[0,0,273,221],false,"rgba(0,0,0,0)");
leftBottom.addChild(intoLoopManPlayer);
leftBottom.addChild(intoManPlayer);
intoManPlayer.addEventListener(LEvent.COMPLETE,function(){
manDrive.play();
intoManPlayer.stop();
intoLoopManPlayer.play();
leftBottom.removeChild(intoManPlayer);
})
// //////////////////////////////////////loading转圈////////////////////////////////////////
var loading_single1 = new LSprite();
var loading_animate1 = createPlayer("re_loading",imglist,20,100,22);
loading_single1.graphics.drawRect(0,"#ffffff",[0,0,190,110],true,"rgba(0,0,0,0.8)");
loading_single1.addChild(loading_animate1);
loading_animate1.x = 40;
loading_animate1.y = 44;
var loading_single_text1 = new LTextField();
// loading_single1.addChild(loading_single_text1);
loading_single_text1.x = 30;
loading_single_text1.y = 30;
loading_single_text1.size = 30;
loading_single_text1.color = ‘#fff‘;
loading_single_text1.font = ‘TinyPixy‘;
loading_single_text1.text = ‘0%‘;
var loading_single2 = loading_single1.clone();
var loading_single3 = loading_single1.clone();
var loading_single4 = loading_single1.clone();
var loading_single_big = new LSprite();
var loading_animate = createPlayer("re_loading",imglist,20,100,22);
loading_single_big.graphics.drawRect(0,"#ffffff",[0,0,221,221],true,"rgba(0,0,0,0.8)");
loading_single_big.addChild(loading_animate);
loading_animate.x = 55;
loading_animate.y = 99;
var loading_single_text = new LTextField();
// loading_single_big.addChild(loading_single_text);
loading_single_text.size = 30;
loading_single_text.color = ‘#fff‘;
loading_single_text.font = ‘TinyPixy‘;
loading_single_text.text = ‘0%‘;
///、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、六个按钮、、、、、、、、、、、、、、、、、、、、、、、;
var zhuanxiangdeng = new LSprite();
var yugua = new LSprite();
var zuoyi = new LSprite();
var door = new LSprite();
var mirrorBack = new LSprite();
var shache = new LSprite();
var finish = new LSprite();
var clock1 = new LBitmap(new LBitmapData(imglist[‘clock_black‘]));
var clock2 = clock1.clone();
var clock3 = clock1.clone();
var clock4 = clock1.clone();
var clock5 = clock1.clone();
var clock6 = clock1.clone();
var zhuanCenter = createPlayer("zhuanCenter",obj_arr_loadBreakPoint,49,320,303);
zhuanCenter.scaleX = zhuanCenter.scaleY = 2;
var zhuanCenter2 = zhuanCenter.clone();
zhuanCenter2.scaleX = zhuanCenter2.scaleY = 2;
var zhuanCenter3 = zhuanCenter.clone();
zhuanCenter3.scaleX = zhuanCenter3.scaleY = 2;
var zhuanCenter4 = zhuanCenter.clone();
zhuanCenter4.scaleX = zhuanCenter4.scaleY = 2;
var zhuanCenter5 = zhuanCenter.clone();
zhuanCenter5.scaleX = zhuanCenter5.scaleY = 2;
var zhuanCenter6 = zhuanCenter.clone();
zhuanCenter6.scaleX = zhuanCenter6.scaleY = 2;
rightBottom.addChild(finish);
finish.x = 382;
finish.y = 0;
var finishi_clock = new LBitmap(new LBitmapData(imglist[‘finishi_clock‘]));
finish.addChild(finishi_clock);
bottom.addChild(mask_pa);
bottom.addChild(rightBottom);
bottom.addChild(leftBottom);
leftBottom.y = 12;
rightBottom.x = 274;
rightBottom.y = 12;
rightBottom.addChild(zuoyi);
zuoyi.x = 0;
zuoyi.y = 111;
zuoyi.addChild(clock3);
rightBottom.addChild(door);
door.x = 191;
door.y = 0;
door.addChild(clock4);
rightBottom.addChild(shache);
shache.x = 191;
shache.y = 111;
shache.addChild(clock6);
containerLayer.removeChild(lookingFor);
containerLayer.addChild(interact);
containerLayer.addChild(bottom);
var create_carMan = createPlayer("selectToControl_man",obj_arr_loadBreakPoint,18,320,520);
var driverMan = createPlayer("driverMan",obj_arr_loadBreakPoint,33,320,303);
driverMan.scaleX = driverMan.scaleY = 2;
create_carMan.scaleX=create_carMan.scaleY=2;
create_carMan.speed=speedMain;
driverMan.speed = speedMain;
// create_carMan.play();
driverMan.stop();
interact.addChild(create_carMan);
create_carMan.addEventListener(LEvent.COMPLETE,create_carMan_fun);
function create_carMan_fun(){
create_carMan.removeEventListener(LEvent.COMPLETE,create_carMan_fun);
interact.addChild(driverMan);
driverMan.y = 200;
driverMan.play();
}
//////////////////////////////////////////////转向灯、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、
rightBottom.addChild(zhuanxiangdeng);
var zhuanxiangMan = createPlayer("zhuanxiangMan",obj_arr_loadBreakPoint,48,320,303);
zhuanxiangMan.scaleX = zhuanxiangMan.scaleY = 2;
zhuanxiangMan.stop();
var Xzhuanxiangdeng = createPlayer("Xzhuanxiangdeng",obj_arr_loadBreakPoint,41,273,221);
Xzhuanxiangdeng.stop();
var XzhuanxiangLoop = createPlayer("zhuanxiangdengLoop",obj_arr_loadBreakPoint,33,273,221);
XzhuanxiangLoop.stop();
var toZhuanxiang = createPlayerNew("zhuanxiang",obj_arr_loadBreakPoint,30,190,110,9);
toZhuanxiang.stop();
toZhuanxiang.speed = speedMain;
toZhuanxiang.addEventListener(LEvent.COMPLETE,function(){
toZhuanxiang.stop();
zhuanxiangdeng.addEventListener(LMouseEvent.MOUSE_DOWN,zhuanxiangdeng_func);
})
var zhuanxiangLoop = createPlayerNew("zhuanxiang",obj_arr_loadBreakPoint,9,190,110,43);
// zhuanxiangLoop.stop();
zhuanxiangLoop.speed = speedMain;
zhuanxiangdeng.addChild(zhuanxiangLoop);
zhuanxiangdeng.addChild(toZhuanxiang);
zhuanxiangdeng.addChild(clock1);
clock1.visible = false;
toZhuanxiang.play();
function zhuanxiangdeng_func(){
upCodes(-1637,10,false);
setTimeout(function(){
upCodes(-1737,11,false);
},3000)
setTimeout(function(){
upCodes(-1857,12,false)
},5000)
zhuanxiangdeng.removeEventListener(LMouseEvent.MOUSE_DOWN,zhuanxiangdeng_func);
audio2.play();
length_pro();
zhuanxiangdeng.removeChild(toZhuanxiang);
zhuanxiangdeng.removeChild(clock1);
zhuanxiangLoop.play();
interact.addChild(zhuanCenter);
zhuanCenter.play();
zhuanCenter.speed = speedMain;
zhuanCenter.y = 200;
// driverMan.stop();
// interact.removeChild(driverMan);
zhuanCenter.addEventListener(LEvent.COMPLETE,function(){
manZhuanxiang.play();
zhuanCenter.stop();
interact.removeChild(zhuanCenter);
interact.addChild(zhuanxiangMan);
zhuanxiangMan.play();
zhuanxiangMan.y = 200;
zhuanxiangMan.speed = speedMain;
});
zhuanxiangMan.addEventListener(LEvent.COMPLETE,function(){
zhuanxiangMan.stop();
interact.removeChild(zhuanxiangMan);
})
leftBottom.addChild(Xzhuanxiangdeng);
// leftBottom.removeChild(intoLoopManPlayer);
Xzhuanxiangdeng.play();
Xzhuanxiangdeng.speed = speedMain;
Xzhuanxiangdeng.addEventListener(LEvent.COMPLETE,function(){
Xzhuanxiangdeng.stop();
zhuanxiangLoop.stop();
leftBottom.addChild(XzhuanxiangLoop);
XzhuanxiangLoop.play();
XzhuanxiangLoop.speed = speedMain;
var zhuangxiang_black = new LBitmap(new LBitmapData(imglist[‘zhuanxiang_blake‘]));
zhuanxiangdeng.addChild(zhuangxiang_black);
zhuanxiangdeng.removeChild(zhuanxiangLoop);
})
XzhuanxiangLoop.addEventListener(LEvent.COMPLETE,function(){
XzhuanxiangLoop.stop();
leftBottom.removeChild(XzhuanxiangLoop);
leftBottom.removeChild(Xzhuanxiangdeng);
})
// console.log(zhuanxiangLoop);
// zuoyi.addChild(loading_single2);
LLoadManage.load(
arr_zuoyiMan,
function(p){
// loading_single2.getChildAt(1).text = Math.floor(p)+‘%‘;
console.log(p);
},
function(result){
// return false;
obj_arrZuoyi = result;
clock3.visible = false;
zuoyi_funcMain();
}
)
}
//、、、、、、、、、、、、、、、、、、、、、、、、、、、座椅、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、
function zuoyi_funcMain(){
var toZuoyi = createPlayerNew("zuoyi",obj_arrZuoyi,30,190,110,9);
toZuoyi.stop();
toZuoyi.speed = speedMain;
toZuoyi.addEventListener(LEvent.COMPLETE,function(){
toZuoyi.stop();
zuoyi.addEventListener(LMouseEvent.MOUSE_DOWN,zuoyi_func);
})
toZuoyi.play();
var zuoyi_clock = new LBitmap(new LBitmapData(imglist[‘zuoyi_clock‘]));
var Xzuoyi = createPlayer("Xzuoyi",obj_arrZuoyi,40,273,221);
Xzuoyi.stop();
var XzuoyiLoop = createPlayer("XzuoyiLoop",obj_arrZuoyi,38,273,221);
XzuoyiLoop.stop();
var zuoyiMan = createPlayer("zuoyiMan",obj_arrZuoyi,71,320,303);
zuoyiMan.scaleX = zuoyiMan.scaleY = 2;
zuoyiMan.stop();
var zuoyiLoop = createPlayerNew("zuoyi",obj_arrZuoyi,9,190,110,43);
zuoyiLoop.stop();
zuoyiLoop.speed = speedMain;
zuoyi.addChild(zuoyiLoop);
zuoyi.addChild(toZuoyi);
function zuoyi_func(){
// LTweenLite.to(rightBottom,.5,{x:82,ease:LEasing.Sine.easeOut});
zuoyi.removeEventListener(LMouseEvent.MOUSE_DOWN,zuoyi_func);
LTweenLite.to(rightBottom,.5,{x:52,ease:LEasing.Sine.easeOut});
audio2.play();
upCodes(-2397,16,false);
setTimeout(function(){
upCodes(-2497,17,false);
},2000)
setTimeout(function(){
upCodes(-2597,18,false)
},4000)
length_pro();
zuoyi.removeChild(toZuoyi);
zuoyi.removeChild(clock3);
zuoyiLoop.play();
interact.addChild(zhuanCenter3);
zhuanCenter3.play();
zhuanCenter3.speed = speedMain;
zhuanCenter3.y = 200;
// yushuaMan.stop();
// interact.removeChild(yushuaMan);
zhuanCenter3.addEventListener(LEvent.COMPLETE,function(){
manZuoyi.play();
zhuanCenter3.stop();
interact.removeChild(zhuanCenter3);
interact.addChild(zuoyiMan);
zuoyiMan.play();
zuoyiMan.y = 200;
zuoyiMan.speed = speedMain;
});
leftBottom.addChild(Xzuoyi);
// leftBottom.removeChild(intoLoopManPlayer);
Xzuoyi.play();
Xzuoyi.speed = speedMain;
Xzuoyi.addEventListener(LEvent.COMPLETE,function(){
Xzuoyi.stop();
zuoyiLoop.stop();
leftBottom.addChild(XzuoyiLoop);
XzuoyiLoop.play();
XzuoyiLoop.speed = speedMain;
zuoyi.addChild(zuoyi_clock);
// zuoyi.removeChild(zuoyiLoop);
})
// console.log(zuoyiLoop);
XzuoyiLoop.addEventListener(LEvent.COMPLETE,function(){
XzuoyiLoop.stop();
leftBottom.removeChild(XzuoyiLoop);
})
zuoyiMan.addEventListener(LEvent.COMPLETE,function(){
zuoyiMan.stop();
interact.removeChild(zuoyiMan);
})
// door.addChild(loading_single3);
LLoadManage.load(
arr_doorMan,
function(p){
// loading_single3.getChildAt(1).text = Math.floor(p)+‘%‘;
console.log(p);
},
function(result){
// return false;
obj_arrDoor = result;
clock4.visible = false;
door_funcMain();
}
)
}
}
//、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、车门、、、、、、、、、、、、、、、、、、、、、、、、、、、
function door_funcMain(){
var toDoor = createPlayerNew("door",obj_arrDoor,30,190,110,9);
toDoor.speed = speedMain;
toDoor.addEventListener(LEvent.COMPLETE,function(){
toDoor.stop();
door.addEventListener(LMouseEvent.MOUSE_DOWN,door_func);
})
toDoor.play();
var door_clock = new LBitmap(new LBitmapData(imglist[‘door_clock‘]));
var Xdoor = createPlayer("Xdoor",obj_arrDoor,40,273,221);
Xdoor.stop();
var XdoorLoop = createPlayer("XdoorLoop",obj_arrDoor,38,273,221);
XdoorLoop.stop();
var doorMan = createPlayer("doorMan",obj_arrDoor,71,320,303);
doorMan.scaleX = doorMan.scaleY = 2;
doorMan.stop();
var doorLoop = createPlayerNew("door",obj_arrDoor,9,190,110,43);
doorLoop.stop();
doorLoop.speed = speedMain;
door.addChild(doorLoop);
door.addChild(toDoor);
function door_func(){
door.removeEventListener(LMouseEvent.MOUSE_DOWN,door_func);
length_pro();
audio2.play();
upCodes(-2777,19,false);
setTimeout(function(){
upCodes(-2877,20,false);
},2000)
setTimeout(function(){
upCodes(-2997,21,false)
},4000)
door.removeChild(toDoor);
door.removeChild(clock4);
doorLoop.play();
interact.addChild(zhuanCenter4);
zhuanCenter4.play();
zhuanCenter4.speed = speedMain;
zhuanCenter4.y = 200;
// zuoyiMan.stop();
// interact.removeChild(zuoyiMan);
zhuanCenter4.addEventListener(LEvent.COMPLETE,function(){
manDoor.play();
zhuanCenter4.stop();
interact.removeChild(zhuanCenter4);
interact.addChild(doorMan);
doorMan.play();
doorMan.y = 200;
doorMan.speed = speedMain;
});
leftBottom.addChild(Xdoor);
// leftBottom.removeChild(intoLoopManPlayer);
Xdoor.play();
Xdoor.speed = speedMain;
Xdoor.addEventListener(LEvent.COMPLETE,function(){
Xdoor.stop();
doorLoop.stop();
leftBottom.addChild(XdoorLoop);
XdoorLoop.play();
XdoorLoop.speed = speedMain;
door.addChild(door_clock);
door.removeChild(doorLoop);
})
XdoorLoop.addEventListener(LEvent.COMPLETE,function(){
XdoorLoop.stop();
leftBottom.removeChild(XdoorLoop);
leftBottom.removeChild(Xdoor);
})
doorMan.addEventListener(LEvent.COMPLETE,function(){
doorMan.stop();
interact.removeChild(doorMan);
})
// console.log(doorLoop);
// shache.addChild(loading_single4);
LLoadManage.load(
arr_shacheMan,
function(p){
// loading_single4.getChildAt(1).text = Math.floor(p)+‘%‘;
console.log(p);
},
function(result){
// return false;
obj_arrShache = result;
clock6.visible = false;
shache_funcMain();
}
)
}
}
////////////////////////////////////////////////////////////刹车、、、、、、、、、、、、、、、、、、、、、、、、、、
function shache_funcMain(){
var toShache = createPlayerNew("shache",obj_arrShache,30,190,110,9);
toShache.speed = speedMain;
toShache.addEventListener(LEvent.COMPLETE,function(){
toShache.stop();
shache.addEventListener(LMouseEvent.MOUSE_DOWN,shache_func);
})
var shache_clock = new LBitmap(new LBitmapData(imglist[‘shache_clock‘]));
var Xshache = createPlayer("Xshache",obj_arrShache,40,273,221);
Xshache.stop();
var XshacheLoop = createPlayer("XshacheLoop",obj_arrShache,38,273,221);
XshacheLoop.stop();
var shacheMan = createPlayer("shacheMan",obj_arrShache,162,320,303);
shacheMan.scaleX = shacheMan.scaleY = 2;
shacheMan.stop();
var shacheLoop = createPlayerNew("shache",obj_arrShache,9,190,110,43);
shacheLoop.stop();
shacheLoop.speed = speedMain;
shache.addChild(shacheLoop);
shache.addChild(toShache);
function shache_func(){
shache.removeEventListener(LMouseEvent.MOUSE_DOWN,shache_func);
LTweenLite.to(rightBottom,.5,{x:gameWidth-rightBottom.getWidth(),ease:LEasing.Sine.easeOut});
length_pro();
audio2.play();
upCodes(-3597,25,false);
setTimeout(function(){
upCodes(-3717,26,false);
},2000)
setTimeout(function(){
upCodes(-3837,27,false)
},4000)
shache.removeChild(toShache);
shache.removeChild(clock6);
shacheLoop.play();
interact.addChild(zhuanCenter6);
zhuanCenter6.play();
zhuanCenter6.speed = speedMain;
zhuanCenter6.y = 200;
// doorMan.stop();
// interact.removeChild(doorMan);
zhuanCenter6.addEventListener(LEvent.COMPLETE,function(){
manShache.play();
zhuanCenter6.stop();
interact.removeChild(zhuanCenter6);
interact.addChild(shacheMan);
shacheMan.play();
shacheMan.y = 200;
shacheMan.speed = speedMain;
});
leftBottom.addChild(Xshache);
Xshache.play();
Xshache.speed = speedMain;
Xshache.addEventListener(LEvent.COMPLETE,function(){
Xshache.stop();
shacheLoop.stop();
leftBottom.addChild(XshacheLoop);
XshacheLoop.play();
XshacheLoop.speed = speedMain;
shache.addChild(shache_clock);
// shache.removeChild(shacheLoop);
})
XshacheLoop.addEventListener(LEvent.COMPLETE,function(){
XshacheLoop.stop();
leftBottom.removeChild(XshacheLoop);
})
shacheMan.addEventListener(LEvent.COMPLETE,function(){
shacheMan.stop();
upCodes(-4057,28,false);
// interact.removeChild(shacheMan);
// interact.addChild(stopLoop);
// stopLoop.play();
interact.removeChild(driverMan)
})
// console.log(shacheLoop);
// finish.addChild(loading_single_big);
LLoadManage.load(
arr_finish,
function(p){
// loading_single_big.getChildAt(1).text = Math.floor(p)+‘%‘;
console.log(p);
},
function(result){
// return false;
obj_arrFinish = result;
clock6.visible = false;
finish_funcMain();
}
)
}
}
////////////////////////////////////////////////////////////完成、、、、、、、、、、、、、、、、、、、、、、、、、、
function finish_funcMain(){
finishi_clock.visible = false;
var toFinish = createPlayerNew("finish",obj_arrFinish,44,221,221,11);
var finishLoop = createPlayer("finishLoop",obj_arrFinish,51,221,221);
finishLoop.stop();
finish.addChild(finishLoop);
finish.addChild(toFinish);
toFinish.addEventListener(LEvent.COMPLETE,function(){
finishLoop.play();
finish.removeChild(toFinish);
})
finish.addEventListener(LMouseEvent.MOUSE_DOWN,function(){
// LTweenLite.to(progress_mask,.5,{x:percentage/100 * 600 - 600,ease:LEasing.Sine.easeOut})
LTweenLite.to(startP1_son,.5,{y:-4197,ease:LEasing.Sine.easeOut})
setTimeout(function(){
upCodes(-4417,29,false);
// setTimeout(function(){
// upCodes(-4457,30,false);
// },3000)
},5000);
containerLayer.removeChild(bottom);
containerLayer.removeChild(interact);
audio4.play();
music_on.removeChild(music_on_white);
music_on.addChild(music_on_black);
music_off.removeChild(music_off_black);
music_off.addChild(music_off_white);
background.pause();
music.alpha = 1;
var endFloor = new LSprite();
containerLayer.addChild(endFloor);
endFloor.addChild(toEnd);
toEnd.play();
var toFind = new LSprite();
toFind.graphics.drawRect(0,‘#1c1c20‘,[0,0,592,57],true,‘rgba(0,0,0,0)‘);
toFind.x = 26;
toFind.y = 852;
// toEnd.addEventListener(LEvent.COMPLETE,toEnd_fun);
// function toEnd_fun(){
// toEnd.removeEventListener(LEvent.COMPLETE,toEnd_fun);
// var end_bg = new LBitmap(new LBitmapData(imglist[‘end_bg‘]));
// endFloor.addChild(end_bg);
// end_bg.scaleX = end_bg.scaleY = 2;
// end_bg.y = 99*2;
// }
var bottom_words = new LBitmap(new LBitmapData(imglist[‘bottom_words‘]));
endFloor.addChild(bottom_words);
bottom_words.scaleX = bottom_words.scaleY = 2;
bottom_words.y = 824;
var toResolve = new LSprite();
toResolve.graphics.drawRect(0,‘#1c1c20‘,[0,0,297,103],true,‘rgba(0,0,0,0)‘);
toResolve.x = 11;
toResolve.y = 873;
var toShare = new LSprite();
toShare.graphics.drawRect(0,‘#1c1c20‘,[0,0,297,103],true,‘rgba(0,0,0,0)‘);
toShare.x = 332;
toShare.y = 873;
endFloor.addChild(toFind);
endFloor.addChild(toResolve);
endFloor.addChild(toShare);
// toFind.addEventListener(LMouseEvent.MOUSE_DOWN,function(){
// // console.log("点击查看");
// location.href = "http://view.inews.qq.com/a/AUT2017070702976000";
// })
setTimeout(function(){
toResolve.addEventListener(LMouseEvent.MOUSE_DOWN,function(){
// console.log("查明真相");
// audio1.pause();
music_on.removeChild(music_on_white);
music_on.addChild(music_on_black);
music_off.removeChild(music_off_black);
music_off.addChild(music_off_white);
background.pause();
music.alpha = 1;
$(‘.video1‘).show();
$(video1).css({width:‘100%‘,opacity: 1,display: ‘block‘});
video1.play();
audio4.pause();
toEnd.stop();
var tencent = new LBitmap(new LBitmapData(imglist[‘tencent‘]));
tencent.scaleX = 640 / 320;
tencent.scaleY = 1040/575;
endFloor.addChild(tencent);
$(".tenc").css({display:"block"}).click(function(){
$(‘.video1‘).hide();
$(video1).css({width:‘0%‘,opacity: 0,display: ‘none‘});
video1.pause();
audio4.play();
toEnd.play();
$(".tenc").css({display:"none"});
endFloor.removeChild(tencent);
})
});
toShare.addEventListener(LMouseEvent.MOUSE_DOWN,function(){
// console.log("fenxiang");
// var endLoop = createPlayer("endLoop",imglist,19,320,520);
// endLoop.speed = speedMain;
// endLoop.scaleX = endLoop.scaleY = 2;
// endFloor.addChild(endLoop);
// endLoop.addEventListener(LEvent.COMPLETE,function(){
// endLoop.stop();
// endFloor.removeChild(endLoop);
// })
location.href = "http://view.inews.qq.com/a/AUT2017070702976000";
})
},2000)
})
////////////////////////////////////////////////////////////结尾分享页面、、、、、、、、、、、、、、、、
var toEnd = createPlayer("ghost",imglist,220,320,520);
toEnd.scaleX = toEnd.scaleY = 2;
toEnd.stop();
toEnd.speed = 6;
toEnd.addEventListener(LEvent.COMPLETE,function(){
toEnd.stop();
})
}
publicLayer.y = gameHeight-1040;
var music = new LBitmap(new LBitmapData(imglist[‘music‘]));
publicLayer.addChild(music);
music.scaleX = music.scaleY = 2;
music.y = 49*2;
music.alpha = 0;
var music_on = new LSprite();
var music_off = new LSprite();
publicLayer.addChild(music_on);
publicLayer.addChild(music_off);
var music_on_black = new LBitmap(new LBitmapData(imglist[‘music_on_black‘]));
var music_on_white = new LBitmap(new LBitmapData(imglist[‘music_on_white‘]));
var music_off_black = new LBitmap(new LBitmapData(imglist[‘music_off_black‘]));
var music_off_white = new LBitmap(new LBitmapData(imglist[‘music_off_white‘]));
music_on.addChild(music_on_white);
music_on.x = 598;
music_on.y = 109;
music_off.addChild(music_off_black);
music_off.x = 598;
music_off.y = 168;
music_off.addEventListener(LMouseEvent.MOUSE_DOWN,function(){
music_on.removeChild(music_on_white);
music_on.addChild(music_on_black);
music_off.removeChild(music_off_black);
music_off.addChild(music_off_white);
background.pause();
music.alpha = 1;
})
music_on.addEventListener(LMouseEvent.MOUSE_DOWN,function(){
music_off.addChild(music_off_black);
music_off.removeChild(music_off_white);
music_on.addChild(music_on_white);
music_on.removeChild(music_on_black);
background.play();
music.alpha = 0;
})
function length_pro(){
length_num ++;
var num = 0;
textProgress.x = 0;
textProgress.text = num+‘%‘;
progress_mask.x = -640;
// var percentage = Math.round(length_num / 6 * 100);
// var str = percentage + "%";
// textProgress.text = str;
// textProgress.x = percentage/100 * 600;
// LTweenLite.to(textProgress,.5,{x:percentage/100 * 600,ease:LEasing.Sine.easeOut});
// LTweenLite.to(progress_mask,.5,{x:percentage/100 * 600 - 600,ease:LEasing.Sine.easeOut});
var timer = setInterval(function(){
num++;
textProgress.text = num+‘%‘;
if(num==100)
clearInterval(timer);
},50);
LTweenLite.to(textProgress,6,{x:640,ease:LEasing.Sine.easeOut});
LTweenLite.to(progress_mask,6,{x:0,ease:LEasing.Sine.easeOut});
// progress_mask.x = percentage / 100 * 600 - 600;
// console.log(mask_pa.x,textProgress.x,textProgress.text);
}
}
//。。。。。。。。。。。。。。。。。。。。。。。。。。。女驾驶员、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、
function loadOk2(){
audio3.play();
containerLayer.removeAllChild();
var length_num = 0;
var interact = new LSprite();
var bottom = new LSprite();
bottom.graphics.drawRect(0,‘#1c1c20‘,[0,0,gameWidth,233],true,‘#000‘);
bottom.y = 806;
var mask_pa = new LSprite();
var progress1= new LSprite();
var progressImg = new LBitmap(new LBitmapData(imglist[‘progress‘]));
progressImg.scaleX = 64/60;
var progress_mask = new LSprite();
progress_mask.graphics.drawVertices(0,"#fff",[[0,0],[0,10],[633,10],[640,5],[633,0]]);
progress_mask.x = -640;
progress1.mask = progress_mask;
var textProgress = new LTextField();
textProgress.size = 15;
textProgress.color = ‘#fff‘;
textProgress.font = ‘TinyPixy‘;
textProgress.text = "0%";
textProgress.x = 0;
textProgress.y = -5;
progress1.addChild(progressImg);
mask_pa.addChild(progress1);
mask_pa.addChild(progress_mask);
mask_pa.addChild(textProgress);
textProgress.x = 0;
// //////////////////////////////////////loading转圈////////////////////////////////////////
var loading_single1 = new LSprite();
var loading_animate1 = createPlayer("re_loading",imglist,20,100,22);
loading_single1.graphics.drawRect(0,"#ffffff",[0,0,190,110],true,"rgba(0,0,0,0.8)");
loading_single1.addChild(loading_animate1);
var loading_single_text1 = new LTextField();
// loading_single1.addChild(loading_single_text1);
loading_animate1.x = 40;
loading_animate1.y = 44;
loading_single_text1.x = 80;
loading_single_text1.y = 70;
loading_single_text1.size = 30;
loading_single_text1.color = ‘#fff‘;
loading_single_text1.font = ‘TinyPixy‘;
loading_single_text1.text = ‘0%‘;
var loading_single2 = loading_single1.clone();
var loading_single3 = loading_single1.clone();
var loading_single4 = loading_single1.clone();
var loading_single_big = new LSprite();
var loading_animate = createPlayer("re_loading",imglist,20,100,22);
loading_animate.y = 30;
loading_single_big.graphics.drawRect(0,"#ffffff",[0,0,221,221],true,"rgba(0,0,0,0.8)");
loading_single_big.addChild(loading_animate);
loading_animate.x = 55;
loading_animate.y = 99;
var loading_single_text = new LTextField();
// loading_single_big.addChild(loading_single_text);
loading_single_text.size = 30;
loading_single_text.color = ‘#fff‘;
loading_single_text.font = ‘TinyPixy‘;
loading_single_text.text = ‘0%‘;
var leftBottom = new LSprite();
var rightBottom = new LSprite();
var intoManPlayer = createPlayer("intoMan",obj_arr_loadBreakPoint,53,273,221);
var intoLoopManPlayer = createPlayer("intoLoopMan",obj_arr_loadBreakPoint,51,273,221);
intoLoopManPlayer.stop();
// leftBottom.graphics.drawRect(1,"#000",[0,0,273,221],false,"rgba(0,0,0,0)");
leftBottom.addChild(intoLoopManPlayer);
leftBottom.addChild(intoManPlayer);
intoManPlayer.addEventListener(LEvent.COMPLETE,function(){
intoManPlayer.stop();
intoLoopManPlayer.play();
leftBottom.removeChild(intoManPlayer);
})
bottom.addChild(mask_pa);
bottom.addChild(rightBottom);
bottom.addChild(leftBottom);
leftBottom.y = 12;
rightBottom.x = 274;
rightBottom.y = 12;
containerLayer.removeChild(lookingFor);
containerLayer.addChild(interact);
containerLayer.addChild(bottom);
var create_carMan = createPlayer("selectToControl_man",obj_arr_loadBreakPoint,18,320,520);
var driverMan = createPlayer("driverMan",obj_arr_loadBreakPoint,33,320,520);
driverMan.scaleX = driverMan.scaleY = 2;
// create_carMan.play();
driverMan.stop();
interact.addChild(create_carMan);
create_carMan.addEventListener(LEvent.COMPLETE,create_carMan_fun);
function create_carMan_fun(){
create_carMan.removeEventListener(LEvent.COMPLETE,create_carMan_fun);
interact.addChild(driverMan);
driverMan.y = 0;
driverMan.play();
}
create_carMan.scaleX=create_carMan.scaleY=2;
create_carMan.speed=speedMain;
driverMan.speed = speedMain;
///、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、六个按钮、、、、、、、、、、、、、、、、、、、、、、、;
var zhuanxiangdeng = new LSprite();
var yugua = new LSprite();
var zuoyi = new LSprite();
var door = new LSprite();
var mirrorBack = new LSprite();
var shache = new LSprite();
var finish = new LSprite();
var clock1 = new LBitmap(new LBitmapData(imglist[‘clock_black‘]));
var clock2 = clock1.clone();
var clock3 = clock1.clone();
var clock4 = clock1.clone();
var clock5 = clock1.clone();
var clock6 = clock1.clone();
var zhuanCenter = createPlayer("zhuanCenter",obj_arr_loadBreakPoint,49,320,303);
zhuanCenter.scaleX = zhuanCenter.scaleY = 2;
var zhuanCenter2 = zhuanCenter.clone();
zhuanCenter2.scaleX = zhuanCenter2.scaleY = 2;
var zhuanCenter3 = zhuanCenter.clone();
zhuanCenter3.scaleX = zhuanCenter3.scaleY = 2;
var zhuanCenter4 = zhuanCenter.clone();
zhuanCenter4.scaleX = zhuanCenter4.scaleY = 2;
var zhuanCenter5 = zhuanCenter.clone();
zhuanCenter5.scaleX = zhuanCenter5.scaleY = 2;
var zhuanCenter6 = zhuanCenter.clone();
zhuanCenter6.scaleX = zhuanCenter6.scaleY = 2;
rightBottom.addChild(zhuanxiangdeng);
rightBottom.addChild(zuoyi);
zuoyi.addChild(clock3);
zuoyi.x = 0;
zuoyi.y = 111;
rightBottom.addChild(door);
door.x = 191;
door.y = 0;
door.addChild(clock4);
rightBottom.addChild(shache);
shache.x = 191;
shache.y = 111;
shache.addChild(clock6);
rightBottom.addChild(finish);
finish.x = 382;
finish.y = 0;
var finishi_clock = new LBitmap(new LBitmapData(imglist[‘finishi_clock‘]));
finish.addChild(finishi_clock);
//////////////////////////////////////////////转向灯、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、
var zhuanxiangMan = createPlayer("zhuanxiangMan",obj_arr_loadBreakPoint,48,320,303);
zhuanxiangMan.scaleX = zhuanxiangMan.scaleY = 2;
zhuanxiangMan.stop();
var Xzhuanxiangdeng = createPlayer("Xzhuanxiangdeng",obj_arr_loadBreakPoint,41,273,221);
Xzhuanxiangdeng.stop();
var XzhuanxiangLoop = createPlayer("zhuanxiangdengLoop",obj_arr_loadBreakPoint,33,273,221);
XzhuanxiangLoop.stop();
var toZhuanxiang = createPlayerNew("zhuanxiang",obj_arr_loadBreakPoint,30,190,110,9);
toZhuanxiang.stop();
toZhuanxiang.speed = speedMain;
toZhuanxiang.addEventListener(LEvent.COMPLETE,function(){
toZhuanxiang.stop();
zhuanxiangdeng.addEventListener(LMouseEvent.MOUSE_DOWN,zhuanxiangdeng_func);
})
var zhuanxiangLoop = createPlayerNew("zhuanxiang",obj_arr_loadBreakPoint,9,190,110,43);
// zhuanxiangLoop.stop();
zhuanxiangLoop.speed = speedMain;
zhuanxiangdeng.addChild(zhuanxiangLoop);
zhuanxiangdeng.addChild(toZhuanxiang);
zhuanxiangdeng.addChild(clock1);
clock1.visible = false;
toZhuanxiang.play();
function zhuanxiangdeng_func(){
upCodes(-1637,10,false);
setTimeout(function(){
upCodes(-1737,11,false);
},3000)
setTimeout(function(){
upCodes(-1857,12,false)
},5000)
zhuanxiangdeng.removeEventListener(LMouseEvent.MOUSE_DOWN,zhuanxiangdeng_func);
audio2.play();
length_pro();
zhuanxiangdeng.removeChild(toZhuanxiang);
zhuanxiangdeng.removeChild(clock1);
zhuanxiangLoop.play();
interact.addChild(zhuanCenter);
zhuanCenter.play();
zhuanCenter.speed = speedMain;
zhuanCenter.y = 200;
// driverMan.stop();
// interact.removeChild(driverMan);
zhuanCenter.addEventListener(LEvent.COMPLETE,function(){
zhuanCenter.stop();
interact.removeChild(zhuanCenter);
interact.addChild(zhuanxiangMan);
zhuanxiangMan.play();
zhuanxiangMan.y = 200;
zhuanxiangMan.speed = speedMain;
});
leftBottom.addChild(Xzhuanxiangdeng);
// leftBottom.removeChild(intoLoopManPlayer);
Xzhuanxiangdeng.play();
Xzhuanxiangdeng.speed = speedMain;
Xzhuanxiangdeng.addEventListener(LEvent.COMPLETE,function(){
Xzhuanxiangdeng.stop();
zhuanxiangLoop.stop();
leftBottom.addChild(XzhuanxiangLoop);
XzhuanxiangLoop.play();
XzhuanxiangLoop.speed = speedMain;
var zhuangxiang_black = new LBitmap(new LBitmapData(imglist[‘zhuanxiang_blake‘]));
zhuanxiangdeng.addChild(zhuangxiang_black);
zhuanxiangdeng.removeChild(zhuanxiangLoop);
})
XzhuanxiangLoop.addEventListener(LEvent.COMPLETE,function(){
XzhuanxiangLoop.stop();
leftBottom.removeChild(XzhuanxiangLoop);
leftBottom.removeChild(Xzhuanxiangdeng);
})
zhuanxiangMan.addEventListener(LEvent.COMPLETE,function(){
zhuanxiangMan.stop();
interact.removeChild(zhuanxiangMan);
})
// console.log(zhuanxiangLoop);
// zuoyi.addChild(loading_single2);
LLoadManage.load(
arr_zuoyiWoman,
function(p){
// loading_single2.getChildAt(1).text = Math.floor(p)+‘%‘;
console.log(p);
},
function(result){
// return false;
obj_arrZuoyi = result;
clock3.visible = false;
zuoyi_funcMain();
}
)
}
//、、、、、、、、、、、、、、、、、、、、、、、、、、、座椅、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、
function zuoyi_funcMain(){
var zuoyi_clock = new LBitmap(new LBitmapData(imglist[‘zuoyi_clock‘]));
var Xzuoyi = createPlayer("Xzuoyi",obj_arrZuoyi,40,273,221);
Xzuoyi.stop();
var XzuoyiLoop = createPlayer("XzuoyiLoop",obj_arrZuoyi,38,273,221);
XzuoyiLoop.stop();
var zuoyiMan = createPlayer("zuoyiMan",obj_arrZuoyi,109,320,303);
zuoyiMan.scaleX = zuoyiMan.scaleY = 2;
zuoyiMan.stop();
var toZuoyi = createPlayerNew("zuoyi",obj_arrZuoyi,30,190,110,9);
toZuoyi.speed = speedMain;
toZuoyi.addEventListener(LEvent.COMPLETE,function(){
toZuoyi.stop();
zuoyi.addEventListener(LMouseEvent.MOUSE_DOWN,zuoyi_func);
})
var zuoyiLoop = createPlayerNew("zuoyi",obj_arrZuoyi,9,190,110,43);
zuoyiLoop.stop();
zuoyiLoop.speed = speedMain;
zuoyi.addChild(zuoyiLoop);
zuoyi.addChild(toZuoyi);
function zuoyi_func(){
// LTweenLite.to(rightBottom,.5,{x:82,ease:LEasing.Sine.easeOut});
zuoyi.removeEventListener(LMouseEvent.MOUSE_DOWN,zuoyi_func);
LTweenLite.to(rightBottom,.5,{x:gameWidth-rightBottom.getWidth()+222,ease:LEasing.Sine.easeOut});
audio2.play();
upCodes(-2397,16,false);
setTimeout(function(){
upCodes(-2497,17,false);
},2000)
setTimeout(function(){
upCodes(-2597,18,false)
},4000)
length_pro();
zuoyi.removeChild(toZuoyi);
zuoyi.removeChild(clock3);
zuoyiLoop.play();
interact.addChild(zhuanCenter3);
zhuanCenter3.play();
zhuanCenter3.speed = speedMain;
zhuanCenter3.y = 200;
// yushuaMan.stop();
// interact.removeChild(yushuaMan);
zhuanCenter3.addEventListener(LEvent.COMPLETE,function(){
zhuanCenter3.stop();
interact.removeChild(zhuanCenter3);
interact.addChild(zuoyiMan);
zuoyiMan.play();
zuoyiMan.y = 200;
zuoyiMan.speed = speedMain;
});
leftBottom.addChild(Xzuoyi);
// leftBottom.removeChild(intoLoopManPlayer);
Xzuoyi.play();
Xzuoyi.speed = speedMain;
Xzuoyi.addEventListener(LEvent.COMPLETE,function(){
Xzuoyi.stop();
zuoyiLoop.stop();
leftBottom.addChild(XzuoyiLoop);
XzuoyiLoop.play();
XzuoyiLoop.speed = speedMain;
zuoyi.addChild(zuoyi_clock);
// zuoyi.removeChild(zuoyiLoop);
})
XzuoyiLoop.addEventListener(LEvent.COMPLETE,function(){
XzuoyiLoop.stop();
leftBottom.removeChild(XzuoyiLoop);
leftBottom.removeChild(Xzuoyi);
})
zuoyiMan.addEventListener(LEvent.COMPLETE,function(){
zuoyiMan.stop();
interact.removeChild(zuoyiMan);
})
// console.log(zuoyiLoop);
// door.addChild(loading_single3);
LLoadManage.load(
arr_doorWoman,
function(p){
// loading_single3.getChildAt(1).text = Math.floor(p)+‘%‘;
console.log(p);
},
function(result){
// return false;
obj_arrDoor = result;
clock4.visible = false;
door_funcMain();
}
)
}
}
//、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、车门、、、、、、、、、、、、、、、、、、、、、、、、、、、
function door_funcMain(){
var toDoor = createPlayerNew("door",obj_arrDoor,30,190,110,9);
toDoor.speed = speedMain;
toDoor.addEventListener(LEvent.COMPLETE,function(){
toDoor.stop();
door.addEventListener(LMouseEvent.MOUSE_DOWN,door_func);
})
var door_clock = new LBitmap(new LBitmapData(imglist[‘door_clock‘]));
var Xdoor = createPlayer("Xdoor",obj_arrDoor,40,273,221);
Xdoor.stop();
var XdoorLoop = createPlayer("XdoorLoop",obj_arrDoor,38,273,221);
XdoorLoop.stop();
var doorMan = createPlayer("doorMan",obj_arrDoor,73,640,606);
doorMan.scaleX = doorMan.scaleY = 2;
doorMan.stop();
var doorLoop = createPlayerNew("door",obj_arrDoor,9,190,110,43);
doorLoop.stop();
doorLoop.speed = speedMain;
door.addChild(doorLoop);
door.addChild(toDoor);
function door_func(){
// LTweenLite.to(rightBottom,.5,{x:-139,ease:LEasing.Sine.easeOut});
door.removeEventListener(LMouseEvent.MOUSE_DOWN,door_func);
length_pro();
audio2.play();
upCodes(-2777,19,false);
setTimeout(function(){
upCodes(-2877,20,false);
},2000)
setTimeout(function(){
upCodes(-2997,21,false)
},4000)
door.removeChild(toDoor);
door.removeChild(clock4);
doorLoop.play();
interact.addChild(zhuanCenter4);
zhuanCenter4.play();
zhuanCenter4.speed = speedMain;
zhuanCenter4.y = 200;
// zuoyiMan.stop();
// interact.removeChild(zuoyiMan);
zhuanCenter4.addEventListener(LEvent.COMPLETE,function(){
zhuanCenter4.stop();
interact.removeChild(zhuanCenter4);
interact.addChild(doorMan);
doorMan.play();
doorMan.y = 200;
doorMan.speed = speedMain;
});
leftBottom.addChild(Xdoor);
// leftBottom.removeChild(intoLoopManPlayer);
Xdoor.play();
Xdoor.speed = speedMain;
Xdoor.addEventListener(LEvent.COMPLETE,function(){
Xdoor.stop();
doorLoop.stop();
leftBottom.addChild(XdoorLoop);
XdoorLoop.play();
XdoorLoop.speed = speedMain;
door.addChild(door_clock);
door.removeChild(doorLoop);
})
XdoorLoop.addEventListener(LEvent.COMPLETE,function(){
XdoorLoop.stop();
leftBottom.removeChild(XdoorLoop);
leftBottom.removeChild(Xdoor);
})
doorMan.addEventListener(LEvent.COMPLETE,function(){
doorMan.stop();
interact.removeChild(doorMan);
})
// console.log(doorLoop);
// shache.addChild(loading_single4);
LLoadManage.load(
arr_shacheWoman,
function(p){
// loading_single4.getChildAt(1).text = Math.floor(p)+‘%‘;
console.log(p);
},
function(result){
// return false;
obj_arrShache = result;
clock6.visible = false;
shache_funcMain();
}
)
}
}
////////////////////////////////////////////////////////////刹车、、、、、、、、、、、、、、、、、、、、、、、、、、
function shache_funcMain(){
var toShache = createPlayerNew("shache",obj_arrShache,30,190,110,9);
toShache.speed = speedMain;
toShache.addEventListener(LEvent.COMPLETE,function(){
toShache.stop();
shache.addEventListener(LMouseEvent.MOUSE_DOWN,shache_func);
})
var shache_clock = new LBitmap(new LBitmapData(imglist[‘shache_clock‘]));
var Xshache = createPlayer("Xshache",obj_arrShache,40,273,221);
Xshache.stop();
var XshacheLoop = createPlayer("XshacheLoop",obj_arrShache,38,273,221);
XshacheLoop.stop();
var shacheMan = createPlayer("shacheMan",obj_arrShache,165,320,303);
shacheMan.scaleX = shacheMan.scaleY = 2;
shacheMan.stop();
var shacheLoop = createPlayerNew("shache",obj_arrShache,9,190,110,43);
shacheLoop.stop();
shacheLoop.speed = speedMain;
shache.addChild(shacheLoop);
shache.addChild(toShache);
function shache_func(){
shache.removeEventListener(LMouseEvent.MOUSE_DOWN,shache_func);
LTweenLite.to(rightBottom,.5,{x:gameWidth-rightBottom.getWidth(),ease:LEasing.Sine.easeOut});
length_pro();
audio2.play();
upCodes(-3597,25,false);
setTimeout(function(){
upCodes(-3717,26,false);
},2000)
setTimeout(function(){
upCodes(-3837,27,false)
},4000)
shache.removeChild(toShache);
shache.removeChild(clock6);
shacheLoop.play();
interact.addChild(zhuanCenter6);
zhuanCenter6.play();
zhuanCenter6.speed = speedMain;
zhuanCenter6.y = 200;
// doorMan.stop();
// interact.removeChild(doorMan);
zhuanCenter6.addEventListener(LEvent.COMPLETE,function(){
zhuanCenter6.stop();
interact.removeChild(zhuanCenter6);
interact.addChild(shacheMan);
shacheMan.play();
shacheMan.y = 200;
shacheMan.speed = speedMain;
});
leftBottom.addChild(Xshache);
Xshache.play();
Xshache.speed = speedMain;
Xshache.addEventListener(LEvent.COMPLETE,function(){
Xshache.stop();
shacheLoop.stop();
leftBottom.addChild(XshacheLoop);
XshacheLoop.play();
XshacheLoop.speed = speedMain;
shache.addChild(shache_clock);
shache.removeChild(shacheLoop);
})
XshacheLoop.addEventListener(LEvent.COMPLETE,function(){
XshacheLoop.stop();
leftBottom.removeChild(XshacheLoop);
leftBottom.removeChild(Xshache);
})
shacheMan.addEventListener(LEvent.COMPLETE,function(){
shacheMan.stop();
// interact.removeChild(shacheMan);
upCodes(-4057,28,false);
})
// console.log(shacheLoop);
// finish.addChild(loading_single_big);
LLoadManage.load(
arr_finishW,
function(p){
// loading_single_big.getChildAt(1).text = Math.floor(p)+‘%‘;
console.log(p);
},
function(result){
// return false;
obj_arrfinish = result;
finish_funcMain();
}
)
}
}
////////////////////////////////////////////////////////////完成、、、、、、、、、、、、、、、、、、、、、、、、、、
function finish_funcMain(){
var toFinish = createPlayerNew("finish",obj_arrfinish,44,221,221,11);
var finishLoop = createPlayer("finishLoop",obj_arrfinish,51,221,221);
finishLoop.stop();
finish.addChild(finishLoop);
finish.addChild(toFinish);
toFinish.addEventListener(LEvent.COMPLETE,function(){
finishLoop.play();
finish.removeChild(toFinish);
})
finish.addEventListener(LMouseEvent.MOUSE_DOWN,function(){
// LTweenLite.to(progress_mask,.5,{x:percentage/100 * 600 - 600,ease:LEasing.Sine.easeOut})
LTweenLite.to(startP1_son,.5,{y:-4197,ease:LEasing.Sine.easeOut})
setTimeout(function(){
upCodes(-4417,29,false);
// setTimeout(function(){
// upCodes(-4457,30,false);
// },3000)
},5000);
music_on.removeChild(music_on_white);
music_on.addChild(music_on_black);
music_off.removeChild(music_off_black);
music_off.addChild(music_off_white);
background.pause();
music.alpha = 1;
containerLayer.removeChild(bottom);
containerLayer.removeChild(interact);
var endFloor = new LSprite();
containerLayer.addChild(endFloor);
endFloor.addChild(toEnd);
toEnd.play();
audio4.play();
toEnd.addEventListener(LEvent.COMPLETE,toEnd_fun);
function toEnd_fun(){
toEnd.removeEventListener(LEvent.COMPLETE,toEnd_fun);
// var end_bg = new LBitmap(new LBitmapData(imglist[‘end_bg‘]));
// endFloor.addChild(end_bg);
// end_bg.scaleX = end_bg.scaleY = 2;
// end_bg.y = 99*2;
toEnd.stop();
}
var bottom_words = new LBitmap(new LBitmapData(imglist[‘bottom_words‘]));
bottom_words.scaleX = bottom_words.scaleY = 2;
endFloor.addChild(bottom_words);
bottom_words.y = 824;
// var toFind = new LSprite();
// toFind.graphics.drawRect(0,‘#1c1c20‘,[0,0,592,57],true,‘rgba(0,0,0,0)‘);
// toFind.x = 26;
// toFind.y = 852;
var toResolve = new LSprite();
toResolve.graphics.drawRect(0,‘#1c1c20‘,[0,0,297,103],true,‘rgba(0,0,0,0)‘);
toResolve.x = 11;
toResolve.y = 873;
var toShare = new LSprite();
toShare.graphics.drawRect(0,‘#1c1c20‘,[0,0,297,103],true,‘rgba(0,0,0,0)‘);
toShare.x = 332;
toShare.y = 873;
// endFloor.addChild(toFind);
endFloor.addChild(toResolve);
endFloor.addChild(toShare);
// toFind.addEventListener(LMouseEvent.MOUSE_DOWN,function(){
// console.log("点击查看");
// location.href = "http://view.inews.qq.com/a/AUT2017070702976000";
// })
setTimeout(function(){
toResolve.addEventListener(LMouseEvent.MOUSE_DOWN,function(){
// console.log("查明真相");
// audio1.pause();
music_on.removeChild(music_on_white);
music_on.addChild(music_on_black);
music_off.removeChild(music_off_black);
music_off.addChild(music_off_white);
background.pause();
music.alpha = 1;
var tencent = new LBitmap(new LBitmapData(imglist[‘tencent‘]));
tencent.scaleX = 640 / 320;
tencent.scaleY = 1040/575;
endFloor.addChild(tencent);
$(‘.video1‘).show();
$(video1).css({width:‘100%‘,opacity: 1,display: ‘block‘});
video1.play();
audio4.pause();
toEnd.stop();
$(".tenc").css({display:"block"}).click(function(){
$(‘.video1‘).hide();
$(video1).css({width:‘0%‘,opacity: 0,display: ‘none‘});
video1.pause();
audio4.play();
toEnd.play();
$(".tenc").css({display:"none"});
endFloor.removeChild(tencent);
})
})
toShare.addEventListener(LMouseEvent.MOUSE_DOWN,function(){
// var endLoop = createPlayer("endLoop",imglist,19,320,520);
// endLoop.speed = speedMain;
// endLoop.scaleX = endLoop.scaleY = 2;
// endFloor.addChild(endLoop);
// endLoop.addEventListener(LEvent.COMPLETE,function(){
// endLoop.stop();
// endFloor.removeChild(endLoop);
// })
location.href = "http://view.inews.qq.com/a/AUT2017070702976000";
})
},2000)
})
////////////////////////////////////////////////////////////结尾分享页面、、、、、、、、、、、、、、、、
var toEnd = createPlayer("ghost",imglist,220,320,520);
toEnd.scaleX = toEnd.scaleY = 2;
toEnd.stop();
toEnd.speed = 6;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////
publicLayer.y = gameHeight-1040;
var music = new LBitmap(new LBitmapData(imglist[‘music‘]));
publicLayer.addChild(music);
music.scaleX = music.scaleY = 2;
music.y = 49*2;
music.alpha = 0;
var music_on = new LSprite();
var music_off = new LSprite();
publicLayer.addChild(music_on);
publicLayer.addChild(music_off);
var music_on_black = new LBitmap(new LBitmapData(imglist[‘music_on_black‘]));
var music_on_white = new LBitmap(new LBitmapData(imglist[‘music_on_white‘]));
var music_off_black = new LBitmap(new LBitmapData(imglist[‘music_off_black‘]));
var music_off_white = new LBitmap(new LBitmapData(imglist[‘music_off_white‘]));
music_on.addChild(music_on_white);
music_on.x = 598;
music_on.y = 109;
music_off.addChild(music_off_black);
music_off.x = 598;
music_off.y = 168;
music_off.addEventListener(LMouseEvent.MOUSE_DOWN,function(){
music_on.removeChild(music_on_white);
music_on.addChild(music_on_black);
music_off.removeChild(music_off_black);
music_off.addChild(music_off_white);
background.pause();
music.alpha = 1;
})
music_on.addEventListener(LMouseEvent.MOUSE_DOWN,function(){
music_off.addChild(music_off_black);
music_off.removeChild(music_off_white);
music_on.addChild(music_on_white);
music_on.removeChild(music_on_black);
background.play();
music.alpha = 0;
})
function length_pro(){
length_num ++;
var num = 0;
textProgress.x = 0;
textProgress.text = num+‘%‘;
progress_mask.x = -640;
// var percentage = Math.round(length_num / 6 * 100);
// var str = percentage + "%";
// textProgress.text = str;
// textProgress.x = percentage/100 * 600;
// LTweenLite.to(textProgress,.5,{x:percentage/100 * 600,ease:LEasing.Sine.easeOut});
// LTweenLite.to(progress_mask,.5,{x:percentage/100 * 600 - 600,ease:LEasing.Sine.easeOut});
var timer = setInterval(function(){
num++;
textProgress.text = num+‘%‘;
if(num==100)
clearInterval(timer);
},50);
LTweenLite.to(textProgress,6,{x:640,ease:LEasing.Sine.easeOut});
LTweenLite.to(progress_mask,6,{x:0,ease:LEasing.Sine.easeOut});
// progress_mask.x = percentage / 100 * 600 - 600;
// console.log(mask_pa.x,textProgress.x,textProgress.text);
}
}
}
function createPlayer(obj,imglist,count,w,h){
var datas = [];
var listChild = [];
for (var i = 0; i < count; i++) {
datas.push(new LBitmapData(imglist[obj+i]));
listChild.push({dataIndex : i, x : 0, y : 0, width : w, height : h, sx : 0, sy : 0});
}
return new LAnimationTimeline(datas, [listChild]);
}
function createPlayerNew(obj,imglist,count,w,h,start){
var datas = [];
var listChild = [];
for (var i = 0; i < count; i++) {
datas.push(new LBitmapData(imglist[obj+(i+start)]));
listChild.push({dataIndex : i, x : 0, y : 0, width : w, height : h, sx : 0, sy : 0});
}
return new LAnimationTimeline(datas, [listChild]);
}
function sortText(obj){
var obj2 = ‘‘;
var arr = obj.split(‘‘);
arr.mix();
for(var i=0;i<arr.length;i++){
obj2+=arr[i];
}
return obj2;
}
$(‘.video1‘).on(‘touchstart‘,function(){
video1.pause();
$(this).hide();
});
</font>
最后一句话:前端辛苦了。。。
本文作者: i春秋签约作家Sp4ce
抱歉,马斯克,你的特斯拉归我了