Commit 73761d34 authored by 熊东起's avatar 熊东起

first

parent 4906038f
......@@ -49,7 +49,7 @@
<script>
window.addEventListener("load", function() {
//是否完成新手
const scheduleFinished =0;
const scheduleFinished =1;
//目标分数
const targetScore = 120;
//是否音乐
......
......@@ -28,6 +28,10 @@ class Layers extends FYGE.Container {
//有些时候,定宽的时候,部分layer置顶,部分居中,再处理
//为了都置顶和置左,stage的方式永远居中视窗,要么改stage永远左上为00
// this[arr[i]].y = this.stageOffsetY;
if (this.stageHeight > 1624) {
this[arr[i]].scaleY = this.stageHeight / 1624;
this[arr[i]].y = this.stageOffsetY;
}
//如果定宽这里没必要,肯定是0
// this[arr[i]].x = this.stageOffsetX;//去掉,定高时就居中了
this.addChild(this[arr[i]]);
......
......@@ -1075,6 +1075,10 @@ var Layers = (function (_super) {
];
for (var i = 0; i < arr.length; i++) {
this[arr[i]] = new FYGE.Container();
if (this.stageHeight > 1624) {
this[arr[i]].scaleY = this.stageHeight / 1624;
this[arr[i]].y = this.stageOffsetY;
}
this.addChild(this[arr[i]]);
}
sceneCtrl_1.default.instance.init(this.sceneLayer);
......@@ -4889,12 +4893,12 @@ var MConst;
MConst.GroundLine = 0;
MConst.Gravity = 0.01;
MConst.BubbleSplitVelocityX = 1.2;
MConst.BubbleSplitVelocityY = 2.8;
MConst.BubbleSplitVelocityY = 6.8;
MConst.BubbleInitPosY = 1306 * 0.8;
MConst.CurMaxBubbleNum = 20;
MConst.CurMaxBubbleNum = 30;
MConst.BubbleVelocityX = 2;
MConst.BubbleVelocityXRandomFactor = 0.9;
MConst.BubbleAppearSpace = 500;
MConst.BubbleAppearSpace = 320;
MConst.countDown = 1 * 60;
MConst.tickSeconds = 60;
MConst.options = {
......@@ -5352,6 +5356,8 @@ exports.default = GameMgr;
Object.defineProperty(exports, "__esModule", { value: true });
var DataMgr_1 = __webpack_require__(/*! ./DataMgr */ "./src/Mgr/DataMgr.ts");
var GuideMask_1 = __webpack_require__(/*! ../game/GuideMask */ "./src/game/GuideMask.ts");
var BubbleBathMain_1 = __webpack_require__(/*! ../BubbleBathMain */ "./src/BubbleBathMain.ts");
var TimerCountMgr_1 = __webpack_require__(/*! ./TimerCountMgr */ "./src/Mgr/TimerCountMgr.ts");
var GuideMgr = (function () {
function GuideMgr() {
this.currentGuideMask = null;
......@@ -5399,9 +5405,11 @@ var GuideMgr = (function () {
DataMgr_1.DataMgr.game.pause = true;
this.currentGuideMask = new GuideMask_1.default();
this.currentGuideMask.onClick = function (context) {
BubbleBathMain_1.GDispatcher.dispatchEvent("new-guide");
context.dispose();
_this.currentGuideMask = null;
DataMgr_1.DataMgr.game.pause = false;
TimerCountMgr_1.default.instance.drawTimerCount();
if (isEnd) {
_this.guideFlag = false;
}
......@@ -5697,7 +5705,7 @@ exports.ResJson = {
"ro": true
},
"bubble_count.png": {
"x": 1007,
"x": 1008,
"y": 368,
"w": 113,
"h": 112,
......@@ -5721,11 +5729,11 @@ exports.ResJson = {
"bubble_next.png": {
"x": 754,
"y": 1136,
"w": 251,
"w": 252,
"h": 68,
"ox": 0,
"oy": 0,
"sw": 251,
"sw": 252,
"sh": 68,
"ro": false
},
......@@ -6277,7 +6285,7 @@ exports.ResJson = {
}
}
],
"path": "https://yun.duiba.com.cn/db_games/activity/kickball-feile/1601606821/resource/"
"path": "https://yun.duiba.com.cn/db_games/activity/kickball-feile/1602988706/resource/"
};
......@@ -6801,7 +6809,7 @@ var Bubble = (function (_super) {
if (!DataMgr_1.DataMgr.game.pause) {
FYGE.Tween.get(this)
.set({ scaleX: 0.2, scaleY: 0.2 })
.to({ x: BaseX, y: BaseY, scaleX: 1, scaleY: 1 }, 1000)
.to({ x: BaseX, y: BaseY, scaleX: 1, scaleY: 1 }, 500)
.call(function () {
_this.pause = false;
});
......@@ -7026,6 +7034,9 @@ var BubbleBath = (function (_super) {
set: function (v) {
this._score = v;
this.totalBubbleCountLabel.text = this._score + "";
if (this._score >= 100) {
this.totalBubbleCountLabel.x = 76;
}
},
enumerable: true,
configurable: true
......@@ -7075,6 +7086,10 @@ var BubbleBath = (function (_super) {
this.downTimer();
};
BubbleBath.prototype.createBubbles = function () {
if (MConst_1.MConst.options.scheduleFinished == 0) {
GuideMgr_1.default.instance.drawFirstGuide(true);
MConst_1.MConst.options.scheduleFinished = 1;
}
var size = MUtils_1.MUtils.randomInt(0, MConfigs_1.MConfigs.size.length);
var dir = Math.random() > 0.5 ? -1 : 1;
var bubble = this.bubblePool.spwan(size);
......@@ -7084,9 +7099,6 @@ var BubbleBath = (function (_super) {
bubble.startBubble(dir);
bubble.mouseEnable = true;
bubble.mouseChildren = true;
if (GuideMgr_1.default.instance.guideFlag == true && this._bubbleList.length > 1 && MConst_1.MConst.options.scheduleFinished == 1) {
GuideMgr_1.default.instance.drawFirstGuide(true);
}
};
BubbleBath.prototype.onBrokeBubble = function (_a) {
var x = _a.x, y = _a.y;
......@@ -7148,6 +7160,7 @@ var BubbleBath = (function (_super) {
if (result.data.leftTimes > 0) {
ctrls_1.showPanel(GameFailPanel_1.GameFailPanel, { isAgain: true });
BubbleBathMain_1.GDispatcher.dispatchEvent({ type: "showBuried" }, { md: 29 });
BubbleBathMain_1.GDispatcher.dispatchEvent({ type: "showBuried" }, { md: 47 });
}
else {
ctrls_1.showPanel(GameFailPanel_1.GameFailPanel, { isAgain: false });
......@@ -7158,7 +7171,7 @@ var BubbleBath = (function (_super) {
if (result.data.leftTimes > 0) {
ctrls_1.showPanel(GameSuccessPanel_1.GameSuccessPanel, {
isAgain: true,
glodCoin: result.data.goldenCoin,
glodCoin: result.data.goldenCorn,
});
BubbleBathMain_1.GDispatcher.dispatchEvent({ type: "showBuried" }, { md: 27 });
BubbleBathMain_1.GDispatcher.dispatchEvent({ type: "showBuried" }, { md: 28 });
......@@ -7166,9 +7179,10 @@ var BubbleBath = (function (_super) {
else {
ctrls_1.showPanel(GameSuccessPanel_1.GameSuccessPanel, {
isAgain: false,
glodCoin: result.data.goldenCoin,
glodCoin: result.data.goldenCorn,
});
BubbleBathMain_1.GDispatcher.dispatchEvent({ type: "showBuried" }, { md: 30 });
BubbleBathMain_1.GDispatcher.dispatchEvent({ type: "showBuried" }, { md: 48 });
}
}
}
......@@ -7522,7 +7536,7 @@ var GuideMask = (function (_super) {
var pointer = new FYGE.Sprite(RES_1.RES.getRes("bubble_pointer.png"));
this.addChild(pointer);
pointer.position.set(350, this.gameOffsetY + 480);
var descText = Tools_1.Tool.getText("在游戏结束前,手指点击泡泡戳破它\n戳破100个泡泡即可闯关成功哦", 30, "#ffffff", FYGE.TEXT_ALIGN.CENTER, 550);
var descText = Tools_1.Tool.getText("在限定时间内\n戳破100个泡泡就能获得奖励哦~", 30, "#ffffff", FYGE.TEXT_ALIGN.CENTER, 550);
this.addChild(descText);
descText.position.set(96, this.gameOffsetY + 750);
var pointer = new FYGE.Sprite(RES_1.RES.getRes("bubble_next.png"));
......@@ -7968,45 +7982,56 @@ var TimerCount = (function (_super) {
var _this = this;
var allIn = new FYGE.Container(), self = this;
this.addChild(allIn);
var readySvga = new FYGE.MovieClip(RES_1.RES.getRes("bubble_ready.svga"));
allIn.addChild(readySvga);
readySvga.stop();
var time1Svga = new FYGE.MovieClip(RES_1.RES.getRes("bubble_time_1.svga"));
allIn.addChild(time1Svga);
time1Svga.stop();
var time2Svga = new FYGE.MovieClip(RES_1.RES.getRes("bubble_time_2.svga"));
allIn.addChild(time2Svga);
time2Svga.stop();
var time3Svga = new FYGE.MovieClip(RES_1.RES.getRes("bubble_time_3.svga"));
allIn.addChild(time3Svga);
time3Svga.stop();
time1Svga.visible = time2Svga.visible = time3Svga.visible = false;
SoundMgr_1.SoundMgr.instance.playSound("timerCount", false);
readySvga.startAniRange(0, readySvga.totalFrames, 1, function () {
FYGE.Tween.get(_this)
.call(function () {
time3Svga.visible = true;
time3Svga.startAniRange(0, time3Svga.totalFrames, 1, function () {
time3Svga.visible = false;
});
})
.wait(1000)
.call(function () {
time2Svga.visible = true;
time2Svga.startAniRange(0, time2Svga.totalFrames, 1, function () {
time2Svga.visible = false;
});
var timeBg = new FYGE.Sprite(RES_1.RES.getRes("timerBg.png"));
timeBg.anchorTexture.set(0.5, 0.5);
timeBg.x = 750 / 2;
timeBg.y = 1624 / 2;
timeBg.alpha = 1;
allIn.addChild(timeBg);
var fourImages = [];
var fourTextures = [
"bubble_ready.png",
"bubble_time_3.png",
"bubble_time_2.png",
"bubble_time_1.png",
];
for (var i = 0; i < fourTextures.length; i++) {
var t = RES_1.RES.getRes(fourTextures[i]);
var im = new FYGE.Sprite(t);
im.anchorTexture.set(0.5, 0.5);
im.x = 750 / 2;
im.y = 1624 / 2;
im.alpha = 0;
fourImages.push(im);
allIn.addChild(im);
}
for (var i_1 = 0; i_1 < 4; i_1++) {
var im_1 = fourImages[i_1];
var delta = i_1 * 1000;
var t_1 = FYGE.Tween.get(im_1);
t_1.wait(delta)
.set({ alpha: 1, scaleX: 0.1, scaleY: 0.1 })
.to({ scaleX: 1, scaleY: 1 }, 500, FYGE.Ease.backOut)
.wait(500);
if (i_1 == 3) {
t_1.call(function () {
callback();
})
.wait(1000)
.to({ alpha: 0 }, 200)
.call(function () {
time1Svga.visible = true;
time1Svga.startAniRange(0, time1Svga.totalFrames, 1, function () {
time1Svga.visible = false;
callback();
FYGE.Tween.removeTweens(self);
});
_this.removeChild(allIn);
});
}
else {
t_1.set({ alpha: 0 });
}
if (i_1 == 0) {
t_1.call(function () {
timeBg.alpha = 1;
});
}
}
};
return TimerCount;
}(FYGE.Container));
......@@ -8092,12 +8117,12 @@ var GameFailPanel = (function (_super) {
this.addChild(bg);
exports.centerImage(bg);
var isAgain = this.data.isAgain;
var title = Tools_1.Tool.getText("" + (isAgain ? "不想失去奖励" : "猫咪累了"), 38, "#333333", FYGE.TEXT_ALIGN.CENTER, 230);
var title = Tools_1.Tool.getText("" + (isAgain ? "不想失去奖励?" : "猫咪累了"), 38, "#333333", FYGE.TEXT_ALIGN.CENTER, 280);
this.addChild(title);
title.position.set(270, 820);
var getPrizeText = Tools_1.Tool.getText("" + (isAgain ? "不如再试一次" : "等等再来玩"), 32, "" + (isAgain ? "#3b8edd" : "#333333"), FYGE.TEXT_ALIGN.CENTER, 230);
title.position.set(240, 820);
var getPrizeText = Tools_1.Tool.getText("" + (isAgain ? "那再试一次吧~" : "过会儿再来陪它玩吧~"), 32, "" + (isAgain ? "#3b8edd" : "#333333"), FYGE.TEXT_ALIGN.CENTER, 400);
this.addChild(getPrizeText);
getPrizeText.position.set(270, 880);
getPrizeText.position.set(180, 880);
this.seeCat = new FYGE.Button(RES_1.RES.getRes("bubble_seecat.png"));
bg.addChild(this.seeCat);
exports.posImage(this.seeCat, 300, 437);
......@@ -8122,6 +8147,9 @@ var GameFailPanel = (function (_super) {
};
GameFailPanel.prototype.onClickSeeCat = function () {
if (this.againBtn.visible) {
BubbleBathMain_1.GDispatcher.dispatchEvent("clickBuried", { md: 47 });
}
else {
BubbleBathMain_1.GDispatcher.dispatchEvent("clickBuried", { md: 31 });
}
BubbleBathMain_1.GDispatcher.dispatchEvent("bubble-see-cat");
......@@ -8219,18 +8247,18 @@ var GameSuccessPanel = (function (_super) {
this.addChild(bg);
exports.centerImage(bg);
var _a = this.data, isAgain = _a.isAgain, glodCoin = _a.glodCoin;
var title = Tools_1.Tool.getText("达成目标分数", 34, "#333333", FYGE.TEXT_ALIGN.CENTER, 230);
var title = Tools_1.Tool.getText("太棒了,目标达成!", 34, "#333333", FYGE.TEXT_ALIGN.CENTER, 320);
this.addChild(title);
title.position.set(270, 780);
title.position.set(235, 780);
var getPrizeText = Tools_1.Tool.getText("获得奖励", 28, "#ff6b52", FYGE.TEXT_ALIGN.CENTER, 230);
this.addChild(getPrizeText);
getPrizeText.position.set(270, 840);
var coin = new FYGE.Sprite(RES_1.RES.getRes("bubble_coin.png"));
this.addChild(coin);
coin.position.set(315, 900);
coin.position.set(330, 900);
var coinText = Tools_1.Tool.getText("X" + glodCoin, 26, "#a97a84", FYGE.TEXT_ALIGN.CENTER, 90);
this.addChild(coinText);
coinText.position.set(365, 908);
coinText.position.set(360, 908);
this.againBtn = new FYGE.Button(RES_1.RES.getRes("bubble_again1.png"));
bg.addChild(this.againBtn);
exports.posImage(this.againBtn, 300, 477);
......@@ -8254,6 +8282,7 @@ var GameSuccessPanel = (function (_super) {
};
GameSuccessPanel.prototype.onClickAwait = function () {
BubbleBathMain_1.GDispatcher.dispatchEvent("bubble-await");
BubbleBathMain_1.GDispatcher.dispatchEvent("clickBuried", { md: 48 });
this.hidePanel();
};
GameSuccessPanel.prototype.onClickShare = function () {
......@@ -8265,7 +8294,6 @@ var GameSuccessPanel = (function (_super) {
BubbleBathMain_1.GDispatcher.dispatchEvent("clickBuried", { md: 29 });
}
BubbleBathMain_1.GDispatcher.dispatchEvent("bubble-share");
this.hidePanel();
};
GameSuccessPanel.prototype.initEvents = function () {
_super.prototype.initEvents.call(this);
......@@ -8366,6 +8394,7 @@ var GameScenes = (function (_super) {
if (!this.game) {
this.game = new BubbleBath_1.default(this);
}
if (MConst_1.MConst.options.scheduleFinished == 1)
TimerCountMgr_1.default.instance.drawTimerCount();
var hidden, visibilityChange, self = this;
if (typeof document.hidden !== "undefined") {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
resource/bubbleBubble/bubble_next.png

2.56 KB | W: | H:

resource/bubbleBubble/bubble_next.png

4.13 KB | W: | H:

resource/bubbleBubble/bubble_next.png
resource/bubbleBubble/bubble_next.png
resource/bubbleBubble/bubble_next.png
resource/bubbleBubble/bubble_next.png
  • 2-up
  • Swipe
  • Onion skin
import { DataMgr } from "./DataMgr";
import { MConfigs } from "../Global/MConfigs";
import GuideMask from "../game/GuideMask";
import { GDispatcher } from "../BubbleBathMain";
import TimerCountMgr from "./TimerCountMgr";
// import Pot from "../game/Pot";
// import Food from "../game/Food";
......@@ -48,10 +50,13 @@ export default class GuideMgr {
DataMgr.game.pause = true;
this.currentGuideMask = new GuideMask();
this.currentGuideMask.onClick = (context) => {
//新手引导
GDispatcher.dispatchEvent("new-guide");
//@ts-ignore
context.dispose();
this.currentGuideMask = null;
DataMgr.game.pause = false;
TimerCountMgr.instance.drawTimerCount();
if (isEnd) {
this.guideFlag = false;
}
......
......@@ -27,7 +27,7 @@ export const ResJson = {
"ro": true
},
"bubble_count.png": {
"x": 1007,
"x": 1008,
"y": 368,
"w": 113,
"h": 112,
......@@ -51,11 +51,11 @@ export const ResJson = {
"bubble_next.png": {
"x": 754,
"y": 1136,
"w": 251,
"w": 252,
"h": 68,
"ox": 0,
"oy": 0,
"sw": 251,
"sw": 252,
"sh": 68,
"ro": false
},
......@@ -607,5 +607,5 @@ export const ResJson = {
}
}
],
"path": "https://yun.duiba.com.cn/db_games/activity/kickball-feile/1601606821/resource/"
"path": "https://yun.duiba.com.cn/db_games/activity/kickball-feile/1602988706/resource/"
}
\ No newline at end of file
......@@ -101,7 +101,7 @@ export default class Bubble extends MoveObjcet implements PoolElement {
if (!DataMgr.game.pause) {
FYGE.Tween.get(this)
.set({ scaleX: 0.2, scaleY: 0.2 })
.to({ x: BaseX, y: BaseY, scaleX: 1, scaleY: 1 }, 1000)
.to({ x: BaseX, y: BaseY, scaleX: 1, scaleY: 1 }, 500)
.call(() => {
this.pause = false;
});
......
......@@ -54,7 +54,7 @@ export default class BubbleBath extends FYGE.Container {
GDispatcher.once("gameDead", this.gameDead, this);
//弹窗测试
// showPanel(GameFailPanel);
// showPanel(GameSuccessPanel);
//引导
GuideMgr.instance.container = parent;
......@@ -190,6 +190,9 @@ export default class BubbleBath extends FYGE.Container {
public set score(v: number) {
this._score = v;
this.totalBubbleCountLabel.text = this._score + "";
if(this._score >= 100){
this.totalBubbleCountLabel.x = 76;
}
}
public get score(): number {
return this._score;
......@@ -247,6 +250,11 @@ export default class BubbleBath extends FYGE.Container {
/** 创建泡泡 */
private createBubbles() {
//新手引导
if (MConst.options.scheduleFinished == 0) {
GuideMgr.instance.drawFirstGuide(true);
MConst.options.scheduleFinished = 1;
}
let size = MUtils.randomInt(0, MConfigs.size.length);
let dir: 1 | -1 = Math.random() > 0.5 ? -1 : 1;
let bubble = this.bubblePool.spwan(size);
......@@ -256,10 +264,7 @@ export default class BubbleBath extends FYGE.Container {
bubble.startBubble(dir);
bubble.mouseEnable = true;
bubble.mouseChildren = true;
//新手引导
if (GuideMgr.instance.guideFlag == true && this._bubbleList.length > 1 && MConst.options.scheduleFinished == 1) {
GuideMgr.instance.drawFirstGuide(true);
}
}
/** 泡泡破灭 */
......@@ -332,6 +337,7 @@ export default class BubbleBath extends FYGE.Container {
if (result.data.leftTimes > 0) {
showPanel(GameFailPanel, { isAgain: true });
GDispatcher.dispatchEvent({ type: "showBuried" }, { md: 29 });
GDispatcher.dispatchEvent({ type: "showBuried" }, { md: 47 });
} else {
showPanel(GameFailPanel, { isAgain: false });
GDispatcher.dispatchEvent({ type: "showBuried" }, { md: 31 });
......@@ -340,16 +346,17 @@ export default class BubbleBath extends FYGE.Container {
if (result.data.leftTimes > 0) {
showPanel(GameSuccessPanel, {
isAgain: true,
glodCoin: result.data.goldenCoin,
glodCoin: result.data.goldenCorn,
});
GDispatcher.dispatchEvent({ type: "showBuried" }, { md: 27 });
GDispatcher.dispatchEvent({ type: "showBuried" }, { md: 28 });
} else {
showPanel(GameSuccessPanel, {
isAgain: false,
glodCoin: result.data.goldenCoin,
glodCoin: result.data.goldenCorn,
});
GDispatcher.dispatchEvent({ type: "showBuried" }, { md: 30 });
GDispatcher.dispatchEvent({ type: "showBuried" }, { md: 48 });
}
}
}
......
......@@ -48,7 +48,7 @@ export default class GuideMask extends FYGE.Container {
//描述
let descText = Tool.getText(
"在游戏结束前,手指点击泡泡戳破它\n戳破100个泡泡即可闯关成功哦",
"在限定时间内\n戳破100个泡泡就能获得奖励哦~",
30,
"#ffffff",
FYGE.TEXT_ALIGN.CENTER,
......
......@@ -28,103 +28,104 @@ export default class TimerCount extends FYGE.Container {
self = this;
this.addChild(allIn);
//加入SVGA
let readySvga = new FYGE.MovieClip(RES.getRes("bubble_ready.svga"));
allIn.addChild(readySvga);
readySvga.stop();
let time1Svga = new FYGE.MovieClip(RES.getRes("bubble_time_1.svga"));
allIn.addChild(time1Svga);
time1Svga.stop();
let time2Svga = new FYGE.MovieClip(RES.getRes("bubble_time_2.svga"));
allIn.addChild(time2Svga);
time2Svga.stop();
let time3Svga = new FYGE.MovieClip(RES.getRes("bubble_time_3.svga"));
allIn.addChild(time3Svga);
time3Svga.stop();
// let readySvga = new FYGE.MovieClip(RES.getRes("bubble_ready.svga"));
// allIn.addChild(readySvga);
// readySvga.stop();
// let time1Svga = new FYGE.MovieClip(RES.getRes("bubble_time_1.svga"));
// allIn.addChild(time1Svga);
// time1Svga.stop();
// let time2Svga = new FYGE.MovieClip(RES.getRes("bubble_time_2.svga"));
// allIn.addChild(time2Svga);
// time2Svga.stop();
// let time3Svga = new FYGE.MovieClip(RES.getRes("bubble_time_3.svga"));
// allIn.addChild(time3Svga);
// time3Svga.stop();
time1Svga.visible = time2Svga.visible = time3Svga.visible = false;
//倒计时准备音效
// time1Svga.visible = time2Svga.visible = time3Svga.visible = false;
// //倒计时准备音效
// SoundMgr.instance.playSound("timerCount",false);
// readySvga.startAniRange(0, readySvga.totalFrames, 1, () => {
// FYGE.Tween.get(this)
// .call(() => {
// time3Svga.visible = true;
// time3Svga.startAniRange(0, time3Svga.totalFrames, 1, () => {
// time3Svga.visible = false;
// });
// })
// .wait(1000)
// .call(() => {
// time2Svga.visible = true;
// time2Svga.startAniRange(0, time2Svga.totalFrames, 1, () => {
// time2Svga.visible = false;
// });
// })
// .wait(1000)
// .call(() => {
// time1Svga.visible = true;
// time1Svga.startAniRange(0, time1Svga.totalFrames, 1, () => {
// time1Svga.visible = false;
// callback();
// FYGE.Tween.removeTweens(self);
// });
// });
// });
//背景
SoundMgr.instance.playSound("timerCount",false);
readySvga.startAniRange(0, readySvga.totalFrames, 1, () => {
FYGE.Tween.get(this)
.call(() => {
time3Svga.visible = true;
time3Svga.startAniRange(0, time3Svga.totalFrames, 1, () => {
time3Svga.visible = false;
});
})
.wait(1000)
.call(() => {
time2Svga.visible = true;
time2Svga.startAniRange(0, time2Svga.totalFrames, 1, () => {
time2Svga.visible = false;
});
var timeBg = new FYGE.Sprite(RES.getRes("timerBg.png"));
timeBg.anchorTexture.set(0.5, 0.5);
timeBg.x = 750 / 2;
timeBg.y = 1624 / 2;
timeBg.alpha = 1;
allIn.addChild(timeBg);
var fourImages = [];
var fourTextures = [
"bubble_ready.png",
"bubble_time_3.png",
"bubble_time_2.png",
"bubble_time_1.png",
];
for (var i = 0; i < fourTextures.length; i++) {
var t: FYGE.Texture = RES.getRes(fourTextures[i]);
var im = new FYGE.Sprite(t);
//都需要居中
im.anchorTexture.set(0.5, 0.5);
im.x = 750 / 2;
im.y = 1624 / 2;
im.alpha = 0;
fourImages.push(im);
allIn.addChild(im);
}
//如果背景音乐开着的话先关闭
// if (getBgOn()) stopBg();
for (let i = 0; i < 4; i++) {
let im = fourImages[i];
let delta = i * 1000;
let t = FYGE.Tween.get(im);
t.wait(delta)
.set({ alpha: 1, scaleX: 0.1, scaleY: 0.1 })
.to({ scaleX: 1, scaleY: 1 }, 500, FYGE.Ease.backOut)
.wait(500);
if (i == 3) {
t.call(() => {
callback();
})
.wait(1000)
.to({ alpha: 0 }, 200)
.call(() => {
time1Svga.visible = true;
time1Svga.startAniRange(0, time1Svga.totalFrames, 1, () => {
time1Svga.visible = false;
callback();
FYGE.Tween.removeTweens(self);
});
//执行完销毁吧,浏览器自己回收吧
// allIn.destroy();
this.removeChild(allIn);
// if (getBgOn()) playBg();
});
} else {
t.set({ alpha: 0 });
}
if (i == 0) {
t.call(() => {
timeBg.alpha = 1;
});
//背景
// var timeBg = new FYGE.Sprite(RES.getRes("timerBg.png"));
// timeBg.anchorTexture.set(0.5, 0.5);
// timeBg.x = 750 / 2;
// timeBg.y = 1624 / 2;
// timeBg.alpha = 0;
// allIn.addChild(timeBg);
// var fourImages = [];
// var fourTextures = [
// "bubble_ready.png",
// "bubble_time_3.png",
// "bubble_time_2.png",
// "bubble_time_1.png",
// ];
// for (var i = 0; i < fourTextures.length; i++) {
// var t: FYGE.Texture = RES.getRes(fourTextures[i]);
// var im = new FYGE.Sprite(t);
// //都需要居中
// im.anchorTexture.set(0.5, 0.5);
// im.x = 750 / 2;
// im.y = 1624 / 2;
// im.alpha = 0;
// fourImages.push(im);
// allIn.addChild(im);
// }
// //如果背景音乐开着的话先关闭
// // if (getBgOn()) stopBg();
// for (let i = 0; i < 4; i++) {
// let im = fourImages[i];
// let delta = i * 1000;
// let t = FYGE.Tween.get(im);
// t.wait(delta)
// .set({ alpha: 1, scaleX: 0.1, scaleY: 0.1 })
// .to({ scaleX: 1, scaleY: 1 }, 500, FYGE.Ease.backOut)
// .wait(500);
// if (i == 3) {
// t.call(() => {
// callback();
// })
// .to({ alpha: 0 }, 200)
// .call(() => {
// //执行完销毁吧,浏览器自己回收吧
// // allIn.destroy();
// this.removeChild(allIn);
// // if (getBgOn()) playBg();
// });
// } else {
// t.set({ alpha: 0 });
// }
// if (i == 0) {
// t.call(() => {
// timeBg.alpha = 1;
// });
// }
// }
}
}
}
}
......@@ -7,12 +7,12 @@ export namespace MConst {
export const GroundLine = 0; //地平线
export const Gravity = 0.01; //泡泡加速度
export const BubbleSplitVelocityX = 1.2; //X方向偏移
export const BubbleSplitVelocityY = 2.8; //每帧上飘距离
export const BubbleSplitVelocityY = 6.8; //每帧上飘距离
export const BubbleInitPosY = 1306 * 0.8; //泡泡初始位置——Y
export const CurMaxBubbleNum = 20; //界面最多存在泡泡数
export const CurMaxBubbleNum = 30; //界面最多存在泡泡数
export const BubbleVelocityX = 2;
export const BubbleVelocityXRandomFactor = 0.9;
export const BubbleAppearSpace = 500; //泡泡出现间隔 -- 初始
export const BubbleAppearSpace = 320; //泡泡出现间隔 -- 初始
export const countDown = 1 * 60; //倒计时时间
export let tickSeconds = 60;
export let options = {
......
......@@ -29,28 +29,28 @@ export class GameFailPanel extends Panel {
//数据
const { isAgain } = this.data;
// var isAgain = false;//是否只有一颗 按钮
// var isAgain = true;//是否只有一颗 按钮
//描述
let title = Tool.getText(
`${isAgain ? "不想失去奖励" : "猫咪累了"}`,
`${isAgain ? "不想失去奖励?" : "猫咪累了"}`,
38,
"#333333",
FYGE.TEXT_ALIGN.CENTER,
230
280
);
this.addChild(title);
title.position.set(270, 820);
title.position.set(240, 820);
//获得奖励
let getPrizeText = Tool.getText(
`${isAgain ? "不如再试一次" : "等等再来玩"}`,
`${isAgain ? "那再试一次吧~" : "过会儿再来陪它玩吧~"}`,
32,
`${isAgain ? "#3b8edd" : "#333333"}`,
FYGE.TEXT_ALIGN.CENTER,
230
400
);
this.addChild(getPrizeText);
getPrizeText.position.set(270, 880);
getPrizeText.position.set(180, 880);
//看猫
this.seeCat = new FYGE.Button(RES.getRes("bubble_seecat.png"));
......@@ -86,6 +86,8 @@ export class GameFailPanel extends Panel {
//看猫咪
onClickSeeCat() {
if (this.againBtn.visible) {
GDispatcher.dispatchEvent("clickBuried", { md: 47 });
}else{
GDispatcher.dispatchEvent("clickBuried", { md: 31 });
}
GDispatcher.dispatchEvent("bubble-see-cat");
......
......@@ -36,18 +36,18 @@ export class GameSuccessPanel extends Panel {
//数据
const { isAgain, glodCoin } = this.data;
// var isAgain = false;
// var isAgain = true,glodCoin=100;
//描述
let title = Tool.getText(
"达成目标分数",
"太棒了,目标达成!",
34,
"#333333",
FYGE.TEXT_ALIGN.CENTER,
230
320
);
this.addChild(title);
title.position.set(270, 780);
title.position.set(235, 780);
//获得奖励
let getPrizeText = Tool.getText(
"获得奖励",
......@@ -62,7 +62,7 @@ export class GameSuccessPanel extends Panel {
//金币
let coin = new FYGE.Sprite(RES.getRes("bubble_coin.png"));
this.addChild(coin);
coin.position.set(315, 900);
coin.position.set(330, 900);
let coinText = Tool.getText(
`X${glodCoin}`,
......@@ -72,7 +72,7 @@ export class GameSuccessPanel extends Panel {
90
);
this.addChild(coinText);
coinText.position.set(365, 908);
coinText.position.set(360, 908);
//爱心
// let love = new FYGE.Sprite(RES.getRes("bubble_love.png"));
// this.addChild(love);
......@@ -119,6 +119,7 @@ export class GameSuccessPanel extends Panel {
//等等再来玩
onClickAwait() {
GDispatcher.dispatchEvent("bubble-await");
GDispatcher.dispatchEvent("clickBuried", { md: 48 });
this.hidePanel();
}
......@@ -131,7 +132,7 @@ export class GameSuccessPanel extends Panel {
GDispatcher.dispatchEvent("clickBuried", { md: 29 });
}
GDispatcher.dispatchEvent("bubble-share");
this.hidePanel();
// this.hidePanel();
}
initEvents() {
......
......@@ -34,6 +34,7 @@ export class GameScenes extends Scene {
if (!this.game) {
this.game = new BubbleBath(this);
}
if (MConst.options.scheduleFinished == 1)
TimerCountMgr.instance.drawTimerCount();
//设置隐藏属性和改变可见属性的事件的名称
let hidden: string,
......
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