Commit c318f72b authored by 熊东起's avatar 熊东起

first

parent d17d9f4a
[1015/093634.432:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3)
[1018/100252.685:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3)
...@@ -48,13 +48,13 @@ ...@@ -48,13 +48,13 @@
<script> <script>
window.addEventListener("load", function() { window.addEventListener("load", function() {
//是否完成新手 //是否完成新手
const scheduleFinished =0; const scheduleFinished =1;
//目标分数 //目标分数
const targetScore = 20; const targetScore = 20;
//是否音乐 //是否音乐
const isMusic = true; const isMusic = true;
//时间 //时间
let tickSeconds = 10; let tickSeconds = 60;
//获取canvas //获取canvas
var canvas = document.getElementById("canvas"); var canvas = document.getElementById("canvas");
canvas.width = document.body.clientWidth * (window.devicePixelRatio || 1) canvas.width = document.body.clientWidth * (window.devicePixelRatio || 1)
......
import PanelCtrl from "../ctrls/panelCtrl"; import PanelCtrl from "../ctrls/panelCtrl";
import SceneCtrl from "../ctrls/sceneCtrl"; import SceneCtrl from "../ctrls/sceneCtrl";
...@@ -21,49 +20,66 @@ class Layers extends FYGE.Container { ...@@ -21,49 +20,66 @@ class Layers extends FYGE.Container {
"_popupLayer", "_popupLayer",
"_toastLayer", "_toastLayer",
"_topLayer", "_topLayer",
"_shareLayer" "_shareLayer",
]; ];
for (var i = 0; i < arr.length; i++) { for (var i = 0; i < arr.length; i++) {
this[arr[i]] = new FYGE.Container(); this[arr[i]] = new FYGE.Container();
//有些时候,定宽的时候,部分layer置顶,部分居中,再处理 //有些时候,定宽的时候,部分layer置顶,部分居中,再处理
//为了都置顶和置左,stage的方式永远居中视窗,要么改stage永远左上为00 //为了都置顶和置左,stage的方式永远居中视窗,要么改stage永远左上为00
// this[arr[i]].y = this.stageOffsetY; // this[arr[i]].y = this.stageOffsetY;
console.log(this.stageHeight);
if (this.stageHeight > 1624) {
this[arr[i]].scaleY = this.stageHeight / 1624;
this[arr[i]].y = this.stageOffsetY;
}
//如果定宽这里没必要,肯定是0 //如果定宽这里没必要,肯定是0
// this[arr[i]].x = this.stageOffsetX;//去掉,定高时就居中了 // this[arr[i]].x = this.stageOffsetX;//去掉,定高时就居中了
this.addChild(this[arr[i]]); this.addChild(this[arr[i]]);
} }
// this._sceneLayer.y = this.stageOffsetY // this._sceneLayer.y = this.stageOffsetY
//初始化场景层级 //初始化场景层级
SceneCtrl.instance.init(this.sceneLayer) SceneCtrl.instance.init(this.sceneLayer);
//初始化弹框层级 //初始化弹框层级
PanelCtrl.instance.init(this.popupLayer) PanelCtrl.instance.init(this.popupLayer);
} }
/** /**
* 底图所在层级,比如统一的背景 * 底图所在层级,比如统一的背景
*/ */
get bottomLayer() { return this._bottomLayer } get bottomLayer() {
return this._bottomLayer;
}
/** /**
* 场景 * 场景
*/ */
get sceneLayer() { return this._sceneLayer } get sceneLayer() {
return this._sceneLayer;
}
/** /**
* 弹框 * 弹框
*/ */
get popupLayer() { return this._popupLayer } get popupLayer() {
return this._popupLayer;
}
/** /**
* toast所在层级 * toast所在层级
*/ */
get toastLayer() { return this._toastLayer } get toastLayer() {
return this._toastLayer;
}
/** /**
* 顶层,比如统一标题栏等 * 顶层,比如统一标题栏等
*/ */
get topLayer() { return this._topLayer } get topLayer() {
return this._topLayer;
}
/** /**
* 分享引导层 * 分享引导层
*/ */
get shareLayer() { return this._shareLayer } get shareLayer() {
return this._shareLayer;
}
/** /**
* 舞台信息都放在layers里吧 * 舞台信息都放在layers里吧
* 舞台可见高度,初始化后才能使用 * 舞台可见高度,初始化后才能使用
...@@ -111,5 +127,5 @@ export function destroyLayers() { ...@@ -111,5 +127,5 @@ export function destroyLayers() {
//所有层级移除,init会重新建 //所有层级移除,init会重新建
layers.removeChildren(); layers.removeChildren();
//从父级stage移除自己,init会重新加 //从父级stage移除自己,init会重新加
if (layers.parent) layers.parent.removeChild(layers) if (layers.parent) layers.parent.removeChild(layers);
} }
...@@ -1071,42 +1071,59 @@ var Layers = (function (_super) { ...@@ -1071,42 +1071,59 @@ var Layers = (function (_super) {
"_popupLayer", "_popupLayer",
"_toastLayer", "_toastLayer",
"_topLayer", "_topLayer",
"_shareLayer" "_shareLayer",
]; ];
for (var i = 0; i < arr.length; i++) { for (var i = 0; i < arr.length; i++) {
this[arr[i]] = new FYGE.Container(); this[arr[i]] = new FYGE.Container();
console.log(this.stageHeight);
if (this.stageHeight > 1624) {
this[arr[i]].scaleY = this.stageHeight / 1624;
this[arr[i]].y = this.stageOffsetY;
}
this.addChild(this[arr[i]]); this.addChild(this[arr[i]]);
} }
sceneCtrl_1.default.instance.init(this.sceneLayer); sceneCtrl_1.default.instance.init(this.sceneLayer);
panelCtrl_1.default.instance.init(this.popupLayer); panelCtrl_1.default.instance.init(this.popupLayer);
}; };
Object.defineProperty(Layers.prototype, "bottomLayer", { Object.defineProperty(Layers.prototype, "bottomLayer", {
get: function () { return this._bottomLayer; }, get: function () {
return this._bottomLayer;
},
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
Object.defineProperty(Layers.prototype, "sceneLayer", { Object.defineProperty(Layers.prototype, "sceneLayer", {
get: function () { return this._sceneLayer; }, get: function () {
return this._sceneLayer;
},
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
Object.defineProperty(Layers.prototype, "popupLayer", { Object.defineProperty(Layers.prototype, "popupLayer", {
get: function () { return this._popupLayer; }, get: function () {
return this._popupLayer;
},
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
Object.defineProperty(Layers.prototype, "toastLayer", { Object.defineProperty(Layers.prototype, "toastLayer", {
get: function () { return this._toastLayer; }, get: function () {
return this._toastLayer;
},
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
Object.defineProperty(Layers.prototype, "topLayer", { Object.defineProperty(Layers.prototype, "topLayer", {
get: function () { return this._topLayer; }, get: function () {
return this._topLayer;
},
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
Object.defineProperty(Layers.prototype, "shareLayer", { Object.defineProperty(Layers.prototype, "shareLayer", {
get: function () { return this._shareLayer; }, get: function () {
return this._shareLayer;
},
enumerable: true, enumerable: true,
configurable: true configurable: true
}); });
...@@ -4675,8 +4692,8 @@ var MConst; ...@@ -4675,8 +4692,8 @@ var MConst;
width: 750, width: 750,
height: 1624 height: 1624
}; };
MConst.CatJumpSpeed = 28; MConst.CatJumpSpeed = 26;
MConst.gravity = 0.98; MConst.gravity = 0.9;
MConst.baseTrueH = 300; MConst.baseTrueH = 300;
MConst.catTrueH = 226; MConst.catTrueH = 226;
MConst.blockName = ["catTV", "catJiazi", "catHouse", "catHetun"]; MConst.blockName = ["catTV", "catJiazi", "catHouse", "catHetun"];
...@@ -4689,7 +4706,7 @@ var MConst; ...@@ -4689,7 +4706,7 @@ var MConst;
MConst.blockAverageH = 178; MConst.blockAverageH = 178;
MConst.blockInitOffsetX = 10; MConst.blockInitOffsetX = 10;
MConst.baseOffsetY = 250; MConst.baseOffsetY = 250;
MConst.blockDurationRange = [500, 1200]; MConst.blockDurationRange = [1100, 1300];
MConst.blockAddSpeed = 20; MConst.blockAddSpeed = 20;
MConst.blockEnterTimer = 0.2; MConst.blockEnterTimer = 0.2;
MConst.options = { MConst.options = {
...@@ -5144,9 +5161,45 @@ exports.default = GameMgr; ...@@ -5144,9 +5161,45 @@ exports.default = GameMgr;
"use strict"; "use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
var DataMgr_1 = __webpack_require__(/*! ./DataMgr */ "./src/Mgr/DataMgr.ts"); var DataMgr_1 = __webpack_require__(/*! ./DataMgr */ "./src/Mgr/DataMgr.ts");
var GuideMask_1 = __webpack_require__(/*! ../game/GuideMask */ "./src/game/GuideMask.ts"); var GuideMask_1 = __webpack_require__(/*! ../game/GuideMask */ "./src/game/GuideMask.ts");
var StackHighMain_1 = __webpack_require__(/*! ../StackHighMain */ "./src/StackHighMain.ts");
var GuideMgr = (function () { var GuideMgr = (function () {
function GuideMgr() { function GuideMgr() {
this.currentGuideMask = null; this.currentGuideMask = null;
...@@ -5189,11 +5242,15 @@ var GuideMgr = (function () { ...@@ -5189,11 +5242,15 @@ var GuideMgr = (function () {
configurable: true configurable: true
}); });
GuideMgr.prototype.drawFirstGuide = function (isEnd) { GuideMgr.prototype.drawFirstGuide = function (isEnd) {
var _this = this;
if (isEnd === void 0) { isEnd = false; } if (isEnd === void 0) { isEnd = false; }
return __awaiter(this, void 0, void 0, function () {
var _this = this;
return __generator(this, function (_a) {
DataMgr_1.DataMgr.game.pause = true; DataMgr_1.DataMgr.game.pause = true;
this.currentGuideMask = new GuideMask_1.default(); this.currentGuideMask = new GuideMask_1.default();
this.currentGuideMask.onClick = function (context) { this.currentGuideMask.onClick = function (context) {
StackHighMain_1.GDispatcher.dispatchEvent("new-guide");
console.log("888");
context.dispose(); context.dispose();
_this.currentGuideMask = null; _this.currentGuideMask = null;
DataMgr_1.DataMgr.game.pause = false; DataMgr_1.DataMgr.game.pause = false;
...@@ -5204,6 +5261,9 @@ var GuideMgr = (function () { ...@@ -5204,6 +5261,9 @@ var GuideMgr = (function () {
}; };
this._container.addChild(this.currentGuideMask); this._container.addChild(this.currentGuideMask);
this.currentGuideMask.drawFirst(); this.currentGuideMask.drawFirst();
return [2];
});
});
}; };
GuideMgr._instance = null; GuideMgr._instance = null;
return GuideMgr; return GuideMgr;
...@@ -5398,7 +5458,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); ...@@ -5398,7 +5458,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.ResJson = { exports.ResJson = {
"groups": [ "groups": [
{ {
"keys": "cat_drop.svga,cat_getfish.svga,cat_jumpstart.svga,cat_over.svga,cat_setup.svga,cat_sky.svga,cat_spake.svga,high_bg.svga,high_ready.svga,high_timer_1.svga,high_timer_2.svga,high_timer_3.svga", "keys": "cat_drop.svga,cat_getfish.svga,cat_jiazi.svga,cat_jumpstart.svga,cat_over.svga,cat_setup.svga,cat_sky.svga,cat_spake.svga,high_bg.svga",
"name": "catHighSvga" "name": "catHighSvga"
}, },
{ {
...@@ -5574,23 +5634,23 @@ exports.ResJson = { ...@@ -5574,23 +5634,23 @@ exports.ResJson = {
} }
}, },
{ {
"keys": "cat_house.png,cat_jiazi.png,cat_shadow.png,fish.png,high_bg.jpg,high_cat_common.png,high_down.png,high_fish.png,high_global_scor.png,high_ground.png,high_hetun.png,high_pointer.png,high_ready.png,high_score_0.png,high_score_1.png,high_score_2.png,high_score_3.png,high_score_4.png,high_score_5.png,high_score_6.png,high_score_7.png,high_score_8.png,high_score_9.png,high_start.png,high_timer_1.png,high_timer_2.png,high_timer_3.png,high_tv.png,high_yaohaung.png,timerCountBg.png", "keys": "cat_house.png,cat_jiazi.png,cat_shadow.png,fish.png,high_bg.jpg,high_cat_common.png,high_clock.png,high_down.png,high_fish.png,high_global_score.png,high_ground.png,high_hetun.png,high_pointer.png,high_ready.png,high_scorebg.png,high_score_0.png,high_score_1.png,high_score_2.png,high_score_3.png,high_score_4.png,high_score_5.png,high_score_6.png,high_score_7.png,high_score_8.png,high_score_9.png,high_start.png,high_timer_1.png,high_timer_2.png,high_timer_3.png,high_tv.png,high_yaohaung.png,score_high_0.png,score_high_1.png,score_high_2.png,score_high_3.png,score_high_4.png,score_high_5.png,score_high_6.png,score_high_7.png,score_high_8.png,score_high_9.png,timerCountBg.png",
"name": "stackHigh", "name": "stackHigh",
"atlas": { "atlas": {
"cat_house.png": { "cat_house.png": {
"x": 432, "x": 432,
"y": 1320, "y": 1502,
"w": 205, "w": 205,
"h": 171, "h": 171,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 205, "sw": 205,
"sh": 171, "sh": 171,
"ro": true "ro": false
}, },
"cat_jiazi.png": { "cat_jiazi.png": {
"x": 2, "x": 432,
"y": 3572, "y": 1283,
"w": 207, "w": 207,
"h": 217, "h": 217,
"ox": 0, "ox": 0,
...@@ -5600,19 +5660,19 @@ exports.ResJson = { ...@@ -5600,19 +5660,19 @@ exports.ResJson = {
"ro": false "ro": false
}, },
"cat_shadow.png": { "cat_shadow.png": {
"x": 992, "x": 916,
"y": 292, "y": 1981,
"w": 96, "w": 96,
"h": 30, "h": 30,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 96, "sw": 96,
"sh": 30, "sh": 30,
"ro": true "ro": false
}, },
"fish.png": { "fish.png": {
"x": 982, "x": 897,
"y": 942, "y": 1553,
"w": 36, "w": 36,
"h": 107, "h": 107,
"ox": 0, "ox": 0,
...@@ -5622,52 +5682,63 @@ exports.ResJson = { ...@@ -5622,52 +5682,63 @@ exports.ResJson = {
"ro": false "ro": false
}, },
"high_cat_common.png": { "high_cat_common.png": {
"x": 754, "x": 432,
"y": 1045, "y": 1908,
"w": 166, "w": 166,
"h": 226, "h": 226,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 166, "sw": 166,
"sh": 226, "sh": 226,
"ro": false
},
"high_clock.png": {
"x": 816,
"y": 2199,
"w": 134,
"h": 145,
"ox": 0,
"oy": 0,
"sw": 134,
"sh": 145,
"ro": true "ro": true
}, },
"high_down.png": { "high_down.png": {
"x": 754, "x": 611,
"y": 292, "y": 1743,
"w": 236, "w": 236,
"h": 404, "h": 404,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 236, "sw": 236,
"sh": 404, "sh": 404,
"ro": false "ro": true
}, },
"high_fish.png": { "high_fish.png": {
"x": 432, "x": 600,
"y": 1527, "y": 2199,
"w": 160, "w": 160,
"h": 214, "h": 214,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 160, "sw": 160,
"sh": 214, "sh": 214,
"ro": false "ro": true
}, },
"high_global_scor.png": { "high_global_score.png": {
"x": 754, "x": 958,
"y": 162, "y": 136,
"w": 254, "w": 254,
"h": 58, "h": 58,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 254, "sw": 254,
"sh": 58, "sh": 58,
"ro": false "ro": true
}, },
"high_ground.png": { "high_ground.png": {
"x": 2, "x": 2,
"y": 1320, "y": 1283,
"w": 2250, "w": 2250,
"h": 428, "h": 428,
"ox": 0, "ox": 0,
...@@ -5677,8 +5748,8 @@ exports.ResJson = { ...@@ -5677,8 +5748,8 @@ exports.ResJson = {
"ro": true "ro": true
}, },
"high_hetun.png": { "high_hetun.png": {
"x": 754, "x": 639,
"y": 2, "y": 1553,
"w": 256, "w": 256,
"h": 158, "h": 158,
"ox": 0, "ox": 0,
...@@ -5688,8 +5759,8 @@ exports.ResJson = { ...@@ -5688,8 +5759,8 @@ exports.ResJson = {
"ro": false "ro": false
}, },
"high_pointer.png": { "high_pointer.png": {
"x": 432, "x": 816,
"y": 1743, "y": 2335,
"w": 140, "w": 140,
"h": 134, "h": 134,
"ox": 0, "ox": 0,
...@@ -5700,84 +5771,84 @@ exports.ResJson = { ...@@ -5700,84 +5771,84 @@ exports.ResJson = {
}, },
"high_ready.png": { "high_ready.png": {
"x": 2, "x": 2,
"y": 1140, "y": 1137,
"w": 621, "w": 640,
"h": 178, "h": 144,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 621, "sw": 640,
"sh": 178, "sh": 144,
"ro": false "ro": false
}, },
"high_score_0.png": { "high_score_0.png": {
"x": 805, "x": 958,
"y": 1213, "y": 794,
"w": 44, "w": 44,
"h": 65, "h": 65,
"ox": 4, "ox": 4,
"oy": 1, "oy": 1,
"sw": 50, "sw": 50,
"sh": 67, "sh": 67,
"ro": true "ro": false
}, },
"high_score_1.png": { "high_score_1.png": {
"x": 982, "x": 958,
"y": 877, "y": 96,
"w": 38, "w": 38,
"h": 63, "h": 63,
"ox": 8, "ox": 8,
"oy": 2, "oy": 2,
"sw": 50, "sw": 50,
"sh": 67, "sh": 67,
"ro": false "ro": true
}, },
"high_score_2.png": { "high_score_2.png": {
"x": 738, "x": 958,
"y": 1213, "y": 727,
"w": 44, "w": 44,
"h": 65, "h": 65,
"ox": 4, "ox": 4,
"oy": 0, "oy": 0,
"sw": 50, "sw": 50,
"sh": 67, "sh": 67,
"ro": true "ro": false
}, },
"high_score_3.png": { "high_score_3.png": {
"x": 625, "x": 958,
"y": 1278, "y": 660,
"w": 44, "w": 44,
"h": 65, "h": 65,
"ox": 3, "ox": 3,
"oy": 1, "oy": 1,
"sw": 50, "sw": 50,
"sh": 67, "sh": 67,
"ro": true "ro": false
}, },
"high_score_4.png": { "high_score_4.png": {
"x": 692, "x": 958,
"y": 1140, "y": 2,
"w": 46, "w": 46,
"h": 63, "h": 63,
"ox": 3, "ox": 3,
"oy": 2, "oy": 2,
"sw": 50, "sw": 50,
"sh": 67, "sh": 67,
"ro": false "ro": true
}, },
"high_score_5.png": { "high_score_5.png": {
"x": 625, "x": 958,
"y": 1232, "y": 593,
"w": 44, "w": 44,
"h": 65, "h": 65,
"ox": 3, "ox": 3,
"oy": 1, "oy": 1,
"sw": 50, "sw": 50,
"sh": 67, "sh": 67,
"ro": true "ro": false
}, },
"high_score_6.png": { "high_score_6.png": {
"x": 692, "x": 958,
"y": 1205, "y": 526,
"w": 44, "w": 44,
"h": 65, "h": 65,
"ox": 4, "ox": 4,
...@@ -5787,8 +5858,8 @@ exports.ResJson = { ...@@ -5787,8 +5858,8 @@ exports.ResJson = {
"ro": false "ro": false
}, },
"high_score_7.png": { "high_score_7.png": {
"x": 872, "x": 958,
"y": 1213, "y": 50,
"w": 44, "w": 44,
"h": 63, "h": 63,
"ox": 4, "ox": 4,
...@@ -5798,108 +5869,229 @@ exports.ResJson = { ...@@ -5798,108 +5869,229 @@ exports.ResJson = {
"ro": true "ro": true
}, },
"high_score_8.png": { "high_score_8.png": {
"x": 625, "x": 958,
"y": 1186, "y": 459,
"w": 44, "w": 44,
"h": 65, "h": 65,
"ox": 4, "ox": 4,
"oy": 1, "oy": 1,
"sw": 50, "sw": 50,
"sh": 67, "sh": 67,
"ro": true "ro": false
}, },
"high_score_9.png": { "high_score_9.png": {
"x": 625, "x": 958,
"y": 1140, "y": 392,
"w": 44, "w": 44,
"h": 65, "h": 65,
"ox": 3, "ox": 3,
"oy": 1, "oy": 1,
"sw": 50, "sw": 50,
"sh": 67, "sh": 67,
"ro": true "ro": false
},
"high_scorebg.png": {
"x": 897,
"y": 1702,
"w": 118,
"h": 39,
"ox": 0,
"oy": 0,
"sw": 118,
"sh": 39,
"ro": false
}, },
"high_start.png": { "high_start.png": {
"x": 754, "x": 949,
"y": 222, "y": 1448,
"w": 252, "w": 252,
"h": 68, "h": 68,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 252, "sw": 252,
"sh": 68, "sh": 68,
"ro": false "ro": true
}, },
"high_timer_1.png": { "high_timer_1.png": {
"x": 692, "x": 641,
"y": 1272, "y": 1353,
"w": 198, "w": 198,
"h": 305, "h": 306,
"ox": 0, "ox": 73,
"oy": 0, "oy": 12,
"sw": 198, "sw": 330,
"sh": 305, "sh": 330,
"ro": true "ro": true
}, },
"high_timer_2.png": { "high_timer_2.png": {
"x": 594, "x": 644,
"y": 1680, "y": 1137,
"w": 205, "w": 214,
"h": 294, "h": 310,
"ox": 0, "ox": 61,
"oy": 0, "oy": 8,
"sw": 205, "sw": 330,
"sh": 294, "sh": 330,
"ro": true "ro": true
}, },
"high_timer_3.png": { "high_timer_3.png": {
"x": 605, "x": 600,
"y": 1472, "y": 1981,
"w": 206, "w": 216,
"h": 295, "h": 314,
"ox": 0, "ox": 57,
"oy": 0, "oy": 8,
"sw": 206, "sw": 330,
"sh": 295, "sh": 330,
"ro": true "ro": true
}, },
"high_tv.png": { "high_tv.png": {
"x": 754, "x": 432,
"y": 877, "y": 2136,
"w": 226, "w": 226,
"h": 166, "h": 166,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 226, "sw": 226,
"sh": 166, "sh": 166,
"ro": false "ro": true
}, },
"high_yaohaung.png": { "high_yaohaung.png": {
"x": 754, "x": 432,
"y": 698, "y": 1675,
"w": 177, "w": 177,
"h": 231, "h": 231,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 177, "sw": 177,
"sh": 231, "sh": 231,
"ro": false
},
"score_high_0.png": {
"x": 949,
"y": 1404,
"w": 42,
"h": 69,
"ox": 0,
"oy": 2,
"sw": 42,
"sh": 73,
"ro": true
},
"score_high_1.png": {
"x": 1002,
"y": 861,
"w": 20,
"h": 69,
"ox": 11,
"oy": 2,
"sw": 42,
"sh": 73,
"ro": false
},
"score_high_2.png": {
"x": 949,
"y": 1360,
"w": 42,
"h": 69,
"ox": 0,
"oy": 2,
"sw": 42,
"sh": 73,
"ro": true "ro": true
}, },
"score_high_3.png": {
"x": 956,
"y": 1289,
"w": 42,
"h": 69,
"ox": 0,
"oy": 2,
"sw": 42,
"sh": 73,
"ro": false
},
"score_high_4.png": {
"x": 956,
"y": 1218,
"w": 42,
"h": 69,
"ox": 0,
"oy": 2,
"sw": 42,
"sh": 73,
"ro": false
},
"score_high_5.png": {
"x": 958,
"y": 861,
"w": 42,
"h": 71,
"ox": 0,
"oy": 0,
"sw": 42,
"sh": 73,
"ro": false
},
"score_high_6.png": {
"x": 956,
"y": 1147,
"w": 42,
"h": 69,
"ox": 0,
"oy": 2,
"sw": 42,
"sh": 73,
"ro": false
},
"score_high_7.png": {
"x": 958,
"y": 1076,
"w": 42,
"h": 69,
"ox": 0,
"oy": 2,
"sw": 42,
"sh": 73,
"ro": false
},
"score_high_8.png": {
"x": 958,
"y": 1005,
"w": 42,
"h": 69,
"ox": 0,
"oy": 2,
"sw": 42,
"sh": 73,
"ro": false
},
"score_high_9.png": {
"x": 958,
"y": 934,
"w": 42,
"h": 69,
"ox": 0,
"oy": 2,
"sw": 42,
"sh": 73,
"ro": false
},
"timerCountBg.png": { "timerCountBg.png": {
"x": 2, "x": 2,
"y": 2, "y": 2,
"w": 750, "w": 1133,
"h": 1136, "h": 954,
"ox": 0, "ox": 0,
"oy": 0, "oy": 409,
"sw": 750, "sw": 1133,
"sh": 1136, "sh": 1624,
"ro": false "ro": true
} }
} }
} }
], ],
"path": "https://yun.duiba.com.cn/db_games/activity/kickball-feile/1601605439/resource/" "path": "https://yun.duiba.com.cn/db_games/activity/kickball-feile/1603867579/resource/"
}; };
...@@ -6612,11 +6804,22 @@ var Block = (function (_super) { ...@@ -6612,11 +6804,22 @@ var Block = (function (_super) {
this.currentScore = id + 1; this.currentScore = id + 1;
this.dir = Math.random() > 0.5 ? 1 : -1; this.dir = Math.random() > 0.5 ? 1 : -1;
this.blockName = MConst_1.MConst.blockName[id]; this.blockName = MConst_1.MConst.blockName[id];
if (id == 1) {
this.blockBitmap.visible = false;
var blockSvga = new FYGE.MovieClip(RES_1.RES.getRes("cat_jiazi.svga"));
this.addChild(blockSvga);
blockSvga.anchorX = blockSvga.videoWidth / 2;
blockSvga.anchorY = blockSvga.videoHeight / 2;
blockSvga.startAniRange(0, blockSvga.totalFrames, 0, function () { });
}
else {
this.blockBitmap.visible = true;
this.blockBitmap.texture = RES_1.RES.getRes(blockPng[this.blockName]); this.blockBitmap.texture = RES_1.RES.getRes(blockPng[this.blockName]);
console.log(this.blockName); }
}; };
Block.prototype.onMove = function (index) { Block.prototype.onMove = function (index, lastBlockName) {
var _this = this; var _this = this;
var self = this;
this.visible = true; this.visible = true;
this.x = this.x =
this.dir > 0 this.dir > 0
...@@ -6636,10 +6839,14 @@ var Block = (function (_super) { ...@@ -6636,10 +6839,14 @@ var Block = (function (_super) {
MConst_1.MConst.blockEnterTimer * MConst_1.MConst.blockEnterTimer *
(Math.random() > 0.5 ? 1 : -1); (Math.random() > 0.5 ? 1 : -1);
console.log("时间++", duration); console.log("时间++", duration);
if (lastBlockName == "") {
duration = 1500;
}
var globalX = 750 / 2 - this.blockBitmap.width / 2; var globalX = 750 / 2 - this.blockBitmap.width / 2;
console.log("目标位置++", this.dir, globalX, 750); console.log("目标位置++", this.dir, globalX, 750);
return new Promise(function (resolve) { return new Promise(function (resolve) {
FYGE.Tween.get(_this).to({ x: globalX }, duration).call(resolve); FYGE.Tween.get(_this).to({ x: globalX }, duration).call(function () {
}).call(resolve);
}); });
}; };
Block.prototype.onMoveStop = function () { Block.prototype.onMoveStop = function () {
...@@ -6742,7 +6949,7 @@ var Cat = (function (_super) { ...@@ -6742,7 +6949,7 @@ var Cat = (function (_super) {
} }
Cat.prototype.init = function (_a) { Cat.prototype.init = function (_a) {
var initY = _a.initY; var initY = _a.initY;
this.initY = initY - 270 + 10; this.initY = initY - 270;
this.y = this.initY; this.y = this.initY;
this.jumping = false; this.jumping = false;
}; };
...@@ -6803,7 +7010,7 @@ var Cat = (function (_super) { ...@@ -6803,7 +7010,7 @@ var Cat = (function (_super) {
var _this = this; var _this = this;
if (this.catStatus == v) if (this.catStatus == v)
return; return;
if (v != CatStatus.SETUP && this.catStatus == CatStatus.GETFISH) if (v != CatStatus.SETUP && this.catStatus == CatStatus.GETFISH && v != CatStatus.OVER && v != CatStatus.HITAWAY)
return; return;
this._catStatus = v; this._catStatus = v;
this.catSvaga && this.SVGAContainer.removeChildren(this.catSvaga); this.catSvaga && this.SVGAContainer.removeChildren(this.catSvaga);
...@@ -7205,7 +7412,7 @@ var GuideMask = (function (_super) { ...@@ -7205,7 +7412,7 @@ var GuideMask = (function (_super) {
var pointer = new FYGE.Sprite(RES_1.RES.getRes("high_pointer.png")); var pointer = new FYGE.Sprite(RES_1.RES.getRes("high_pointer.png"));
this.addChild(pointer); this.addChild(pointer);
pointer.position.set(500, 888); pointer.position.set(500, 888);
var descText = Tools_1.Tool.getText("看准时机,在物体飞进来的瞬间踩住\n跳到更高的地方", 30, "#ffffff", FYGE.TEXT_ALIGN.CENTER, 550); var descText = Tools_1.Tool.getText("帮助猫咪跳到最高处\n它才能抓住小鱼干哦~", 30, "#ffffff", FYGE.TEXT_ALIGN.CENTER, 550);
this.addChild(descText); this.addChild(descText);
descText.position.set(96, 794); descText.position.set(96, 794);
var pointer = new FYGE.Sprite(RES_1.RES.getRes("high_start.png")); var pointer = new FYGE.Sprite(RES_1.RES.getRes("high_start.png"));
...@@ -7668,6 +7875,7 @@ var StackHigh = (function (_super) { ...@@ -7668,6 +7875,7 @@ var StackHigh = (function (_super) {
_this._pause = false; _this._pause = false;
_this._topY = _this.baseOffsetY; _this._topY = _this.baseOffsetY;
_this._posH = 0; _this._posH = 0;
_this.lastBlockName = "";
_this.timer = MConst_1.MConst.options.tickSeconds * 1000; _this.timer = MConst_1.MConst.options.tickSeconds * 1000;
_this.baseOffsetY = 1624 - MConst_1.MConst.baseTrueH + 20; _this.baseOffsetY = 1624 - MConst_1.MConst.baseTrueH + 20;
_this.topY = _this.baseOffsetY; _this.topY = _this.baseOffsetY;
...@@ -7691,11 +7899,11 @@ var StackHigh = (function (_super) { ...@@ -7691,11 +7899,11 @@ var StackHigh = (function (_super) {
_this.backGround = backGround; _this.backGround = backGround;
var bgSVGA = new FYGE.MovieClip(RES_1.RES.getRes("high_bg.svga")); var bgSVGA = new FYGE.MovieClip(RES_1.RES.getRes("high_bg.svga"));
_this.node.addChild(bgSVGA); _this.node.addChild(bgSVGA);
bgSVGA.startAniRange(0, bgSVGA.totalFrames, -1); bgSVGA.startAniRange(0, bgSVGA.totalFrames, 0);
var gameContainer = new FYGE.Container(); var gameContainer = new FYGE.Container();
gameContainer.width = 750; gameContainer.width = 750;
gameContainer.height = 1624; gameContainer.height = 1624;
gameContainer.anchorX = layers_1.layers.width / 2; gameContainer.anchorX = 750 / 2;
gameContainer.anchorY = layers_1.layers.height; gameContainer.anchorY = layers_1.layers.height;
_this.node.addChild(gameContainer); _this.node.addChild(gameContainer);
_this.gameContainer = gameContainer; _this.gameContainer = gameContainer;
...@@ -7712,21 +7920,21 @@ var StackHigh = (function (_super) { ...@@ -7712,21 +7920,21 @@ var StackHigh = (function (_super) {
_this.cat = new Cat_1.Cat(); _this.cat = new Cat_1.Cat();
gameContainer.addChild(_this.cat); gameContainer.addChild(_this.cat);
console.log(_this.cat.x); console.log(_this.cat.x);
_this.cat.init({ initY: _this.baseOffsetY }); _this.cat.init({ initY: _this.baseOffsetY + 20 });
catShadow.y = 250 + _this.cat.y - 20; catShadow.y = 250 + _this.cat.y - 20;
_this.blockContainer = new FYGE.Container(); _this.blockContainer = new FYGE.Container();
gameContainer.addChild(_this.blockContainer); gameContainer.addChild(_this.blockContainer);
var textures = {}; var textures = {};
for (var i = 0; i < 10; i++) for (var i = 0; i < 10; i++)
textures[i] = RES_1.RES.getRes("high_score_" + i + ".png"); textures[i] = RES_1.RES.getRes("high_score_" + i + ".png");
var globalScore = new FYGE.Sprite(RES_1.RES.getRes("high_global_scor.png")); var globalScore = new FYGE.Sprite(RES_1.RES.getRes("high_global_score.png"));
_this.node.addChild(globalScore); _this.node.addChild(globalScore);
globalScore.y = 206; globalScore.y = 206;
globalScore.x = 180; globalScore.x = 130;
var topScore = new FYGE.BitmapText(textures); var topScore = new FYGE.BitmapText(textures);
topScore.textAlign = FYGE.TEXT_ALIGN.CENTER; topScore.textAlign = FYGE.TEXT_ALIGN.CENTER;
topScore.y = 206; topScore.y = 206;
topScore.x = 526; topScore.x = 476;
topScore.text = "" + MConst_1.MConst.options.targetScore; topScore.text = "" + MConst_1.MConst.options.targetScore;
topScore.scaleX = 0.8; topScore.scaleX = 0.8;
topScore.scaleY = 0.8; topScore.scaleY = 0.8;
...@@ -7737,12 +7945,34 @@ var StackHigh = (function (_super) { ...@@ -7737,12 +7945,34 @@ var StackHigh = (function (_super) {
var catScore = new FYGE.BitmapText(textures); var catScore = new FYGE.BitmapText(textures);
catScore.textAlign = FYGE.TEXT_ALIGN.CENTER; catScore.textAlign = FYGE.TEXT_ALIGN.CENTER;
catScore.y = 304; catScore.y = 304;
catScore.x = 375; catScore.x = 325;
_this.catScoreLabel = catScore; _this.catScoreLabel = catScore;
_this.catScoreLabel.text = "0"; _this.catScoreLabel.text = "0";
_this.node.addChild(_this.catScoreLabel); _this.node.addChild(_this.catScoreLabel);
_this.node.mouseChildren = true; _this.node.mouseChildren = true;
_this.node.mouseEnable = true; _this.node.mouseEnable = true;
var cdCountTitleBg = new FYGE.Sprite(RES_1.RES.getRes("high_scorebg.png"));
_this.node.addChild(cdCountTitleBg);
cdCountTitleBg.position.set(584, 206);
var cdCountText = Tools_1.Tool.getText("倒计时", 26, "#ffffff", FYGE.TEXT_ALIGN.CENTER, 130);
cdCountText.position.set(580, 213);
_this.node.addChild(cdCountText);
var cdCountBg = new FYGE.Sprite(RES_1.RES.getRes("high_clock.png"));
_this.node.addChild(cdCountBg);
cdCountBg.position.set(580, 244);
var secondText = Tools_1.Tool.getText("秒", 34, "#ffffff", FYGE.TEXT_ALIGN.CENTER, 40);
secondText.position.set(700, 314);
_this.node.addChild(secondText);
var textures1 = {};
for (var i = 0; i < 10; i++)
textures1[i] = RES_1.RES.getRes("score_high_" + i + ".png");
var timeLabel = new FYGE.BitmapText(textures1);
timeLabel.textAlign = FYGE.TEXT_ALIGN.CENTER;
timeLabel.y = 280;
timeLabel.x = 646;
_this.timeLabel = timeLabel;
_this.timeLabel.text = Math.ceil(_this.timer / 1000) + "";
_this.node.addChild(_this.timeLabel);
_this.node.addEventListener(FYGE.MouseEvent.MOUSE_DOWN, _this.onTabScenes, _this); _this.node.addEventListener(FYGE.MouseEvent.MOUSE_DOWN, _this.onTabScenes, _this);
MTimer_1.default.onFrame("Game", _this.onEnterFrame, _this); MTimer_1.default.onFrame("Game", _this.onEnterFrame, _this);
_this.playZoom("in"); _this.playZoom("in");
...@@ -7756,7 +7986,7 @@ var StackHigh = (function (_super) { ...@@ -7756,7 +7986,7 @@ var StackHigh = (function (_super) {
set: function (v) { set: function (v) {
this._score = v; this._score = v;
this.catScoreLabel.text = this._score + ""; this.catScoreLabel.text = this._score + "";
if (this._score > MConst_1.MConst.options.targetScore - 95) { if (this._score >= MConst_1.MConst.options.targetScore) {
this.createFish(); this.createFish();
} }
}, },
...@@ -7801,6 +8031,8 @@ var StackHigh = (function (_super) { ...@@ -7801,6 +8031,8 @@ var StackHigh = (function (_super) {
configurable: true configurable: true
}); });
StackHigh.prototype.downTimer = function () { StackHigh.prototype.downTimer = function () {
if (this.pause)
return;
if (this.timing) { if (this.timing) {
if (this.timer > 0) { if (this.timer > 0) {
if (MTimer_1.default.deltaTime > 0) { if (MTimer_1.default.deltaTime > 0) {
...@@ -7814,22 +8046,19 @@ var StackHigh = (function (_super) { ...@@ -7814,22 +8046,19 @@ var StackHigh = (function (_super) {
this.isAppearBlock = false; this.isAppearBlock = false;
this.gameOver(); this.gameOver();
} }
var temp = Math.ceil(this.timer / 1000);
this.timeLabel.text = temp + "";
} }
}; };
StackHigh.prototype.gameDead = function () { StackHigh.prototype.gameDead = function () {
StackHighMain_1.GDispatcher.dispatchEvent("game-destroy"); StackHighMain_1.GDispatcher.dispatchEvent("game-destroy");
}; };
StackHigh.prototype.timerOver = function () { StackHigh.prototype.timerOver = function () {
console.log("是否新手引导++++", GuideMgr_1.default.instance.guideFlag); console.log("是否新手引导++++", MConst_1.MConst.options.scheduleFinished);
if (GuideMgr_1.default.instance.guideFlag == true && MConst_1.MConst.options.scheduleFinished == 1) {
GuideMgr_1.default.instance.drawFirstGuide(true);
}
else {
this.createBlock(); this.createBlock();
}
}; };
StackHigh.prototype.newGuideOver = function () { StackHigh.prototype.newGuideOver = function () {
this.createBlock(); TimerCountMgr_1.default.instance.drawTimerCount();
}; };
StackHigh.prototype.createBlock = function () { StackHigh.prototype.createBlock = function () {
if (!this.isAppearBlock) if (!this.isAppearBlock)
...@@ -7841,11 +8070,22 @@ var StackHigh = (function (_super) { ...@@ -7841,11 +8070,22 @@ var StackHigh = (function (_super) {
}); });
this.blockContainer.addChild(block); this.blockContainer.addChild(block);
console.log("222", this.baseOffsetY, MConst_1.MConst.blockName.length, block.height, this.cat.y); console.log("222", this.baseOffsetY, MConst_1.MConst.blockName.length, block.height, this.cat.y);
if (this.lastBlockName == "catHetun" && block.blockName == "catTV") {
block.y = this.topY - block.height + 30;
}
else {
if (block.blockName == "catJiazi") {
block.y = this.topY - 217;
}
else {
block.y = this.topY - block.height; block.y = this.topY - block.height;
}
}
this.topY = block.y; this.topY = block.y;
block.onMove(this.blockIndex); block.onMove(this.blockIndex, this.lastBlockName);
this.needHitTest = true; this.needHitTest = true;
this.currentBlock = block; this.currentBlock = block;
this.lastBlockName = block.blockName;
}; };
StackHigh.prototype.createFish = function () { StackHigh.prototype.createFish = function () {
if (this.lineFish) if (this.lineFish)
...@@ -7882,6 +8122,7 @@ var StackHigh = (function (_super) { ...@@ -7882,6 +8122,7 @@ var StackHigh = (function (_super) {
.to({ posH: _this.posH + _this.currentBlock.height }, 300, FYGE.Ease.cubicOut) .to({ posH: _this.posH + _this.currentBlock.height }, 300, FYGE.Ease.cubicOut)
.call(function () { .call(function () {
resolve(); resolve();
if (!self.pause)
_this.score += _this.currentBlock.currentScore; _this.score += _this.currentBlock.currentScore;
_this.createBlock(); _this.createBlock();
_this._touchdown = true; _this._touchdown = true;
...@@ -7909,9 +8150,9 @@ var StackHigh = (function (_super) { ...@@ -7909,9 +8150,9 @@ var StackHigh = (function (_super) {
var blockHitHeight = this.currentBlock.height; var blockHitHeight = this.currentBlock.height;
var blockHitWidth = this.currentBlock.width; var blockHitWidth = this.currentBlock.width;
var hitOn = false; var hitOn = false;
if (Math.abs(px - bx) < (blockHitWidth + this.cat.width) / 2) { if (Math.abs(px - bx) < (blockHitWidth + this.cat.width) / 2 - 22) {
this.cat.baseY = by - this.cat.height; this.cat.baseY = by - this.cat.height + 10;
if (py > by - this.cat.height) { if (py > by - this.cat.height + 10) {
hitOn = true; hitOn = true;
} }
} }
...@@ -7935,6 +8176,7 @@ var StackHigh = (function (_super) { ...@@ -7935,6 +8176,7 @@ var StackHigh = (function (_super) {
switch (_a.label) { switch (_a.label) {
case 0: case 0:
console.log("碰撞了"); console.log("碰撞了");
this.catShadow.visible = false;
this.needHitTest = false; this.needHitTest = false;
this._touchdown = false; this._touchdown = false;
this.isAppearBlock = false; this.isAppearBlock = false;
...@@ -7943,7 +8185,7 @@ var StackHigh = (function (_super) { ...@@ -7943,7 +8185,7 @@ var StackHigh = (function (_super) {
_a.sent(); _a.sent();
this.playZoom("out"); this.playZoom("out");
FYGE.Tween.get(this) FYGE.Tween.get(this)
.wait(3000) .wait(2000)
.call(function () { .call(function () {
_this.gameOver(); _this.gameOver();
}); });
...@@ -8017,14 +8259,16 @@ var StackHigh = (function (_super) { ...@@ -8017,14 +8259,16 @@ var StackHigh = (function (_super) {
case 0: case 0:
console.log("游戏结束"); console.log("游戏结束");
this.gamePause(); this.gamePause();
FYGE.Tween.removeAllTweens();
return [4, submitGame_1.default(this.score)]; return [4, submitGame_1.default(this.score)];
case 1: case 1:
result = _a.sent(); result = _a.sent();
if (result.success) { if (result.success) {
if (result.data.pass) { if (!result.data.pass) {
if (result.data.leftTimes > 0) { if (result.data.leftTimes > 0) {
ctrls_1.showPanel(GameFailPanel_1.GameFailPanel, { isAgain: true }); ctrls_1.showPanel(GameFailPanel_1.GameFailPanel, { isAgain: true });
StackHighMain_1.GDispatcher.dispatchEvent("showBuried", { md: 36 }); StackHighMain_1.GDispatcher.dispatchEvent("showBuried", { md: 36 });
StackHighMain_1.GDispatcher.dispatchEvent("showBuried", { md: 51 });
} }
else { else {
ctrls_1.showPanel(GameFailPanel_1.GameFailPanel, { isAgain: false }); ctrls_1.showPanel(GameFailPanel_1.GameFailPanel, { isAgain: false });
...@@ -8046,6 +8290,7 @@ var StackHigh = (function (_super) { ...@@ -8046,6 +8290,7 @@ var StackHigh = (function (_super) {
glodCoin: result.data.goldenCorn, glodCoin: result.data.goldenCorn,
}); });
StackHighMain_1.GDispatcher.dispatchEvent("showBuried", { md: 35 }); StackHighMain_1.GDispatcher.dispatchEvent("showBuried", { md: 35 });
StackHighMain_1.GDispatcher.dispatchEvent("showBuried", { md: 50 });
} }
} }
} }
...@@ -8112,45 +8357,56 @@ var TimerCount = (function (_super) { ...@@ -8112,45 +8357,56 @@ var TimerCount = (function (_super) {
var _this = this; var _this = this;
var allIn = new FYGE.Container(); var allIn = new FYGE.Container();
this.addChild(allIn); this.addChild(allIn);
var readySvga = new FYGE.MovieClip(RES_1.RES.getRes("high_ready.svga"));
allIn.addChild(readySvga);
readySvga.stop();
var time1Svga = new FYGE.MovieClip(RES_1.RES.getRes("high_timer_1.svga"));
allIn.addChild(time1Svga);
time1Svga.stop();
var time2Svga = new FYGE.MovieClip(RES_1.RES.getRes("high_timer_2.svga"));
allIn.addChild(time2Svga);
time2Svga.stop();
var time3Svga = new FYGE.MovieClip(RES_1.RES.getRes("high_timer_3.svga"));
allIn.addChild(time3Svga);
time3Svga.stop();
time1Svga.visible = time2Svga.visible = time3Svga.visible = false;
SoundMgr_1.SoundMgr.instance.playSound("timeCount", false); SoundMgr_1.SoundMgr.instance.playSound("timeCount", false);
readySvga.startAniRange(0, readySvga.totalFrames, 1, function () { var timeBg = new FYGE.Sprite(RES_1.RES.getRes("timerCountBg.png"));
FYGE.Tween.get(_this) timeBg.anchorTexture.set(0.5, 0.5);
.call(function () { timeBg.x = 750 / 2;
time3Svga.visible = true; timeBg.y = 1624 / 2;
time3Svga.startAniRange(0, time3Svga.totalFrames, 1, function () { timeBg.alpha = 1;
time3Svga.visible = false; allIn.addChild(timeBg);
}); var fourImages = [];
}) var fourTextures = [
.wait(1000) "high_ready.png",
.call(function () { "high_timer_3.png",
time2Svga.visible = true; "high_timer_2.png",
time2Svga.startAniRange(0, time2Svga.totalFrames, 1, function () { "high_timer_1.png",
time2Svga.visible = false; ];
}); 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 () { .call(function () {
time1Svga.visible = true; _this.removeChild(allIn);
time1Svga.startAniRange(0, time1Svga.totalFrames, 1, function () {
time1Svga.visible = false;
callback();
FYGE.Tween.removeTweens(self);
});
}); });
}
else {
t_1.set({ alpha: 0 });
}
if (i_1 == 0) {
t_1.call(function () {
timeBg.alpha = 1;
}); });
}
}
}; };
return TimerCount; return TimerCount;
}(FYGE.Container)); }(FYGE.Container));
...@@ -8253,12 +8509,12 @@ var GameFailPanel = (function (_super) { ...@@ -8253,12 +8509,12 @@ var GameFailPanel = (function (_super) {
this.addChild(bg); this.addChild(bg);
exports.centerImage(bg); exports.centerImage(bg);
var isAgain = this.data.isAgain; 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); this.addChild(title);
title.position.set(260, 820); title.position.set(240, 820);
var getPrizeText = Tools_1.Tool.getText("" + (isAgain ? "不如再试一次" : "等等再来玩"), 32, "" + (isAgain ? "#3b8edd" : "#333333"), FYGE.TEXT_ALIGN.CENTER, 230); var getPrizeText = Tools_1.Tool.getText("" + (isAgain ? "那再试一次吧~" : "过会儿再来陪它玩吧~"), 32, "" + (isAgain ? "#3b8edd" : "#333333"), FYGE.TEXT_ALIGN.CENTER, 400);
this.addChild(getPrizeText); this.addChild(getPrizeText);
getPrizeText.position.set(260, 880); getPrizeText.position.set(180, 880);
this.seeCat = new FYGE.Button(RES_1.RES.getRes("high_seecat.png")); this.seeCat = new FYGE.Button(RES_1.RES.getRes("high_seecat.png"));
bg.addChild(this.seeCat); bg.addChild(this.seeCat);
exports.posImage(this.seeCat, 300, 437); exports.posImage(this.seeCat, 300, 437);
...@@ -8283,6 +8539,9 @@ var GameFailPanel = (function (_super) { ...@@ -8283,6 +8539,9 @@ var GameFailPanel = (function (_super) {
}; };
GameFailPanel.prototype.onClickSeeCat = function () { GameFailPanel.prototype.onClickSeeCat = function () {
if (this.againBtn.visible) { if (this.againBtn.visible) {
StackHighMain_1.GDispatcher.dispatchEvent("clickBuried", { md: 51 });
}
else {
StackHighMain_1.GDispatcher.dispatchEvent("clickBuried", { md: 37 }); StackHighMain_1.GDispatcher.dispatchEvent("clickBuried", { md: 37 });
} }
StackHighMain_1.GDispatcher.dispatchEvent("high-see-cat"); StackHighMain_1.GDispatcher.dispatchEvent("high-see-cat");
...@@ -8380,18 +8639,18 @@ var GameSuccessPanel = (function (_super) { ...@@ -8380,18 +8639,18 @@ var GameSuccessPanel = (function (_super) {
this.addChild(bg); this.addChild(bg);
exports.centerImage(bg); exports.centerImage(bg);
var _a = this.data, isAgain = _a.isAgain, glodCoin = _a.glodCoin; 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); this.addChild(title);
title.position.set(270, 800); title.position.set(240, 800);
var getPrizeText = Tools_1.Tool.getText("获得奖励", 28, "#ff6b52", FYGE.TEXT_ALIGN.CENTER, 230); var getPrizeText = Tools_1.Tool.getText("获得奖励", 28, "#ff6b52", FYGE.TEXT_ALIGN.CENTER, 230);
this.addChild(getPrizeText); this.addChild(getPrizeText);
getPrizeText.position.set(270, 860); getPrizeText.position.set(270, 860);
var coin = new FYGE.Sprite(RES_1.RES.getRes("high_coin.png")); var coin = new FYGE.Sprite(RES_1.RES.getRes("high_coin.png"));
this.addChild(coin); this.addChild(coin);
coin.position.set(315, 920); coin.position.set(330, 920);
var coinText = Tools_1.Tool.getText("X" + glodCoin, 26, "#a97a84", FYGE.TEXT_ALIGN.CENTER, 90); var coinText = Tools_1.Tool.getText("X" + glodCoin, 26, "#a97a84", FYGE.TEXT_ALIGN.CENTER, 90);
this.addChild(coinText); this.addChild(coinText);
coinText.position.set(365, 928); coinText.position.set(360, 928);
this.againBtn = new FYGE.Button(RES_1.RES.getRes("high_again.png")); this.againBtn = new FYGE.Button(RES_1.RES.getRes("high_again.png"));
bg.addChild(this.againBtn); bg.addChild(this.againBtn);
exports.posImage(this.againBtn, 300, 500); exports.posImage(this.againBtn, 300, 500);
...@@ -8415,6 +8674,7 @@ var GameSuccessPanel = (function (_super) { ...@@ -8415,6 +8674,7 @@ var GameSuccessPanel = (function (_super) {
}; };
GameSuccessPanel.prototype.onClickAwait = function () { GameSuccessPanel.prototype.onClickAwait = function () {
StackHighMain_1.GDispatcher.dispatchEvent("high-await"); StackHighMain_1.GDispatcher.dispatchEvent("high-await");
StackHighMain_1.GDispatcher.dispatchEvent("clickBuried", { md: 50 });
this.hidePanel(); this.hidePanel();
}; };
GameSuccessPanel.prototype.onClickShare = function () { GameSuccessPanel.prototype.onClickShare = function () {
...@@ -8425,7 +8685,6 @@ var GameSuccessPanel = (function (_super) { ...@@ -8425,7 +8685,6 @@ var GameSuccessPanel = (function (_super) {
StackHighMain_1.GDispatcher.dispatchEvent("clickBuried", { md: 35 }); StackHighMain_1.GDispatcher.dispatchEvent("clickBuried", { md: 35 });
} }
StackHighMain_1.GDispatcher.dispatchEvent("high-share"); StackHighMain_1.GDispatcher.dispatchEvent("high-share");
this.hidePanel();
}; };
GameSuccessPanel.prototype.initEvents = function () { GameSuccessPanel.prototype.initEvents = function () {
_super.prototype.initEvents.call(this); _super.prototype.initEvents.call(this);
...@@ -8489,6 +8748,7 @@ var __extends = (this && this.__extends) || (function () { ...@@ -8489,6 +8748,7 @@ var __extends = (this && this.__extends) || (function () {
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
var Scene_1 = __webpack_require__(/*! ../../module/views/Scene */ "./module/views/Scene.ts"); var Scene_1 = __webpack_require__(/*! ../../module/views/Scene */ "./module/views/Scene.ts");
var MTimer_1 = __webpack_require__(/*! ../Global/MTimer */ "./src/Global/MTimer.ts"); var MTimer_1 = __webpack_require__(/*! ../Global/MTimer */ "./src/Global/MTimer.ts");
var GuideMgr_1 = __webpack_require__(/*! ../Mgr/GuideMgr */ "./src/Mgr/GuideMgr.ts");
var StackHighMain_1 = __webpack_require__(/*! ../StackHighMain */ "./src/StackHighMain.ts"); var StackHighMain_1 = __webpack_require__(/*! ../StackHighMain */ "./src/StackHighMain.ts");
var TimerCountMgr_1 = __webpack_require__(/*! ../Mgr/TimerCountMgr */ "./src/Mgr/TimerCountMgr.ts"); var TimerCountMgr_1 = __webpack_require__(/*! ../Mgr/TimerCountMgr */ "./src/Mgr/TimerCountMgr.ts");
var StackHigh_1 = __webpack_require__(/*! ../game/StackHigh */ "./src/game/StackHigh.ts"); var StackHigh_1 = __webpack_require__(/*! ../game/StackHigh */ "./src/game/StackHigh.ts");
...@@ -8503,7 +8763,7 @@ var GameScenes = (function (_super) { ...@@ -8503,7 +8763,7 @@ var GameScenes = (function (_super) {
} }
Object.defineProperty(GameScenes.prototype, "groupNames", { Object.defineProperty(GameScenes.prototype, "groupNames", {
get: function () { get: function () {
return ["stackHigh", "catHighSvga", "hideAndSeek"]; return ["stackHigh", "catHighSvga"];
}, },
enumerable: true, enumerable: true,
configurable: true configurable: true
...@@ -8526,7 +8786,12 @@ var GameScenes = (function (_super) { ...@@ -8526,7 +8786,12 @@ var GameScenes = (function (_super) {
if (!this.game) { if (!this.game) {
this.game = new StackHigh_1.default(this); this.game = new StackHigh_1.default(this);
} }
if (MConst_1.MConst.options.scheduleFinished == 0) {
GuideMgr_1.default.instance.drawFirstGuide(true);
}
else if (MConst_1.MConst.options.scheduleFinished == 1) {
TimerCountMgr_1.default.instance.drawTimerCount(); TimerCountMgr_1.default.instance.drawTimerCount();
}
var hidden, visibilityChange, self = this; var hidden, visibilityChange, self = this;
if (typeof document.hidden !== "undefined") { if (typeof document.hidden !== "undefined") {
hidden = "hidden"; hidden = "hidden";
......
This source diff could not be displayed because it is too large. You can view the blob instead.
{ {
"groups": [ "groups": [
{ {
"keys": "cat_drop.svga,cat_getfish.svga,cat_jumpstart.svga,cat_over.svga,cat_setup.svga,cat_sky.svga,cat_spake.svga,high_bg.svga,high_ready.svga,high_timer_1.svga,high_timer_2.svga,high_timer_3.svga", "keys": "cat_drop.svga,cat_getfish.svga,cat_jiazi.svga,cat_jumpstart.svga,cat_over.svga,cat_setup.svga,cat_sky.svga,cat_spake.svga,high_bg.svga",
"name": "catHighSvga" "name": "catHighSvga"
}, },
{ {
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
"name": "gameSuccessPanel" "name": "gameSuccessPanel"
}, },
{ {
"keys": "cat_house.png,cat_jiazi.png,cat_shadow.png,fish.png,high_bg.jpg,high_cat_common.png,high_down.png,high_fish.png,high_global_scor.png,high_ground.png,high_hetun.png,high_pointer.png,high_ready.png,high_score_0.png,high_score_1.png,high_score_2.png,high_score_3.png,high_score_4.png,high_score_5.png,high_score_6.png,high_score_7.png,high_score_8.png,high_score_9.png,high_start.png,high_timer_1.png,high_timer_2.png,high_timer_3.png,high_tv.png,high_yaohaung.png,timerCountBg.png", "keys": "cat_house.png,cat_jiazi.png,cat_shadow.png,fish.png,high_bg.jpg,high_cat_common.png,high_clock.png,high_down.png,high_fish.png,high_global_score.png,high_ground.png,high_hetun.png,high_pointer.png,high_ready.png,high_scorebg.png,high_score_0.png,high_score_1.png,high_score_2.png,high_score_3.png,high_score_4.png,high_score_5.png,high_score_6.png,high_score_7.png,high_score_8.png,high_score_9.png,high_start.png,high_timer_1.png,high_timer_2.png,high_timer_3.png,high_tv.png,high_yaohaung.png,score_high_0.png,score_high_1.png,score_high_2.png,score_high_3.png,score_high_4.png,score_high_5.png,score_high_6.png,score_high_7.png,score_high_8.png,score_high_9.png,timerCountBg.png",
"name": "stackHigh" "name": "stackHigh"
} }
], ],
......
resource/stackHigh/high_ready.png

49.1 KB | W: | H:

resource/stackHigh/high_ready.png

42.5 KB | W: | H:

resource/stackHigh/high_ready.png
resource/stackHigh/high_ready.png
resource/stackHigh/high_ready.png
resource/stackHigh/high_ready.png
  • 2-up
  • Swipe
  • Onion skin
resource/stackHigh/high_timer_1.png

9.9 KB | W: | H:

resource/stackHigh/high_timer_1.png

14.3 KB | W: | H:

resource/stackHigh/high_timer_1.png
resource/stackHigh/high_timer_1.png
resource/stackHigh/high_timer_1.png
resource/stackHigh/high_timer_1.png
  • 2-up
  • Swipe
  • Onion skin
resource/stackHigh/high_timer_2.png

21.3 KB | W: | H:

resource/stackHigh/high_timer_2.png

26.2 KB | W: | H:

resource/stackHigh/high_timer_2.png
resource/stackHigh/high_timer_2.png
resource/stackHigh/high_timer_2.png
resource/stackHigh/high_timer_2.png
  • 2-up
  • Swipe
  • Onion skin
resource/stackHigh/high_timer_3.png

27.7 KB | W: | H:

resource/stackHigh/high_timer_3.png

32.6 KB | W: | H:

resource/stackHigh/high_timer_3.png
resource/stackHigh/high_timer_3.png
resource/stackHigh/high_timer_3.png
resource/stackHigh/high_timer_3.png
  • 2-up
  • Swipe
  • Onion skin
resource/stackHigh/timerCountBg.png

454 KB | W: | H:

resource/stackHigh/timerCountBg.png

627 KB | W: | H:

resource/stackHigh/timerCountBg.png
resource/stackHigh/timerCountBg.png
resource/stackHigh/timerCountBg.png
resource/stackHigh/timerCountBg.png
  • 2-up
  • Swipe
  • Onion skin
import { DataMgr } from "./DataMgr"; import { DataMgr } from "./DataMgr";
import { MConfigs } from "../Global/MConfigs"; import { MConfigs } from "../Global/MConfigs";
import GuideMask from "../game/GuideMask"; import GuideMask from "../game/GuideMask";
import { GDispatcher } from "../StackHighMain";
import TimerCountMgr from "./TimerCountMgr";
// import Pot from "../game/Pot"; // import Pot from "../game/Pot";
// import Food from "../game/Food"; // import Food from "../game/Food";
...@@ -44,15 +46,20 @@ export default class GuideMgr { ...@@ -44,15 +46,20 @@ export default class GuideMgr {
private currentGuideMask: GuideMask = null; private currentGuideMask: GuideMask = null;
//first //first
public drawFirstGuide(isEnd: boolean = false) { public async drawFirstGuide(isEnd: boolean = false) {
DataMgr.game.pause = true; DataMgr.game.pause = true;
this.currentGuideMask = new GuideMask(); this.currentGuideMask = new GuideMask();
this.currentGuideMask.onClick = (context) => { this.currentGuideMask.onClick = (context) => {
//新手引导
GDispatcher.dispatchEvent("new-guide");
console.log("888")
//@ts-ignore //@ts-ignore
context.dispose(); context.dispose();
this.currentGuideMask = null; this.currentGuideMask = null;
DataMgr.game.pause = false; DataMgr.game.pause = false;
DataMgr.game.newGuideOver(); DataMgr.game.newGuideOver();
// TimerCountMgr.instance.drawTimerCount();
if (isEnd) { if (isEnd) {
this.guideFlag = false; this.guideFlag = false;
} }
......
export const ResJson = { export const ResJson = {
"groups": [ "groups": [
{ {
"keys": "cat_drop.svga,cat_getfish.svga,cat_jumpstart.svga,cat_over.svga,cat_setup.svga,cat_sky.svga,cat_spake.svga,high_bg.svga,high_ready.svga,high_timer_1.svga,high_timer_2.svga,high_timer_3.svga", "keys": "cat_drop.svga,cat_getfish.svga,cat_jiazi.svga,cat_jumpstart.svga,cat_over.svga,cat_setup.svga,cat_sky.svga,cat_spake.svga,high_bg.svga",
"name": "catHighSvga" "name": "catHighSvga"
}, },
{ {
...@@ -177,23 +177,23 @@ export const ResJson = { ...@@ -177,23 +177,23 @@ export const ResJson = {
} }
}, },
{ {
"keys": "cat_house.png,cat_jiazi.png,cat_shadow.png,fish.png,high_bg.jpg,high_cat_common.png,high_down.png,high_fish.png,high_global_scor.png,high_ground.png,high_hetun.png,high_pointer.png,high_ready.png,high_score_0.png,high_score_1.png,high_score_2.png,high_score_3.png,high_score_4.png,high_score_5.png,high_score_6.png,high_score_7.png,high_score_8.png,high_score_9.png,high_start.png,high_timer_1.png,high_timer_2.png,high_timer_3.png,high_tv.png,high_yaohaung.png,timerCountBg.png", "keys": "cat_house.png,cat_jiazi.png,cat_shadow.png,fish.png,high_bg.jpg,high_cat_common.png,high_clock.png,high_down.png,high_fish.png,high_global_score.png,high_ground.png,high_hetun.png,high_pointer.png,high_ready.png,high_scorebg.png,high_score_0.png,high_score_1.png,high_score_2.png,high_score_3.png,high_score_4.png,high_score_5.png,high_score_6.png,high_score_7.png,high_score_8.png,high_score_9.png,high_start.png,high_timer_1.png,high_timer_2.png,high_timer_3.png,high_tv.png,high_yaohaung.png,score_high_0.png,score_high_1.png,score_high_2.png,score_high_3.png,score_high_4.png,score_high_5.png,score_high_6.png,score_high_7.png,score_high_8.png,score_high_9.png,timerCountBg.png",
"name": "stackHigh", "name": "stackHigh",
"atlas": { "atlas": {
"cat_house.png": { "cat_house.png": {
"x": 432, "x": 432,
"y": 1320, "y": 1502,
"w": 205, "w": 205,
"h": 171, "h": 171,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 205, "sw": 205,
"sh": 171, "sh": 171,
"ro": true "ro": false
}, },
"cat_jiazi.png": { "cat_jiazi.png": {
"x": 2, "x": 432,
"y": 3572, "y": 1283,
"w": 207, "w": 207,
"h": 217, "h": 217,
"ox": 0, "ox": 0,
...@@ -203,19 +203,19 @@ export const ResJson = { ...@@ -203,19 +203,19 @@ export const ResJson = {
"ro": false "ro": false
}, },
"cat_shadow.png": { "cat_shadow.png": {
"x": 992, "x": 916,
"y": 292, "y": 1981,
"w": 96, "w": 96,
"h": 30, "h": 30,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 96, "sw": 96,
"sh": 30, "sh": 30,
"ro": true "ro": false
}, },
"fish.png": { "fish.png": {
"x": 982, "x": 897,
"y": 942, "y": 1553,
"w": 36, "w": 36,
"h": 107, "h": 107,
"ox": 0, "ox": 0,
...@@ -225,52 +225,63 @@ export const ResJson = { ...@@ -225,52 +225,63 @@ export const ResJson = {
"ro": false "ro": false
}, },
"high_cat_common.png": { "high_cat_common.png": {
"x": 754, "x": 432,
"y": 1045, "y": 1908,
"w": 166, "w": 166,
"h": 226, "h": 226,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 166, "sw": 166,
"sh": 226, "sh": 226,
"ro": false
},
"high_clock.png": {
"x": 816,
"y": 2199,
"w": 134,
"h": 145,
"ox": 0,
"oy": 0,
"sw": 134,
"sh": 145,
"ro": true "ro": true
}, },
"high_down.png": { "high_down.png": {
"x": 754, "x": 611,
"y": 292, "y": 1743,
"w": 236, "w": 236,
"h": 404, "h": 404,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 236, "sw": 236,
"sh": 404, "sh": 404,
"ro": false "ro": true
}, },
"high_fish.png": { "high_fish.png": {
"x": 432, "x": 600,
"y": 1527, "y": 2199,
"w": 160, "w": 160,
"h": 214, "h": 214,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 160, "sw": 160,
"sh": 214, "sh": 214,
"ro": false "ro": true
}, },
"high_global_scor.png": { "high_global_score.png": {
"x": 754, "x": 958,
"y": 162, "y": 136,
"w": 254, "w": 254,
"h": 58, "h": 58,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 254, "sw": 254,
"sh": 58, "sh": 58,
"ro": false "ro": true
}, },
"high_ground.png": { "high_ground.png": {
"x": 2, "x": 2,
"y": 1320, "y": 1283,
"w": 2250, "w": 2250,
"h": 428, "h": 428,
"ox": 0, "ox": 0,
...@@ -280,8 +291,8 @@ export const ResJson = { ...@@ -280,8 +291,8 @@ export const ResJson = {
"ro": true "ro": true
}, },
"high_hetun.png": { "high_hetun.png": {
"x": 754, "x": 639,
"y": 2, "y": 1553,
"w": 256, "w": 256,
"h": 158, "h": 158,
"ox": 0, "ox": 0,
...@@ -291,8 +302,8 @@ export const ResJson = { ...@@ -291,8 +302,8 @@ export const ResJson = {
"ro": false "ro": false
}, },
"high_pointer.png": { "high_pointer.png": {
"x": 432, "x": 816,
"y": 1743, "y": 2335,
"w": 140, "w": 140,
"h": 134, "h": 134,
"ox": 0, "ox": 0,
...@@ -303,84 +314,84 @@ export const ResJson = { ...@@ -303,84 +314,84 @@ export const ResJson = {
}, },
"high_ready.png": { "high_ready.png": {
"x": 2, "x": 2,
"y": 1140, "y": 1137,
"w": 621, "w": 640,
"h": 178, "h": 144,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 621, "sw": 640,
"sh": 178, "sh": 144,
"ro": false "ro": false
}, },
"high_score_0.png": { "high_score_0.png": {
"x": 805, "x": 958,
"y": 1213, "y": 794,
"w": 44, "w": 44,
"h": 65, "h": 65,
"ox": 4, "ox": 4,
"oy": 1, "oy": 1,
"sw": 50, "sw": 50,
"sh": 67, "sh": 67,
"ro": true "ro": false
}, },
"high_score_1.png": { "high_score_1.png": {
"x": 982, "x": 958,
"y": 877, "y": 96,
"w": 38, "w": 38,
"h": 63, "h": 63,
"ox": 8, "ox": 8,
"oy": 2, "oy": 2,
"sw": 50, "sw": 50,
"sh": 67, "sh": 67,
"ro": false "ro": true
}, },
"high_score_2.png": { "high_score_2.png": {
"x": 738, "x": 958,
"y": 1213, "y": 727,
"w": 44, "w": 44,
"h": 65, "h": 65,
"ox": 4, "ox": 4,
"oy": 0, "oy": 0,
"sw": 50, "sw": 50,
"sh": 67, "sh": 67,
"ro": true "ro": false
}, },
"high_score_3.png": { "high_score_3.png": {
"x": 625, "x": 958,
"y": 1278, "y": 660,
"w": 44, "w": 44,
"h": 65, "h": 65,
"ox": 3, "ox": 3,
"oy": 1, "oy": 1,
"sw": 50, "sw": 50,
"sh": 67, "sh": 67,
"ro": true "ro": false
}, },
"high_score_4.png": { "high_score_4.png": {
"x": 692, "x": 958,
"y": 1140, "y": 2,
"w": 46, "w": 46,
"h": 63, "h": 63,
"ox": 3, "ox": 3,
"oy": 2, "oy": 2,
"sw": 50, "sw": 50,
"sh": 67, "sh": 67,
"ro": false "ro": true
}, },
"high_score_5.png": { "high_score_5.png": {
"x": 625, "x": 958,
"y": 1232, "y": 593,
"w": 44, "w": 44,
"h": 65, "h": 65,
"ox": 3, "ox": 3,
"oy": 1, "oy": 1,
"sw": 50, "sw": 50,
"sh": 67, "sh": 67,
"ro": true "ro": false
}, },
"high_score_6.png": { "high_score_6.png": {
"x": 692, "x": 958,
"y": 1205, "y": 526,
"w": 44, "w": 44,
"h": 65, "h": 65,
"ox": 4, "ox": 4,
...@@ -390,8 +401,8 @@ export const ResJson = { ...@@ -390,8 +401,8 @@ export const ResJson = {
"ro": false "ro": false
}, },
"high_score_7.png": { "high_score_7.png": {
"x": 872, "x": 958,
"y": 1213, "y": 50,
"w": 44, "w": 44,
"h": 63, "h": 63,
"ox": 4, "ox": 4,
...@@ -401,106 +412,227 @@ export const ResJson = { ...@@ -401,106 +412,227 @@ export const ResJson = {
"ro": true "ro": true
}, },
"high_score_8.png": { "high_score_8.png": {
"x": 625, "x": 958,
"y": 1186, "y": 459,
"w": 44, "w": 44,
"h": 65, "h": 65,
"ox": 4, "ox": 4,
"oy": 1, "oy": 1,
"sw": 50, "sw": 50,
"sh": 67, "sh": 67,
"ro": true "ro": false
}, },
"high_score_9.png": { "high_score_9.png": {
"x": 625, "x": 958,
"y": 1140, "y": 392,
"w": 44, "w": 44,
"h": 65, "h": 65,
"ox": 3, "ox": 3,
"oy": 1, "oy": 1,
"sw": 50, "sw": 50,
"sh": 67, "sh": 67,
"ro": true "ro": false
},
"high_scorebg.png": {
"x": 897,
"y": 1702,
"w": 118,
"h": 39,
"ox": 0,
"oy": 0,
"sw": 118,
"sh": 39,
"ro": false
}, },
"high_start.png": { "high_start.png": {
"x": 754, "x": 949,
"y": 222, "y": 1448,
"w": 252, "w": 252,
"h": 68, "h": 68,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 252, "sw": 252,
"sh": 68, "sh": 68,
"ro": false "ro": true
}, },
"high_timer_1.png": { "high_timer_1.png": {
"x": 692, "x": 641,
"y": 1272, "y": 1353,
"w": 198, "w": 198,
"h": 305, "h": 306,
"ox": 0, "ox": 73,
"oy": 0, "oy": 12,
"sw": 198, "sw": 330,
"sh": 305, "sh": 330,
"ro": true "ro": true
}, },
"high_timer_2.png": { "high_timer_2.png": {
"x": 594, "x": 644,
"y": 1680, "y": 1137,
"w": 205, "w": 214,
"h": 294, "h": 310,
"ox": 0, "ox": 61,
"oy": 0, "oy": 8,
"sw": 205, "sw": 330,
"sh": 294, "sh": 330,
"ro": true "ro": true
}, },
"high_timer_3.png": { "high_timer_3.png": {
"x": 605, "x": 600,
"y": 1472, "y": 1981,
"w": 206, "w": 216,
"h": 295, "h": 314,
"ox": 0, "ox": 57,
"oy": 0, "oy": 8,
"sw": 206, "sw": 330,
"sh": 295, "sh": 330,
"ro": true "ro": true
}, },
"high_tv.png": { "high_tv.png": {
"x": 754, "x": 432,
"y": 877, "y": 2136,
"w": 226, "w": 226,
"h": 166, "h": 166,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 226, "sw": 226,
"sh": 166, "sh": 166,
"ro": false "ro": true
}, },
"high_yaohaung.png": { "high_yaohaung.png": {
"x": 754, "x": 432,
"y": 698, "y": 1675,
"w": 177, "w": 177,
"h": 231, "h": 231,
"ox": 0, "ox": 0,
"oy": 0, "oy": 0,
"sw": 177, "sw": 177,
"sh": 231, "sh": 231,
"ro": false
},
"score_high_0.png": {
"x": 949,
"y": 1404,
"w": 42,
"h": 69,
"ox": 0,
"oy": 2,
"sw": 42,
"sh": 73,
"ro": true "ro": true
}, },
"score_high_1.png": {
"x": 1002,
"y": 861,
"w": 20,
"h": 69,
"ox": 11,
"oy": 2,
"sw": 42,
"sh": 73,
"ro": false
},
"score_high_2.png": {
"x": 949,
"y": 1360,
"w": 42,
"h": 69,
"ox": 0,
"oy": 2,
"sw": 42,
"sh": 73,
"ro": true
},
"score_high_3.png": {
"x": 956,
"y": 1289,
"w": 42,
"h": 69,
"ox": 0,
"oy": 2,
"sw": 42,
"sh": 73,
"ro": false
},
"score_high_4.png": {
"x": 956,
"y": 1218,
"w": 42,
"h": 69,
"ox": 0,
"oy": 2,
"sw": 42,
"sh": 73,
"ro": false
},
"score_high_5.png": {
"x": 958,
"y": 861,
"w": 42,
"h": 71,
"ox": 0,
"oy": 0,
"sw": 42,
"sh": 73,
"ro": false
},
"score_high_6.png": {
"x": 956,
"y": 1147,
"w": 42,
"h": 69,
"ox": 0,
"oy": 2,
"sw": 42,
"sh": 73,
"ro": false
},
"score_high_7.png": {
"x": 958,
"y": 1076,
"w": 42,
"h": 69,
"ox": 0,
"oy": 2,
"sw": 42,
"sh": 73,
"ro": false
},
"score_high_8.png": {
"x": 958,
"y": 1005,
"w": 42,
"h": 69,
"ox": 0,
"oy": 2,
"sw": 42,
"sh": 73,
"ro": false
},
"score_high_9.png": {
"x": 958,
"y": 934,
"w": 42,
"h": 69,
"ox": 0,
"oy": 2,
"sw": 42,
"sh": 73,
"ro": false
},
"timerCountBg.png": { "timerCountBg.png": {
"x": 2, "x": 2,
"y": 2, "y": 2,
"w": 750, "w": 1133,
"h": 1136, "h": 954,
"ox": 0, "ox": 0,
"oy": 0, "oy": 409,
"sw": 750, "sw": 1133,
"sh": 1136, "sh": 1624,
"ro": false "ro": true
} }
} }
} }
], ],
"path": "https://yun.duiba.com.cn/db_games/activity/kickball-feile/1601605439/resource/" "path": "https://yun.duiba.com.cn/db_games/activity/kickball-feile/1603867579/resource/"
} }
\ No newline at end of file
import { RES } from "../../module/RES"; import { RES } from "../../module/RES";
import { layers } from "../../module/views/layers"; import { layers } from "../../module/views/layers";
import { MConst } from "../Global/MConst"; import { MConst } from "../Global/MConst";
import { DataMgr } from "../Mgr/DataMgr";
const blockPng = { const blockPng = {
catHouse: "cat_house.png", catHouse: "cat_house.png",
catJiazi: "cat_jiazi.png", catJiazi: "cat_jiazi.png",
...@@ -10,7 +11,8 @@ const blockPng = { ...@@ -10,7 +11,8 @@ const blockPng = {
export class Block extends FYGE.Container { export class Block extends FYGE.Container {
public dir: -1 | 1; //叠块高度 public dir: -1 | 1; //叠块高度
private blockBitmap: FYGE.Sprite; private blockBitmap: FYGE.Sprite;
private blockName: string = "catHouse"; //叠块名 // private blockSvga: FYGE.MovieClip;
public blockName: string = "catHouse"; //叠块名
public currentScore: number = 1; public currentScore: number = 1;
constructor() { constructor() {
super(); super();
...@@ -20,6 +22,12 @@ export class Block extends FYGE.Container { ...@@ -20,6 +22,12 @@ export class Block extends FYGE.Container {
blockBitmap.anchorY = blockBitmap.height / 2; blockBitmap.anchorY = blockBitmap.height / 2;
this.addChild(blockBitmap); this.addChild(blockBitmap);
this.x = 750 / 2 - blockBitmap.width / 2; this.x = 750 / 2 - blockBitmap.width / 2;
// let blockSvga = new FYGE.MovieClip(RES.getRes("cat_jiazi.svga"));
// this.addChild(blockSvga);
// blockSvga.anchorX = blockSvga.videoWidth / 2;
// blockSvga.anchorY = blockSvga.videoHeight / 2;
// blockSvga.visible = false;
// this.blockSvga = blockSvga;
} }
/** init 初始化 */ /** init 初始化 */
...@@ -28,11 +36,26 @@ export class Block extends FYGE.Container { ...@@ -28,11 +36,26 @@ export class Block extends FYGE.Container {
this.currentScore = id+1; this.currentScore = id+1;
this.dir = Math.random() > 0.5 ? 1 : -1; this.dir = Math.random() > 0.5 ? 1 : -1;
this.blockName = MConst.blockName[id]; this.blockName = MConst.blockName[id];
if(id == 1){
this.blockBitmap.visible = false;
// this.blockSvga.visible = true;
//架子svga
let blockSvga = new FYGE.MovieClip(RES.getRes("cat_jiazi.svga"));
this.addChild(blockSvga);
blockSvga.anchorX = blockSvga.videoWidth / 2;
blockSvga.anchorY = blockSvga.videoHeight / 2;
blockSvga.startAniRange(0,blockSvga.totalFrames,0,()=>{});
// console.log("这个svga高度+++++++++",blockSvga.videoHeight,this.height);
}else{
this.blockBitmap.visible = true;
this.blockBitmap.texture = RES.getRes(blockPng[this.blockName]); this.blockBitmap.texture = RES.getRes(blockPng[this.blockName]);
console.log(this.blockName) }
// console.log(this.blockName)
} }
/** 叠块飞入 */ /** 叠块飞入 */
onMove(index) { onMove(index,lastBlockName) {
let self = this;
this.visible = true; this.visible = true;
this.x = this.x =
this.dir > 0 this.dir > 0
...@@ -52,6 +75,9 @@ export class Block extends FYGE.Container { ...@@ -52,6 +75,9 @@ export class Block extends FYGE.Container {
MConst.blockEnterTimer * MConst.blockEnterTimer *
(Math.random() > 0.5 ? 1 : -1); (Math.random() > 0.5 ? 1 : -1);
console.log("时间++", duration); console.log("时间++", duration);
if(lastBlockName == ""){
duration = 1500;
}
// let globalX = // let globalX =
// this.dir > 0 // this.dir > 0
// ? -this.dir * MConst.blockConfig[this.blockName][0] - // ? -this.dir * MConst.blockConfig[this.blockName][0] -
...@@ -60,7 +86,9 @@ export class Block extends FYGE.Container { ...@@ -60,7 +86,9 @@ export class Block extends FYGE.Container {
let globalX = 750 / 2 - this.blockBitmap.width / 2; let globalX = 750 / 2 - this.blockBitmap.width / 2;
console.log("目标位置++", this.dir, globalX, 750); console.log("目标位置++", this.dir, globalX, 750);
return new Promise((resolve) => { return new Promise((resolve) => {
FYGE.Tween.get(this).to({ x: globalX }, duration).call(resolve); FYGE.Tween.get(this).to({ x: globalX }, duration).call(()=>{
// DataMgr.game.score += self.currentScore;
}).call(resolve);
}); });
} }
/** 移动结束 */ /** 移动结束 */
......
...@@ -38,7 +38,7 @@ export class Cat extends FYGE.Container { ...@@ -38,7 +38,7 @@ export class Cat extends FYGE.Container {
} }
/** 初始化 */ /** 初始化 */
init({ initY }) { init({ initY }) {
this.initY = initY - 270 + 10; this.initY = initY - 270;
this.y = this.initY; this.y = this.initY;
this.jumping = false; this.jumping = false;
// this.onChange(); // this.onChange();
...@@ -107,7 +107,7 @@ export class Cat extends FYGE.Container { ...@@ -107,7 +107,7 @@ export class Cat extends FYGE.Container {
} }
set catStatus(v: CatStatus) { set catStatus(v: CatStatus) {
if (this.catStatus == v) return; if (this.catStatus == v) return;
if(v != CatStatus.SETUP && this.catStatus == CatStatus.GETFISH)return; if(v != CatStatus.SETUP && this.catStatus == CatStatus.GETFISH && v != CatStatus.OVER && v != CatStatus.HITAWAY)return;
this._catStatus = v; this._catStatus = v;
//改变SVga //改变SVga
this.catSvaga && this.SVGAContainer.removeChildren(this.catSvaga); this.catSvaga && this.SVGAContainer.removeChildren(this.catSvaga);
......
...@@ -40,7 +40,7 @@ export default class GuideMask extends FYGE.Container { ...@@ -40,7 +40,7 @@ export default class GuideMask extends FYGE.Container {
//描述 //描述
let descText = Tool.getText( let descText = Tool.getText(
"看准时机,在物体飞进来的瞬间踩住\n跳到更高的地方", "帮助猫咪跳到最高处\n它才能抓住小鱼干哦~",
30, 30,
"#ffffff", "#ffffff",
FYGE.TEXT_ALIGN.CENTER, FYGE.TEXT_ALIGN.CENTER,
......
...@@ -54,6 +54,7 @@ export default class StackHigh extends FYGE.Container { ...@@ -54,6 +54,7 @@ export default class StackHigh extends FYGE.Container {
private isHitFish: boolean = true; //是否碰撞鱼干 private isHitFish: boolean = true; //是否碰撞鱼干
public timer: number = 0; public timer: number = 0;
private timing = false; private timing = false;
private timeLabel: FYGE.BitmapText;
constructor(parent: Scene) { constructor(parent: Scene) {
super(); super();
...@@ -69,7 +70,7 @@ export default class StackHigh extends FYGE.Container { ...@@ -69,7 +70,7 @@ export default class StackHigh extends FYGE.Container {
GDispatcher.once("gameDead", this.gameDead, this); GDispatcher.once("gameDead", this.gameDead, this);
//弹窗测试 //弹窗测试
// showPanel(GameFailPanel); // showPanel(GameSuccessPanel);
//引导 //引导
GuideMgr.instance.container = parent; GuideMgr.instance.container = parent;
...@@ -98,13 +99,13 @@ export default class StackHigh extends FYGE.Container { ...@@ -98,13 +99,13 @@ export default class StackHigh extends FYGE.Container {
//背景SVGA //背景SVGA
let bgSVGA = new FYGE.MovieClip(RES.getRes("high_bg.svga")); let bgSVGA = new FYGE.MovieClip(RES.getRes("high_bg.svga"));
this.node.addChild(bgSVGA); this.node.addChild(bgSVGA);
bgSVGA.startAniRange(0,bgSVGA.totalFrames,-1); bgSVGA.startAniRange(0, bgSVGA.totalFrames, 0);
//游戏层 //游戏层
const gameContainer = new FYGE.Container(); const gameContainer = new FYGE.Container();
gameContainer.width = 750; gameContainer.width = 750;
gameContainer.height = 1624; gameContainer.height = 1624;
gameContainer.anchorX = layers.width / 2; gameContainer.anchorX = 750 / 2;
gameContainer.anchorY = layers.height; gameContainer.anchorY = layers.height;
this.node.addChild(gameContainer); this.node.addChild(gameContainer);
this.gameContainer = gameContainer; this.gameContainer = gameContainer;
...@@ -127,7 +128,7 @@ export default class StackHigh extends FYGE.Container { ...@@ -127,7 +128,7 @@ export default class StackHigh extends FYGE.Container {
this.cat = new Cat(); this.cat = new Cat();
gameContainer.addChild(this.cat); gameContainer.addChild(this.cat);
console.log(this.cat.x); console.log(this.cat.x);
this.cat.init({ initY: this.baseOffsetY }); this.cat.init({ initY: this.baseOffsetY+20 });
//TODO 猫咪y值 //TODO 猫咪y值
// this.cat.y = this.baseOffsetY + 30; // this.cat.y = this.baseOffsetY + 30;
catShadow.y = 250 + this.cat.y - 20; catShadow.y = 250 + this.cat.y - 20;
...@@ -141,15 +142,15 @@ export default class StackHigh extends FYGE.Container { ...@@ -141,15 +142,15 @@ export default class StackHigh extends FYGE.Container {
for (var i = 0; i < 10; i++) for (var i = 0; i < 10; i++)
textures[i] = RES.getRes(`high_score_${i}.png`); textures[i] = RES.getRes(`high_score_${i}.png`);
//目标分数 //目标分数
let globalScore = new FYGE.Sprite(RES.getRes("high_global_scor.png")); let globalScore = new FYGE.Sprite(RES.getRes("high_global_score.png"));
this.node.addChild(globalScore); this.node.addChild(globalScore);
globalScore.y = 206; globalScore.y = 206;
globalScore.x = 180; globalScore.x = 130;
let topScore = new FYGE.BitmapText(textures); let topScore = new FYGE.BitmapText(textures);
topScore.textAlign = FYGE.TEXT_ALIGN.CENTER; topScore.textAlign = FYGE.TEXT_ALIGN.CENTER;
topScore.y = 206; topScore.y = 206;
topScore.x = 526; topScore.x = 476;
topScore.text = `${MConst.options.targetScore}`; //可配置 topScore.text = `${MConst.options.targetScore}`; //可配置
topScore.scaleX = 0.8; topScore.scaleX = 0.8;
topScore.scaleY = 0.8; topScore.scaleY = 0.8;
...@@ -162,13 +163,55 @@ export default class StackHigh extends FYGE.Container { ...@@ -162,13 +163,55 @@ export default class StackHigh extends FYGE.Container {
var catScore = new FYGE.BitmapText(textures); var catScore = new FYGE.BitmapText(textures);
catScore.textAlign = FYGE.TEXT_ALIGN.CENTER; catScore.textAlign = FYGE.TEXT_ALIGN.CENTER;
catScore.y = 304; catScore.y = 304;
catScore.x = 375; catScore.x = 325;
this.catScoreLabel = catScore; this.catScoreLabel = catScore;
this.catScoreLabel.text = "0"; this.catScoreLabel.text = "0";
this.node.addChild(this.catScoreLabel); this.node.addChild(this.catScoreLabel);
this.node.mouseChildren = true; this.node.mouseChildren = true;
this.node.mouseEnable = true; this.node.mouseEnable = true;
//倒计时
let cdCountTitleBg = new FYGE.Sprite(RES.getRes("high_scorebg.png"));
this.node.addChild(cdCountTitleBg);
cdCountTitleBg.position.set(584, 206);
let cdCountText = Tool.getText(
"倒计时",
26,
"#ffffff",
FYGE.TEXT_ALIGN.CENTER,
130
);
cdCountText.position.set(580, 213);
this.node.addChild(cdCountText);
let cdCountBg = new FYGE.Sprite(RES.getRes("high_clock.png"));
this.node.addChild(cdCountBg);
cdCountBg.position.set(580, 244);
//秒
let secondText = Tool.getText(
"秒",
34,
"#ffffff",
FYGE.TEXT_ALIGN.CENTER,
40
);
secondText.position.set(700, 314);
this.node.addChild(secondText);
var textures1 = {};
for (var i = 0; i < 10; i++)
textures1[i] = RES.getRes(`score_high_${i}.png`);
var timeLabel = new FYGE.BitmapText(textures1);
timeLabel.textAlign = FYGE.TEXT_ALIGN.CENTER;
timeLabel.y = 280;
timeLabel.x = 646;
this.timeLabel = timeLabel;
this.timeLabel.text = Math.ceil(this.timer / 1000)+"";
this.node.addChild(this.timeLabel);
//长按 //长按
this.node.addEventListener( this.node.addEventListener(
FYGE.MouseEvent.MOUSE_DOWN, FYGE.MouseEvent.MOUSE_DOWN,
...@@ -182,6 +225,7 @@ export default class StackHigh extends FYGE.Container { ...@@ -182,6 +225,7 @@ export default class StackHigh extends FYGE.Container {
this.playZoom("in"); this.playZoom("in");
//开始倒计时 //开始倒计时
this.timing = true; this.timing = true;
} }
/** /**
...@@ -193,7 +237,7 @@ export default class StackHigh extends FYGE.Container { ...@@ -193,7 +237,7 @@ export default class StackHigh extends FYGE.Container {
this._score = v; this._score = v;
this.catScoreLabel.text = this._score + ""; this.catScoreLabel.text = this._score + "";
//出现鱼干 //出现鱼干
if (this._score > MConst.options.targetScore - 95) { if (this._score >= MConst.options.targetScore) {
this.createFish(); this.createFish();
} }
} }
...@@ -231,7 +275,7 @@ export default class StackHigh extends FYGE.Container { ...@@ -231,7 +275,7 @@ export default class StackHigh extends FYGE.Container {
} }
/** 倒计时 */ /** 倒计时 */
downTimer() { downTimer() {
if(this.pause) return; if (this.pause) return;
if (this.timing) { if (this.timing) {
if (this.timer > 0) { if (this.timer > 0) {
if (MTimer.deltaTime > 0) { if (MTimer.deltaTime > 0) {
...@@ -245,6 +289,8 @@ export default class StackHigh extends FYGE.Container { ...@@ -245,6 +289,8 @@ export default class StackHigh extends FYGE.Container {
this.isAppearBlock = false; this.isAppearBlock = false;
this.gameOver(); this.gameOver();
} }
let temp = Math.ceil(this.timer / 1000);
this.timeLabel.text = temp + "";
} }
} }
...@@ -253,22 +299,18 @@ export default class StackHigh extends FYGE.Container { ...@@ -253,22 +299,18 @@ export default class StackHigh extends FYGE.Container {
GDispatcher.dispatchEvent("game-destroy"); GDispatcher.dispatchEvent("game-destroy");
} }
/** 倒计时结束 */ /** 倒计时结束 */
timerOver(){ timerOver() {
//是否新手引导 //是否新手引导
console.log("是否新手引导++++",GuideMgr.instance.guideFlag); console.log("是否新手引导++++", MConst.options.scheduleFinished);
if (GuideMgr.instance.guideFlag == true && MConst.options.scheduleFinished == 1) {
GuideMgr.instance.drawFirstGuide(true);
}else{
this.createBlock(); this.createBlock();
} }
}
/** 新手引导结束 */ /** 新手引导结束 */
newGuideOver(){ newGuideOver() {
this.createBlock(); TimerCountMgr.instance.drawTimerCount();
} }
/** 存储上一个叠块 */
private lastBlockName = "";
/** 创建叠块 */ /** 创建叠块 */
private createBlock() { private createBlock() {
if (!this.isAppearBlock) return; if (!this.isAppearBlock) return;
...@@ -285,12 +327,23 @@ export default class StackHigh extends FYGE.Container { ...@@ -285,12 +327,23 @@ export default class StackHigh extends FYGE.Container {
block.height, block.height,
this.cat.y this.cat.y
); );
// console.log("物体的高度++++++++++++", block.height);
if (this.lastBlockName == "catHetun" && block.blockName == "catTV") {
block.y = this.topY - block.height + 30;
} else {
if (block.blockName == "catJiazi") {
block.y = this.topY - 217;
} else {
block.y = this.topY - block.height; block.y = this.topY - block.height;
}
}
this.topY = block.y; this.topY = block.y;
block.onMove(this.blockIndex); block.onMove(this.blockIndex, this.lastBlockName);
this.needHitTest = true; this.needHitTest = true;
this.currentBlock = block; this.currentBlock = block;
this.lastBlockName = block.blockName;
} }
/** 创建鱼干 */ /** 创建鱼干 */
...@@ -298,14 +351,14 @@ export default class StackHigh extends FYGE.Container { ...@@ -298,14 +351,14 @@ export default class StackHigh extends FYGE.Container {
if (this.lineFish) return; if (this.lineFish) return;
let line = new Fish(); let line = new Fish();
line.init({ lineH: 300 }); line.init({ lineH: 300 });
this.node.addChildAt(line,2); this.node.addChildAt(line, 2);
line.onEnterScene(); line.onEnterScene();
this.lineFish = line; this.lineFish = line;
} }
/** 按下起跳 */ /** 按下起跳 */
async onTabScenes() { async onTabScenes() {
if(this.pause) return; if (this.pause) return;
let self = this; let self = this;
this.catShadow.visible = false; this.catShadow.visible = false;
console.log("按下起跳+++", this.cat.y, this.gameContainer.y); console.log("按下起跳+++", this.cat.y, this.gameContainer.y);
...@@ -326,7 +379,7 @@ export default class StackHigh extends FYGE.Container { ...@@ -326,7 +379,7 @@ export default class StackHigh extends FYGE.Container {
) )
.call(() => { .call(() => {
resolve(); resolve();
this.score += this.currentBlock.currentScore; if (!self.pause) this.score += this.currentBlock.currentScore;
this.createBlock(); this.createBlock();
this._touchdown = true; this._touchdown = true;
}); });
...@@ -342,7 +395,7 @@ export default class StackHigh extends FYGE.Container { ...@@ -342,7 +395,7 @@ export default class StackHigh extends FYGE.Container {
} }
/** 帧检测 */ /** 帧检测 */
onEnterFrame() { onEnterFrame() {
if(this.pause)return; if (this.pause) return;
this.downTimer(); this.downTimer();
if (this.needHitTest) { if (this.needHitTest) {
if (this.currentBlock) { if (this.currentBlock) {
...@@ -352,10 +405,10 @@ export default class StackHigh extends FYGE.Container { ...@@ -352,10 +405,10 @@ export default class StackHigh extends FYGE.Container {
let blockHitWidth = this.currentBlock.width; let blockHitWidth = this.currentBlock.width;
let hitOn = false; let hitOn = false;
if (Math.abs(px - bx) < (blockHitWidth + this.cat.width) / 2) { if (Math.abs(px - bx) < (blockHitWidth + this.cat.width) / 2 - 22) {
// console.log("跳起高度++++", by, blockHitHeight, this.cat.y); // console.log("跳起高度++++", by, blockHitHeight, this.cat.y);
this.cat.baseY = by - this.cat.height; this.cat.baseY = by - this.cat.height +10;
if (py > by - this.cat.height) { if (py > by - this.cat.height+10) {
hitOn = true; hitOn = true;
} }
} }
...@@ -379,6 +432,7 @@ export default class StackHigh extends FYGE.Container { ...@@ -379,6 +432,7 @@ export default class StackHigh extends FYGE.Container {
/** 碰撞检测 */ /** 碰撞检测 */
async onHitOn(dir) { async onHitOn(dir) {
console.log("碰撞了"); console.log("碰撞了");
this.catShadow.visible = false;
this.needHitTest = false; this.needHitTest = false;
this._touchdown = false; this._touchdown = false;
this.isAppearBlock = false; this.isAppearBlock = false;
...@@ -390,20 +444,19 @@ export default class StackHigh extends FYGE.Container { ...@@ -390,20 +444,19 @@ export default class StackHigh extends FYGE.Container {
this.gameOver(); this.gameOver();
}); });
await this.cat.onDropAway(this.posH); await this.cat.onDropAway(this.posH);
} }
/** 鱼干碰撞了 */ /** 鱼干碰撞了 */
onHitFish() { onHitFish() {
//音效 //音效
SoundMgr.instance.playSound("getFish",false); SoundMgr.instance.playSound("getFish", false);
this.isHitFish = false; this.isHitFish = false;
this.lineFish.onEatFish(); this.lineFish.onEatFish();
this.cat.onChangeFish(); this.cat.onChangeFish();
} }
/** 分数+1 */ /** 分数+1 */
onAddCount(countY: number){ onAddCount(countY: number) {
var addCount = Tool.getText( var addCount = Tool.getText(
`+${this.currentBlock.currentScore}`, `+${this.currentBlock.currentScore}`,
40, 40,
...@@ -416,7 +469,7 @@ export default class StackHigh extends FYGE.Container { ...@@ -416,7 +469,7 @@ export default class StackHigh extends FYGE.Container {
addCount.alpha = 1; addCount.alpha = 1;
this.gameContainer.addChild(addCount); this.gameContainer.addChild(addCount);
FYGE.Tween.get(addCount) FYGE.Tween.get(addCount)
.to({y:countY-80,alpha:0},500) .to({ y: countY - 80, alpha: 0 }, 500)
.call(() => { .call(() => {
addCount && this.gameContainer.removeChild(addCount); addCount && this.gameContainer.removeChild(addCount);
}); });
...@@ -473,14 +526,15 @@ export default class StackHigh extends FYGE.Container { ...@@ -473,14 +526,15 @@ export default class StackHigh extends FYGE.Container {
async gameOver() { async gameOver() {
console.log("游戏结束"); console.log("游戏结束");
this.gamePause(); this.gamePause();
// FYGE.Tween.removeAllTweens(); FYGE.Tween.removeAllTweens();
//弹窗 TODO //弹窗 TODO
const result = await submitGame(this.score); const result = await submitGame(this.score);
if(result.success){ if (result.success) {
if (result.data.pass) { if (!result.data.pass) {
if (result.data.leftTimes > 0) { if (result.data.leftTimes > 0) {
showPanel(GameFailPanel, { isAgain: true }); showPanel(GameFailPanel, { isAgain: true });
GDispatcher.dispatchEvent("showBuried", { md: 36 }); GDispatcher.dispatchEvent("showBuried", { md: 36 });
GDispatcher.dispatchEvent("showBuried", { md: 51 });
} else { } else {
showPanel(GameFailPanel, { isAgain: false }); showPanel(GameFailPanel, { isAgain: false });
GDispatcher.dispatchEvent("showBuried", { md: 37 }); GDispatcher.dispatchEvent("showBuried", { md: 37 });
...@@ -499,6 +553,7 @@ export default class StackHigh extends FYGE.Container { ...@@ -499,6 +553,7 @@ export default class StackHigh extends FYGE.Container {
glodCoin: result.data.goldenCorn, glodCoin: result.data.goldenCorn,
}); });
GDispatcher.dispatchEvent("showBuried", { md: 35 }); GDispatcher.dispatchEvent("showBuried", { md: 35 });
GDispatcher.dispatchEvent("showBuried", { md: 50 });
} }
} }
} }
......
...@@ -26,47 +26,104 @@ export default class TimerCount extends FYGE.Container { ...@@ -26,47 +26,104 @@ export default class TimerCount extends FYGE.Container {
private countDown(callback: () => void) { private countDown(callback: () => void) {
let allIn = new FYGE.Container(); let allIn = new FYGE.Container();
this.addChild(allIn); this.addChild(allIn);
SoundMgr.instance.playSound("timeCount",false);
//加入SVGA //加入SVGA
let readySvga = new FYGE.MovieClip(RES.getRes("high_ready.svga")); // let readySvga = new FYGE.MovieClip(RES.getRes("high_ready.svga"));
allIn.addChild(readySvga); // allIn.addChild(readySvga);
readySvga.stop(); // readySvga.stop();
let time1Svga = new FYGE.MovieClip(RES.getRes("high_timer_1.svga")); // let time1Svga = new FYGE.MovieClip(RES.getRes("high_timer_1.svga"));
allIn.addChild(time1Svga); // allIn.addChild(time1Svga);
time1Svga.stop(); // time1Svga.stop();
let time2Svga = new FYGE.MovieClip(RES.getRes("high_timer_2.svga")); // let time2Svga = new FYGE.MovieClip(RES.getRes("high_timer_2.svga"));
allIn.addChild(time2Svga); // allIn.addChild(time2Svga);
time2Svga.stop(); // time2Svga.stop();
let time3Svga = new FYGE.MovieClip(RES.getRes("high_timer_3.svga")); // let time3Svga = new FYGE.MovieClip(RES.getRes("high_timer_3.svga"));
allIn.addChild(time3Svga); // allIn.addChild(time3Svga);
time3Svga.stop(); // time3Svga.stop();
time1Svga.visible = time2Svga.visible = time3Svga.visible = false; // time1Svga.visible = time2Svga.visible = time3Svga.visible = false;
//倒计时音效 // //倒计时音效
SoundMgr.instance.playSound("timeCount",false);
readySvga.startAniRange(0, readySvga.totalFrames, 1, () => { // readySvga.startAniRange(0, readySvga.totalFrames, 1, () => {
FYGE.Tween.get(this) // FYGE.Tween.get(this)
.call(() => { // .call(() => {
time3Svga.visible = true; // time3Svga.visible = true;
time3Svga.startAniRange(0, time3Svga.totalFrames, 1, () => { // time3Svga.startAniRange(0, time3Svga.totalFrames, 1, () => {
time3Svga.visible = false; // time3Svga.visible = false;
}); // });
}) // })
.wait(1000) // .wait(1000)
.call(() => { // .call(() => {
time2Svga.visible = true; // time2Svga.visible = true;
time2Svga.startAniRange(0, time2Svga.totalFrames, 1, () => { // time2Svga.startAniRange(0, time2Svga.totalFrames, 1, () => {
time2Svga.visible = false; // time2Svga.visible = false;
}); // });
// })
// .wait(1000)
// .call(() => {
// time1Svga.visible = true;
// time1Svga.startAniRange(0, time1Svga.totalFrames, 1, () => {
// time1Svga.visible = false;
// callback();
// FYGE.Tween.removeTweens(self);
// });
// });
// });
var timeBg = new FYGE.Sprite(RES.getRes("timerCountBg.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 = [
"high_ready.png",
"high_timer_3.png",
"high_timer_2.png",
"high_timer_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(() => { .call(() => {
time1Svga.visible = true; //执行完销毁吧,浏览器自己回收吧
time1Svga.startAniRange(0, time1Svga.totalFrames, 1, () => { // allIn.destroy();
time1Svga.visible = false; this.removeChild(allIn);
callback(); // if (getBgOn()) playBg();
FYGE.Tween.removeTweens(self);
});
}); });
} else {
t.set({ alpha: 0 });
}
if (i == 0) {
t.call(() => {
timeBg.alpha = 1;
}); });
} }
}
}
} }
...@@ -4,8 +4,8 @@ export namespace MConst { ...@@ -4,8 +4,8 @@ export namespace MConst {
width: 750, width: 750,
height: 1624 height: 1624
}; };
export const CatJumpSpeed = 28;//貓起跳速度 export const CatJumpSpeed = 26;//貓起跳速度
export const gravity = 0.98;//下落加速度 export const gravity = 0.9;//下落加速度
export const baseTrueH = 300;//底座真实高度 export const baseTrueH = 300;//底座真实高度
export const catTrueH = 226;//猫咪真实高度 export const catTrueH = 226;//猫咪真实高度
export const blockName = ["catTV","catJiazi","catHouse","catHetun"]; export const blockName = ["catTV","catJiazi","catHouse","catHetun"];
...@@ -18,7 +18,7 @@ export namespace MConst { ...@@ -18,7 +18,7 @@ export namespace MConst {
export const blockAverageH = 178;//叠块皮平均高度 export const blockAverageH = 178;//叠块皮平均高度
export const blockInitOffsetX = 10;//滑块初始偏移量X export const blockInitOffsetX = 10;//滑块初始偏移量X
export const baseOffsetY = 250;//物体block偏移量 export const baseOffsetY = 250;//物体block偏移量
export const blockDurationRange = [500,1200];//叠块出现所需时间 export const blockDurationRange = [1100,1300];//叠块出现所需时间
export const blockAddSpeed = 20;//叠块时间递减 export const blockAddSpeed = 20;//叠块时间递减
export const blockEnterTimer = 0.2;//叠块进入时间系数 export const blockEnterTimer = 0.2;//叠块进入时间系数
export let options = { export let options = {
......
...@@ -33,24 +33,24 @@ export class GameFailPanel extends Panel { ...@@ -33,24 +33,24 @@ export class GameFailPanel extends Panel {
//描述 //描述
let title = Tool.getText( let title = Tool.getText(
`${isAgain ? "不想失去奖励" : "猫咪累了"}`, `${isAgain ? "不想失去奖励?" : "猫咪累了"}`,
38, 38,
"#333333", "#333333",
FYGE.TEXT_ALIGN.CENTER, FYGE.TEXT_ALIGN.CENTER,
230 280
); );
this.addChild(title); this.addChild(title);
title.position.set(260, 820); title.position.set(240, 820);
//获得奖励 //获得奖励
let getPrizeText = Tool.getText( let getPrizeText = Tool.getText(
`${isAgain ? "不如再试一次" : "等等再来玩"}`, `${isAgain ? "那再试一次吧~" : "过会儿再来陪它玩吧~"}`,
32, 32,
`${isAgain ? "#3b8edd" : "#333333"}`, `${isAgain ? "#3b8edd" : "#333333"}`,
FYGE.TEXT_ALIGN.CENTER, FYGE.TEXT_ALIGN.CENTER,
230 400
); );
this.addChild(getPrizeText); this.addChild(getPrizeText);
getPrizeText.position.set(260, 880); getPrizeText.position.set(180, 880);
//看猫 //看猫
this.seeCat = new FYGE.Button(RES.getRes("high_seecat.png")); this.seeCat = new FYGE.Button(RES.getRes("high_seecat.png"));
...@@ -86,6 +86,8 @@ export class GameFailPanel extends Panel { ...@@ -86,6 +86,8 @@ export class GameFailPanel extends Panel {
//看猫咪 //看猫咪
onClickSeeCat() { onClickSeeCat() {
if (this.againBtn.visible) { if (this.againBtn.visible) {
GDispatcher.dispatchEvent("clickBuried", { md: 51 });
}else{
GDispatcher.dispatchEvent("clickBuried", { md: 37 }); GDispatcher.dispatchEvent("clickBuried", { md: 37 });
} }
GDispatcher.dispatchEvent("high-see-cat"); GDispatcher.dispatchEvent("high-see-cat");
......
...@@ -36,18 +36,18 @@ export class GameSuccessPanel extends Panel { ...@@ -36,18 +36,18 @@ export class GameSuccessPanel extends Panel {
//数据 //数据
const { isAgain, glodCoin } = this.data; const { isAgain, glodCoin } = this.data;
// var isAgain = false; // var isAgain = false,glodCoin=77;
//描述 //描述
let title = Tool.getText( let title = Tool.getText(
"达成目标分数", "太棒了,目标达成!",
34, 34,
"#333333", "#333333",
FYGE.TEXT_ALIGN.CENTER, FYGE.TEXT_ALIGN.CENTER,
230 320
); );
this.addChild(title); this.addChild(title);
title.position.set(270, 800); title.position.set(240, 800);
//获得奖励 //获得奖励
let getPrizeText = Tool.getText( let getPrizeText = Tool.getText(
"获得奖励", "获得奖励",
...@@ -62,7 +62,7 @@ export class GameSuccessPanel extends Panel { ...@@ -62,7 +62,7 @@ export class GameSuccessPanel extends Panel {
//金币 //金币
let coin = new FYGE.Sprite(RES.getRes("high_coin.png")); let coin = new FYGE.Sprite(RES.getRes("high_coin.png"));
this.addChild(coin); this.addChild(coin);
coin.position.set(315, 920); coin.position.set(330, 920);
let coinText = Tool.getText( let coinText = Tool.getText(
`X${glodCoin}`, `X${glodCoin}`,
...@@ -72,7 +72,7 @@ export class GameSuccessPanel extends Panel { ...@@ -72,7 +72,7 @@ export class GameSuccessPanel extends Panel {
90 90
); );
this.addChild(coinText); this.addChild(coinText);
coinText.position.set(365, 928); coinText.position.set(360, 928);
//再来一次 //再来一次
this.againBtn = new FYGE.Button(RES.getRes("high_again.png")); this.againBtn = new FYGE.Button(RES.getRes("high_again.png"));
...@@ -105,6 +105,7 @@ export class GameSuccessPanel extends Panel { ...@@ -105,6 +105,7 @@ export class GameSuccessPanel extends Panel {
//等等再来玩 //等等再来玩
onClickAwait() { onClickAwait() {
GDispatcher.dispatchEvent("high-await"); GDispatcher.dispatchEvent("high-await");
GDispatcher.dispatchEvent("clickBuried", { md: 50 });
this.hidePanel(); this.hidePanel();
} }
...@@ -116,7 +117,7 @@ export class GameSuccessPanel extends Panel { ...@@ -116,7 +117,7 @@ export class GameSuccessPanel extends Panel {
GDispatcher.dispatchEvent("clickBuried", { md: 35 }); GDispatcher.dispatchEvent("clickBuried", { md: 35 });
} }
GDispatcher.dispatchEvent("high-share"); GDispatcher.dispatchEvent("high-share");
this.hidePanel(); // this.hidePanel();
} }
initEvents() { initEvents() {
......
...@@ -11,7 +11,7 @@ import { SoundMgr } from "../Mgr/SoundMgr"; ...@@ -11,7 +11,7 @@ import { SoundMgr } from "../Mgr/SoundMgr";
export class GameScenes extends Scene { export class GameScenes extends Scene {
public game: StackHigh = null; public game: StackHigh = null;
get groupNames() { get groupNames() {
return ["stackHigh", "catHighSvga", "hideAndSeek"]; return ["stackHigh", "catHighSvga"];
} }
initUi() { initUi() {
...@@ -33,7 +33,12 @@ export class GameScenes extends Scene { ...@@ -33,7 +33,12 @@ export class GameScenes extends Scene {
if (!this.game) { if (!this.game) {
this.game = new StackHigh(this); this.game = new StackHigh(this);
} }
if (MConst.options.scheduleFinished == 0) {
GuideMgr.instance.drawFirstGuide(true);
} else if (MConst.options.scheduleFinished == 1) {
TimerCountMgr.instance.drawTimerCount(); TimerCountMgr.instance.drawTimerCount();
}
//设置隐藏属性和改变可见属性的事件的名称 //设置隐藏属性和改变可见属性的事件的名称
let hidden: string, let hidden: string,
visibilityChange: string, visibilityChange: 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