Commit cede12d6 authored by wjf's avatar wjf

l

parent c3265068
...@@ -173,6 +173,8 @@ export default class MainBase extends eui.UILayer { ...@@ -173,6 +173,8 @@ export default class MainBase extends eui.UILayer {
RES.getResAsync("guideTxt" + i + "_png") RES.getResAsync("guideTxt" + i + "_png")
} }
var arr = [ var arr = [
"道具",
"recordbtn",
"lionMsgBg", "lionMsgBg",
"guideBox", "guideBox",
"msgTri", "msgTri",
......
...@@ -277,7 +277,7 @@ export default class MainScene extends Scene { ...@@ -277,7 +277,7 @@ export default class MainScene extends Scene {
playSound(SoundType.fail); playSound(SoundType.fail);
PanelCtrl.instance.show("failed", { level: this.chapter }); PanelCtrl.instance.show("failed", { level: this.chapter });
}, this) }, this)
this.addChild(fail); // this.addChild(fail);
var sucess = new eui.Image(RES.getRes("guideKnowBtn_png")); var sucess = new eui.Image(RES.getRes("guideKnowBtn_png"));
sucess.x = 474; sucess.x = 474;
sucess.y = 10; sucess.y = 10;
......
...@@ -72,48 +72,45 @@ export class GuideCon extends egret.DisplayObjectContainer { ...@@ -72,48 +72,45 @@ export class GuideCon extends egret.DisplayObjectContainer {
this.tri = tri; this.tri = tri;
this.addChild(tri); this.addChild(tri);
this.showWord = new ShowWord(); this.showWord = new ShowWord();
this.showWord.x = 286; this.showWord.x = 315;
this.showWord.y = 692; this.showWord.y = 692;
this.addChild(this.showWord); this.addChild(this.showWord);
this.groups = []; this.groups = [];
//两个图标,道具商城和我的奖励 //guideLove
var gg = new egret.DisplayObjectContainer(); var guideLove = new egret.Bitmap(RES.getRes("guideLove_png"));
gg.addChild(new egret.Bitmap(RES.getRes("道具_png"))); guideLove.x = 38.72;
var recordBtn = new egret.Bitmap(RES.getRes("recordbtn_png")); guideLove.y = 23.5;
recordBtn.y = 304.4 - 154; this.addChild(guideLove);
gg.addChild(recordBtn); this.groups.push(guideLove);
this.addChild(gg); //guideMoney
this.groups.push(gg); var guideMoney = new egret.Bitmap(RES.getRes("guideMoney_png"));
guideMoney.x = 354;
guideMoney.y = 24.34;
this.addChild(guideMoney);
this.groups.push(guideMoney);
//关卡 //关卡
var guideLevel = new egret.Bitmap(RES.getRes("guideLevel_png")); var guideLevel = new egret.Bitmap(RES.getRes("guideLevel_png"));
guideLevel.x = 20.61; guideLevel.x = 315;
guideLevel.y = 136.24; guideLevel.y = 462;
this.addChild(guideLevel); this.addChild(guideLevel);
console.log(guideLevel);
this.groups.push(guideLevel); this.groups.push(guideLevel);
//宝箱 //宝箱
var box = new egret.Bitmap(RES.getRes("guideBox_png")); var box = new egret.Bitmap(RES.getRes("guideBox_png"));
box.x = 20.61; box.x = 20.61;
box.y = 136.24; box.y = 136.24;
this.addChild(box); this.addChild(box);
this.groups.push(box); this.groups.push(box);
//两个图标,道具商城和我的奖励
//guideMoney var gg = new egret.DisplayObjectContainer();
var guideMoney = new egret.Bitmap(RES.getRes("guideMoney_png")); gg.addChild(new egret.Bitmap(RES.getRes("道具_png")));
guideMoney.x = 354; var recordBtn = new egret.Bitmap(RES.getRes("recordbtn_png"));
guideMoney.y = 24.34; recordBtn.y = 304.4 - 154;
this.addChild(guideMoney); gg.addChild(recordBtn);
this.groups.push(guideMoney); this.addChild(gg);
this.groups.push(gg);
//guideLove gg.x = 615;
var guideLove = new egret.Bitmap(RES.getRes("guideLove_png")); gg.y = 154;
guideLove.x = 38.72;
guideLove.y = 23.5;
this.addChild(guideLove);
this.groups.push(guideLove);
//跳过提示 //跳过提示
var guideOver = new egret.Bitmap(RES.getRes("guideOver_png")); var guideOver = new egret.Bitmap(RES.getRes("guideOver_png"));
...@@ -125,7 +122,7 @@ export class GuideCon extends egret.DisplayObjectContainer { ...@@ -125,7 +122,7 @@ export class GuideCon extends egret.DisplayObjectContainer {
clearTimeout(this.timeoutId); clearTimeout(this.timeoutId);
writeCache(); writeCache();
}, this) }, this)
this.addChild(guideLove); this.addChild(guideOver);
//箭头 //箭头
if (!arrow) { if (!arrow) {
...@@ -148,11 +145,11 @@ export class GuideCon extends egret.DisplayObjectContainer { ...@@ -148,11 +145,11 @@ export class GuideCon extends egret.DisplayObjectContainer {
} }
positions: number[][] = [ positions: number[][] = [
[1, 1, 180], [245, 290, 180],
[1, 1, 180], [570, 290, 180],
[1, 1, 0], [260, 280, 0],
[1, 1, 180], [255, 430, 180],
[1, 1, -90], [440, 390, -90],
] ]
words: string[] = [ words: string[] = [
"这里是生命值,闯关失败后\n都会扣除一点生命值", "这里是生命值,闯关失败后\n都会扣除一点生命值",
...@@ -170,15 +167,23 @@ export class GuideCon extends egret.DisplayObjectContainer { ...@@ -170,15 +167,23 @@ export class GuideCon extends egret.DisplayObjectContainer {
this.toggleVisible(step); this.toggleVisible(step);
//箭头位置 //箭头位置
arrow.x = this.positions[step - 1][0]; arrow.x = this.positions[step - 1][0];
arrow.x = this.positions[step - 1][1]; arrow.y = this.positions[step - 1][1];
arrow.rotation = this.positions[step - 1][2]; arrow.rotation = this.positions[step - 1][2];
//文案播放,播放完后this.couldOver=true,计时 //文案播放,播放完后this.couldOver=true,计时
this.showWord.play(this.words[step - 1], () => { this.showWord.play(this.words[step - 1], () => {
this.couldOver = true; this.couldOver = true;
this.tri.visible = true; this.tri.visible = true;
egret.Tween.get(this.tri, { loop: true }) egret.Tween.get(this.tri, { loop: true }, null, true)
.to({ y: 814 }, 100) .set({ y: 804 })
.to({ y: 804 }, 100) .to({ y: 814 }, 300)
.to({ y: 804 }, 300)
this.timeoutId = setTimeout(() => {
clearTimeout(this.timeoutId);
this.couldOver = false;
this.goNext();
}, 3000)
}) })
} }
......
...@@ -26,12 +26,12 @@ export default class MapScene extends Scene { ...@@ -26,12 +26,12 @@ export default class MapScene extends Scene {
async start(data?) { async start(data?) {
super.start(); super.start();
// if (!readCache()) { if (!readCache()) {
// var guide = new GuideCon(); var guide = new GuideCon();
// this.addChild(guide); this.addChild(guide);
// // guide.play(1) guide.play(1)
// console.log(guide) console.log(guide)
// } }
// window['gameover'] = ()=>{ // window['gameover'] = ()=>{
// NetManager.ins.hc_submit(() => { }, 1, 1, null, ''); // NetManager.ins.hc_submit(() => { }, 1, 1, null, '');
......
...@@ -10,6 +10,7 @@ export class ShowWord extends egret.DisplayObjectContainer { ...@@ -10,6 +10,7 @@ export class ShowWord extends egret.DisplayObjectContainer {
this.showText.textColor = 0x000000; this.showText.textColor = 0x000000;
this.showText.width = 410; this.showText.width = 410;
this.showText.textAlign = egret.HorizontalAlign.LEFT; this.showText.textAlign = egret.HorizontalAlign.LEFT;
this.showText.lineSpacing = 10;
this.addChild(this.showText); this.addChild(this.showText);
} }
/** /**
...@@ -17,27 +18,25 @@ export class ShowWord extends egret.DisplayObjectContainer { ...@@ -17,27 +18,25 @@ export class ShowWord extends egret.DisplayObjectContainer {
* @param text * @param text
*/ */
play(text: string, callback: Function) { play(text: string, callback: Function) {
var a = { x: 0 }
egret.Tween.get(a)
.wait(200)
.call(() => {
})
var spiltStrs = text.split("\n"); var spiltStrs = text.split("\n");
//拆分文本 //拆分文本
let strs: string[] = [] let strs: string[] = []
for (var i = 0; i < spiltStrs.length; i++) { for (var i = 0; i < spiltStrs.length; i++) {
var spiltStr: string = spiltStrs[i]; var spiltStr: string = spiltStrs[i];
var str: string = ""; var ori: string = "";
while (i > 0) { var index = 0;
str += spiltStrs[--i]; while (index < i) {
str += "\n"; ori += spiltStrs[index];
ori += "\n";
index++;
} }
for (var j = 0; j < spiltStr.length; j++) { for (var j = 0; j < spiltStr.length; j++) {
var str = "" + ori;
str += spiltStr.substring(0, j + 1) str += spiltStr.substring(0, j + 1)
strs.push(str) strs.push(str)
} }
} }
// console.log(strs)
//轮流替换文本 //轮流替换文本
for (let m = 0; m < strs.length; m++) { for (let m = 0; m < strs.length; m++) {
let str = strs[m]; let str = strs[m];
...@@ -46,7 +45,7 @@ export class ShowWord extends egret.DisplayObjectContainer { ...@@ -46,7 +45,7 @@ export class ShowWord extends egret.DisplayObjectContainer {
if (m == strs.length - 1) { if (m == strs.length - 1) {
callback(); callback();
} }
}, 200 * m) }, 100 * m)
} }
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment