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 @@
<script>
window.addEventListener("load", function() {
//是否完成新手
const scheduleFinished =0;
const scheduleFinished =1;
//目标分数
const targetScore = 20;
//是否音乐
const isMusic = true;
//时间
let tickSeconds = 10;
let tickSeconds = 60;
//获取canvas
var canvas = document.getElementById("canvas");
canvas.width = document.body.clientWidth * (window.devicePixelRatio || 1)
......
import PanelCtrl from "../ctrls/panelCtrl";
import SceneCtrl from "../ctrls/sceneCtrl";
......@@ -7,109 +6,126 @@ import SceneCtrl from "../ctrls/sceneCtrl";
* 仿白鹭的那套
*/
class Layers extends FYGE.Container {
private _bottomLayer: FYGE.Container;
private _sceneLayer: FYGE.Container;
private _popupLayer: FYGE.Container;
private _toastLayer: FYGE.Container;
private _topLayer: FYGE.Container;
private _shareLayer: FYGE.Container;
init(stage: FYGE.Stage) {
stage.addChild(this);
var arr = [
"_bottomLayer",
"_sceneLayer",
"_popupLayer",
"_toastLayer",
"_topLayer",
"_shareLayer"
];
for (var i = 0; i < arr.length; i++) {
this[arr[i]] = new FYGE.Container();
//有些时候,定宽的时候,部分layer置顶,部分居中,再处理
//为了都置顶和置左,stage的方式永远居中视窗,要么改stage永远左上为00
// this[arr[i]].y = this.stageOffsetY;
//如果定宽这里没必要,肯定是0
// this[arr[i]].x = this.stageOffsetX;//去掉,定高时就居中了
this.addChild(this[arr[i]]);
}
// this._sceneLayer.y = this.stageOffsetY
//初始化场景层级
SceneCtrl.instance.init(this.sceneLayer)
//初始化弹框层级
PanelCtrl.instance.init(this.popupLayer)
private _bottomLayer: FYGE.Container;
private _sceneLayer: FYGE.Container;
private _popupLayer: FYGE.Container;
private _toastLayer: FYGE.Container;
private _topLayer: FYGE.Container;
private _shareLayer: FYGE.Container;
init(stage: FYGE.Stage) {
stage.addChild(this);
var arr = [
"_bottomLayer",
"_sceneLayer",
"_popupLayer",
"_toastLayer",
"_topLayer",
"_shareLayer",
];
for (var i = 0; i < arr.length; i++) {
this[arr[i]] = new FYGE.Container();
//有些时候,定宽的时候,部分layer置顶,部分居中,再处理
//为了都置顶和置左,stage的方式永远居中视窗,要么改stage永远左上为00
// 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
// this[arr[i]].x = this.stageOffsetX;//去掉,定高时就居中了
this.addChild(this[arr[i]]);
}
// this._sceneLayer.y = this.stageOffsetY
//初始化场景层级
SceneCtrl.instance.init(this.sceneLayer);
//初始化弹框层级
PanelCtrl.instance.init(this.popupLayer);
}
/**
* 底图所在层级,比如统一的背景
*/
get bottomLayer() { return this._bottomLayer }
/**
* 场景
*/
get sceneLayer() { return this._sceneLayer }
/**
* 弹框
*/
get popupLayer() { return this._popupLayer }
/**
* toast所在层级
*/
get toastLayer() { return this._toastLayer }
/**
* 顶层,比如统一标题栏等
*/
get topLayer() { return this._topLayer }
/**
* 分享引导层
*/
get shareLayer() { return this._shareLayer }
/**
* 舞台信息都放在layers里吧
* 舞台可见高度,初始化后才能使用
*/
get stageHeight() {
if (!this.stage) return 0;
return this.stage.viewRect.height;
}
/**
* 舞台可见宽度
*/
get stageWidth() {
if (!this.stage) return 0;
return this.stage.viewRect.width;
}
/**
* 适配方式x两边偏移的量,固定宽度x为0
*/
get stageOffsetX() {
if (!this.stage) return 0;
return this.stage.viewRect.x;
}
get stageOffsetY() {
if (!this.stage) return 0;
return this.stage.viewRect.y;
}
/**
* 舞台中心点位置x
*/
// get stageCenterX(): number {
// return this.stage.viewRect.x + this.stage.viewRect.width >> 1;
// }
/**
* 舞台中心点位置y,layer位置做过偏移的就不对了,所以还是自行算吧
*/
// get stageCenterY(): number {
// return this.stage.viewRect.y + this.stage.viewRect.height >> 1;
// }
/**
* 底图所在层级,比如统一的背景
*/
get bottomLayer() {
return this._bottomLayer;
}
/**
* 场景
*/
get sceneLayer() {
return this._sceneLayer;
}
/**
* 弹框
*/
get popupLayer() {
return this._popupLayer;
}
/**
* toast所在层级
*/
get toastLayer() {
return this._toastLayer;
}
/**
* 顶层,比如统一标题栏等
*/
get topLayer() {
return this._topLayer;
}
/**
* 分享引导层
*/
get shareLayer() {
return this._shareLayer;
}
/**
* 舞台信息都放在layers里吧
* 舞台可见高度,初始化后才能使用
*/
get stageHeight() {
if (!this.stage) return 0;
return this.stage.viewRect.height;
}
/**
* 舞台可见宽度
*/
get stageWidth() {
if (!this.stage) return 0;
return this.stage.viewRect.width;
}
/**
* 适配方式x两边偏移的量,固定宽度x为0
*/
get stageOffsetX() {
if (!this.stage) return 0;
return this.stage.viewRect.x;
}
get stageOffsetY() {
if (!this.stage) return 0;
return this.stage.viewRect.y;
}
/**
* 舞台中心点位置x
*/
// get stageCenterX(): number {
// return this.stage.viewRect.x + this.stage.viewRect.width >> 1;
// }
/**
* 舞台中心点位置y,layer位置做过偏移的就不对了,所以还是自行算吧
*/
// get stageCenterY(): number {
// return this.stage.viewRect.y + this.stage.viewRect.height >> 1;
// }
}
export const layers = new Layers();
//先执行,在淘宝小程序中重新进入会再次初始化
export function destroyLayers() {
//所有层级移除,init会重新建
layers.removeChildren();
//从父级stage移除自己,init会重新加
if (layers.parent) layers.parent.removeChild(layers)
}
\ No newline at end of file
//所有层级移除,init会重新建
layers.removeChildren();
//从父级stage移除自己,init会重新加
if (layers.parent) layers.parent.removeChild(layers);
}
......@@ -1071,42 +1071,59 @@ var Layers = (function (_super) {
"_popupLayer",
"_toastLayer",
"_topLayer",
"_shareLayer"
"_shareLayer",
];
for (var i = 0; i < arr.length; i++) {
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]]);
}
sceneCtrl_1.default.instance.init(this.sceneLayer);
panelCtrl_1.default.instance.init(this.popupLayer);
};
Object.defineProperty(Layers.prototype, "bottomLayer", {
get: function () { return this._bottomLayer; },
get: function () {
return this._bottomLayer;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Layers.prototype, "sceneLayer", {
get: function () { return this._sceneLayer; },
get: function () {
return this._sceneLayer;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Layers.prototype, "popupLayer", {
get: function () { return this._popupLayer; },
get: function () {
return this._popupLayer;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Layers.prototype, "toastLayer", {
get: function () { return this._toastLayer; },
get: function () {
return this._toastLayer;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Layers.prototype, "topLayer", {
get: function () { return this._topLayer; },
get: function () {
return this._topLayer;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Layers.prototype, "shareLayer", {
get: function () { return this._shareLayer; },
get: function () {
return this._shareLayer;
},
enumerable: true,
configurable: true
});
......@@ -4675,8 +4692,8 @@ var MConst;
width: 750,
height: 1624
};
MConst.CatJumpSpeed = 28;
MConst.gravity = 0.98;
MConst.CatJumpSpeed = 26;
MConst.gravity = 0.9;
MConst.baseTrueH = 300;
MConst.catTrueH = 226;
MConst.blockName = ["catTV", "catJiazi", "catHouse", "catHetun"];
......@@ -4689,7 +4706,7 @@ var MConst;
MConst.blockAverageH = 178;
MConst.blockInitOffsetX = 10;
MConst.baseOffsetY = 250;
MConst.blockDurationRange = [500, 1200];
MConst.blockDurationRange = [1100, 1300];
MConst.blockAddSpeed = 20;
MConst.blockEnterTimer = 0.2;
MConst.options = {
......@@ -5144,9 +5161,45 @@ exports.default = GameMgr;
"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 });
var DataMgr_1 = __webpack_require__(/*! ./DataMgr */ "./src/Mgr/DataMgr.ts");
var GuideMask_1 = __webpack_require__(/*! ../game/GuideMask */ "./src/game/GuideMask.ts");
var StackHighMain_1 = __webpack_require__(/*! ../StackHighMain */ "./src/StackHighMain.ts");
var GuideMgr = (function () {
function GuideMgr() {
this.currentGuideMask = null;
......@@ -5189,21 +5242,28 @@ var GuideMgr = (function () {
configurable: true
});
GuideMgr.prototype.drawFirstGuide = function (isEnd) {
var _this = this;
if (isEnd === void 0) { isEnd = false; }
DataMgr_1.DataMgr.game.pause = true;
this.currentGuideMask = new GuideMask_1.default();
this.currentGuideMask.onClick = function (context) {
context.dispose();
_this.currentGuideMask = null;
DataMgr_1.DataMgr.game.pause = false;
DataMgr_1.DataMgr.game.newGuideOver();
if (isEnd) {
_this.guideFlag = false;
}
};
this._container.addChild(this.currentGuideMask);
this.currentGuideMask.drawFirst();
return __awaiter(this, void 0, void 0, function () {
var _this = this;
return __generator(this, function (_a) {
DataMgr_1.DataMgr.game.pause = true;
this.currentGuideMask = new GuideMask_1.default();
this.currentGuideMask.onClick = function (context) {
StackHighMain_1.GDispatcher.dispatchEvent("new-guide");
console.log("888");
context.dispose();
_this.currentGuideMask = null;
DataMgr_1.DataMgr.game.pause = false;
DataMgr_1.DataMgr.game.newGuideOver();
if (isEnd) {
_this.guideFlag = false;
}
};
this._container.addChild(this.currentGuideMask);
this.currentGuideMask.drawFirst();
return [2];
});
});
};
GuideMgr._instance = null;
return GuideMgr;
......@@ -5398,7 +5458,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.ResJson = {
"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"
},
{
......@@ -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",
"atlas": {
"cat_house.png": {
"x": 432,
"y": 1320,
"y": 1502,
"w": 205,
"h": 171,
"ox": 0,
"oy": 0,
"sw": 205,
"sh": 171,
"ro": true
"ro": false
},
"cat_jiazi.png": {
"x": 2,
"y": 3572,
"x": 432,
"y": 1283,
"w": 207,
"h": 217,
"ox": 0,
......@@ -5600,19 +5660,19 @@ exports.ResJson = {
"ro": false
},
"cat_shadow.png": {
"x": 992,
"y": 292,
"x": 916,
"y": 1981,
"w": 96,
"h": 30,
"ox": 0,
"oy": 0,
"sw": 96,
"sh": 30,
"ro": true
"ro": false
},
"fish.png": {
"x": 982,
"y": 942,
"x": 897,
"y": 1553,
"w": 36,
"h": 107,
"ox": 0,
......@@ -5622,52 +5682,63 @@ exports.ResJson = {
"ro": false
},
"high_cat_common.png": {
"x": 754,
"y": 1045,
"x": 432,
"y": 1908,
"w": 166,
"h": 226,
"ox": 0,
"oy": 0,
"sw": 166,
"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
},
"high_down.png": {
"x": 754,
"y": 292,
"x": 611,
"y": 1743,
"w": 236,
"h": 404,
"ox": 0,
"oy": 0,
"sw": 236,
"sh": 404,
"ro": false
"ro": true
},
"high_fish.png": {
"x": 432,
"y": 1527,
"x": 600,
"y": 2199,
"w": 160,
"h": 214,
"ox": 0,
"oy": 0,
"sw": 160,
"sh": 214,
"ro": false
"ro": true
},
"high_global_scor.png": {
"x": 754,
"y": 162,
"high_global_score.png": {
"x": 958,
"y": 136,
"w": 254,
"h": 58,
"ox": 0,
"oy": 0,
"sw": 254,
"sh": 58,
"ro": false
"ro": true
},
"high_ground.png": {
"x": 2,
"y": 1320,
"y": 1283,
"w": 2250,
"h": 428,
"ox": 0,
......@@ -5677,8 +5748,8 @@ exports.ResJson = {
"ro": true
},
"high_hetun.png": {
"x": 754,
"y": 2,
"x": 639,
"y": 1553,
"w": 256,
"h": 158,
"ox": 0,
......@@ -5688,8 +5759,8 @@ exports.ResJson = {
"ro": false
},
"high_pointer.png": {
"x": 432,
"y": 1743,
"x": 816,
"y": 2335,
"w": 140,
"h": 134,
"ox": 0,
......@@ -5700,84 +5771,84 @@ exports.ResJson = {
},
"high_ready.png": {
"x": 2,
"y": 1140,
"w": 621,
"h": 178,
"y": 1137,
"w": 640,
"h": 144,
"ox": 0,
"oy": 0,
"sw": 621,
"sh": 178,
"sw": 640,
"sh": 144,
"ro": false
},
"high_score_0.png": {
"x": 805,
"y": 1213,
"x": 958,
"y": 794,
"w": 44,
"h": 65,
"ox": 4,
"oy": 1,
"sw": 50,
"sh": 67,
"ro": true
"ro": false
},
"high_score_1.png": {
"x": 982,
"y": 877,
"x": 958,
"y": 96,
"w": 38,
"h": 63,
"ox": 8,
"oy": 2,
"sw": 50,
"sh": 67,
"ro": false
"ro": true
},
"high_score_2.png": {
"x": 738,
"y": 1213,
"x": 958,
"y": 727,
"w": 44,
"h": 65,
"ox": 4,
"oy": 0,
"sw": 50,
"sh": 67,
"ro": true
"ro": false
},
"high_score_3.png": {
"x": 625,
"y": 1278,
"x": 958,
"y": 660,
"w": 44,
"h": 65,
"ox": 3,
"oy": 1,
"sw": 50,
"sh": 67,
"ro": true
"ro": false
},
"high_score_4.png": {
"x": 692,
"y": 1140,
"x": 958,
"y": 2,
"w": 46,
"h": 63,
"ox": 3,
"oy": 2,
"sw": 50,
"sh": 67,
"ro": false
"ro": true
},
"high_score_5.png": {
"x": 625,
"y": 1232,
"x": 958,
"y": 593,
"w": 44,
"h": 65,
"ox": 3,
"oy": 1,
"sw": 50,
"sh": 67,
"ro": true
"ro": false
},
"high_score_6.png": {
"x": 692,
"y": 1205,
"x": 958,
"y": 526,
"w": 44,
"h": 65,
"ox": 4,
......@@ -5787,8 +5858,8 @@ exports.ResJson = {
"ro": false
},
"high_score_7.png": {
"x": 872,
"y": 1213,
"x": 958,
"y": 50,
"w": 44,
"h": 63,
"ox": 4,
......@@ -5798,108 +5869,229 @@ exports.ResJson = {
"ro": true
},
"high_score_8.png": {
"x": 625,
"y": 1186,
"x": 958,
"y": 459,
"w": 44,
"h": 65,
"ox": 4,
"oy": 1,
"sw": 50,
"sh": 67,
"ro": true
"ro": false
},
"high_score_9.png": {
"x": 625,
"y": 1140,
"x": 958,
"y": 392,
"w": 44,
"h": 65,
"ox": 3,
"oy": 1,
"sw": 50,
"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": {
"x": 754,
"y": 222,
"x": 949,
"y": 1448,
"w": 252,
"h": 68,
"ox": 0,
"oy": 0,
"sw": 252,
"sh": 68,
"ro": false
"ro": true
},
"high_timer_1.png": {
"x": 692,
"y": 1272,
"x": 641,
"y": 1353,
"w": 198,
"h": 305,
"ox": 0,
"oy": 0,
"sw": 198,
"sh": 305,
"h": 306,
"ox": 73,
"oy": 12,
"sw": 330,
"sh": 330,
"ro": true
},
"high_timer_2.png": {
"x": 594,
"y": 1680,
"w": 205,
"h": 294,
"ox": 0,
"oy": 0,
"sw": 205,
"sh": 294,
"x": 644,
"y": 1137,
"w": 214,
"h": 310,
"ox": 61,
"oy": 8,
"sw": 330,
"sh": 330,
"ro": true
},
"high_timer_3.png": {
"x": 605,
"y": 1472,
"w": 206,
"h": 295,
"ox": 0,
"oy": 0,
"sw": 206,
"sh": 295,
"x": 600,
"y": 1981,
"w": 216,
"h": 314,
"ox": 57,
"oy": 8,
"sw": 330,
"sh": 330,
"ro": true
},
"high_tv.png": {
"x": 754,
"y": 877,
"x": 432,
"y": 2136,
"w": 226,
"h": 166,
"ox": 0,
"oy": 0,
"sw": 226,
"sh": 166,
"ro": false
"ro": true
},
"high_yaohaung.png": {
"x": 754,
"y": 698,
"x": 432,
"y": 1675,
"w": 177,
"h": 231,
"ox": 0,
"oy": 0,
"sw": 177,
"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
},
"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": {
"x": 2,
"y": 2,
"w": 750,
"h": 1136,
"w": 1133,
"h": 954,
"ox": 0,
"oy": 0,
"sw": 750,
"sh": 1136,
"ro": false
"oy": 409,
"sw": 1133,
"sh": 1624,
"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) {
this.currentScore = id + 1;
this.dir = Math.random() > 0.5 ? 1 : -1;
this.blockName = MConst_1.MConst.blockName[id];
this.blockBitmap.texture = RES_1.RES.getRes(blockPng[this.blockName]);
console.log(this.blockName);
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]);
}
};
Block.prototype.onMove = function (index) {
Block.prototype.onMove = function (index, lastBlockName) {
var _this = this;
var self = this;
this.visible = true;
this.x =
this.dir > 0
......@@ -6636,10 +6839,14 @@ var Block = (function (_super) {
MConst_1.MConst.blockEnterTimer *
(Math.random() > 0.5 ? 1 : -1);
console.log("时间++", duration);
if (lastBlockName == "") {
duration = 1500;
}
var globalX = 750 / 2 - this.blockBitmap.width / 2;
console.log("目标位置++", this.dir, globalX, 750);
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 () {
......@@ -6742,7 +6949,7 @@ var Cat = (function (_super) {
}
Cat.prototype.init = function (_a) {
var initY = _a.initY;
this.initY = initY - 270 + 10;
this.initY = initY - 270;
this.y = this.initY;
this.jumping = false;
};
......@@ -6803,7 +7010,7 @@ var Cat = (function (_super) {
var _this = this;
if (this.catStatus == v)
return;
if (v != CatStatus.SETUP && this.catStatus == CatStatus.GETFISH)
if (v != CatStatus.SETUP && this.catStatus == CatStatus.GETFISH && v != CatStatus.OVER && v != CatStatus.HITAWAY)
return;
this._catStatus = v;
this.catSvaga && this.SVGAContainer.removeChildren(this.catSvaga);
......@@ -7205,7 +7412,7 @@ var GuideMask = (function (_super) {
var pointer = new FYGE.Sprite(RES_1.RES.getRes("high_pointer.png"));
this.addChild(pointer);
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);
descText.position.set(96, 794);
var pointer = new FYGE.Sprite(RES_1.RES.getRes("high_start.png"));
......@@ -7668,6 +7875,7 @@ var StackHigh = (function (_super) {
_this._pause = false;
_this._topY = _this.baseOffsetY;
_this._posH = 0;
_this.lastBlockName = "";
_this.timer = MConst_1.MConst.options.tickSeconds * 1000;
_this.baseOffsetY = 1624 - MConst_1.MConst.baseTrueH + 20;
_this.topY = _this.baseOffsetY;
......@@ -7691,11 +7899,11 @@ var StackHigh = (function (_super) {
_this.backGround = backGround;
var bgSVGA = new FYGE.MovieClip(RES_1.RES.getRes("high_bg.svga"));
_this.node.addChild(bgSVGA);
bgSVGA.startAniRange(0, bgSVGA.totalFrames, -1);
bgSVGA.startAniRange(0, bgSVGA.totalFrames, 0);
var gameContainer = new FYGE.Container();
gameContainer.width = 750;
gameContainer.height = 1624;
gameContainer.anchorX = layers_1.layers.width / 2;
gameContainer.anchorX = 750 / 2;
gameContainer.anchorY = layers_1.layers.height;
_this.node.addChild(gameContainer);
_this.gameContainer = gameContainer;
......@@ -7712,21 +7920,21 @@ var StackHigh = (function (_super) {
_this.cat = new Cat_1.Cat();
gameContainer.addChild(_this.cat);
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;
_this.blockContainer = new FYGE.Container();
gameContainer.addChild(_this.blockContainer);
var textures = {};
for (var i = 0; i < 10; i++)
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);
globalScore.y = 206;
globalScore.x = 180;
globalScore.x = 130;
var topScore = new FYGE.BitmapText(textures);
topScore.textAlign = FYGE.TEXT_ALIGN.CENTER;
topScore.y = 206;
topScore.x = 526;
topScore.x = 476;
topScore.text = "" + MConst_1.MConst.options.targetScore;
topScore.scaleX = 0.8;
topScore.scaleY = 0.8;
......@@ -7737,12 +7945,34 @@ var StackHigh = (function (_super) {
var catScore = new FYGE.BitmapText(textures);
catScore.textAlign = FYGE.TEXT_ALIGN.CENTER;
catScore.y = 304;
catScore.x = 375;
catScore.x = 325;
_this.catScoreLabel = catScore;
_this.catScoreLabel.text = "0";
_this.node.addChild(_this.catScoreLabel);
_this.node.mouseChildren = 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);
MTimer_1.default.onFrame("Game", _this.onEnterFrame, _this);
_this.playZoom("in");
......@@ -7756,7 +7986,7 @@ var StackHigh = (function (_super) {
set: function (v) {
this._score = v;
this.catScoreLabel.text = this._score + "";
if (this._score > MConst_1.MConst.options.targetScore - 95) {
if (this._score >= MConst_1.MConst.options.targetScore) {
this.createFish();
}
},
......@@ -7801,6 +8031,8 @@ var StackHigh = (function (_super) {
configurable: true
});
StackHigh.prototype.downTimer = function () {
if (this.pause)
return;
if (this.timing) {
if (this.timer > 0) {
if (MTimer_1.default.deltaTime > 0) {
......@@ -7814,22 +8046,19 @@ var StackHigh = (function (_super) {
this.isAppearBlock = false;
this.gameOver();
}
var temp = Math.ceil(this.timer / 1000);
this.timeLabel.text = temp + "";
}
};
StackHigh.prototype.gameDead = function () {
StackHighMain_1.GDispatcher.dispatchEvent("game-destroy");
};
StackHigh.prototype.timerOver = function () {
console.log("是否新手引导++++", GuideMgr_1.default.instance.guideFlag);
if (GuideMgr_1.default.instance.guideFlag == true && MConst_1.MConst.options.scheduleFinished == 1) {
GuideMgr_1.default.instance.drawFirstGuide(true);
}
else {
this.createBlock();
}
console.log("是否新手引导++++", MConst_1.MConst.options.scheduleFinished);
this.createBlock();
};
StackHigh.prototype.newGuideOver = function () {
this.createBlock();
TimerCountMgr_1.default.instance.drawTimerCount();
};
StackHigh.prototype.createBlock = function () {
if (!this.isAppearBlock)
......@@ -7841,11 +8070,22 @@ var StackHigh = (function (_super) {
});
this.blockContainer.addChild(block);
console.log("222", this.baseOffsetY, MConst_1.MConst.blockName.length, block.height, this.cat.y);
block.y = this.topY - 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;
}
}
this.topY = block.y;
block.onMove(this.blockIndex);
block.onMove(this.blockIndex, this.lastBlockName);
this.needHitTest = true;
this.currentBlock = block;
this.lastBlockName = block.blockName;
};
StackHigh.prototype.createFish = function () {
if (this.lineFish)
......@@ -7882,7 +8122,8 @@ var StackHigh = (function (_super) {
.to({ posH: _this.posH + _this.currentBlock.height }, 300, FYGE.Ease.cubicOut)
.call(function () {
resolve();
_this.score += _this.currentBlock.currentScore;
if (!self.pause)
_this.score += _this.currentBlock.currentScore;
_this.createBlock();
_this._touchdown = true;
});
......@@ -7909,9 +8150,9 @@ var StackHigh = (function (_super) {
var blockHitHeight = this.currentBlock.height;
var blockHitWidth = this.currentBlock.width;
var hitOn = false;
if (Math.abs(px - bx) < (blockHitWidth + this.cat.width) / 2) {
this.cat.baseY = by - this.cat.height;
if (py > by - this.cat.height) {
if (Math.abs(px - bx) < (blockHitWidth + this.cat.width) / 2 - 22) {
this.cat.baseY = by - this.cat.height + 10;
if (py > by - this.cat.height + 10) {
hitOn = true;
}
}
......@@ -7935,6 +8176,7 @@ var StackHigh = (function (_super) {
switch (_a.label) {
case 0:
console.log("碰撞了");
this.catShadow.visible = false;
this.needHitTest = false;
this._touchdown = false;
this.isAppearBlock = false;
......@@ -7943,7 +8185,7 @@ var StackHigh = (function (_super) {
_a.sent();
this.playZoom("out");
FYGE.Tween.get(this)
.wait(3000)
.wait(2000)
.call(function () {
_this.gameOver();
});
......@@ -8017,14 +8259,16 @@ var StackHigh = (function (_super) {
case 0:
console.log("游戏结束");
this.gamePause();
FYGE.Tween.removeAllTweens();
return [4, submitGame_1.default(this.score)];
case 1:
result = _a.sent();
if (result.success) {
if (result.data.pass) {
if (!result.data.pass) {
if (result.data.leftTimes > 0) {
ctrls_1.showPanel(GameFailPanel_1.GameFailPanel, { isAgain: true });
StackHighMain_1.GDispatcher.dispatchEvent("showBuried", { md: 36 });
StackHighMain_1.GDispatcher.dispatchEvent("showBuried", { md: 51 });
}
else {
ctrls_1.showPanel(GameFailPanel_1.GameFailPanel, { isAgain: false });
......@@ -8046,6 +8290,7 @@ var StackHigh = (function (_super) {
glodCoin: result.data.goldenCorn,
});
StackHighMain_1.GDispatcher.dispatchEvent("showBuried", { md: 35 });
StackHighMain_1.GDispatcher.dispatchEvent("showBuried", { md: 50 });
}
}
}
......@@ -8112,45 +8357,56 @@ var TimerCount = (function (_super) {
var _this = this;
var allIn = new FYGE.Container();
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);
readySvga.startAniRange(0, readySvga.totalFrames, 1, function () {
FYGE.Tween.get(_this)
.call(function () {
time3Svga.visible = true;
time3Svga.startAniRange(0, time3Svga.totalFrames, 1, function () {
time3Svga.visible = false;
});
})
.wait(1000)
.call(function () {
time2Svga.visible = true;
time2Svga.startAniRange(0, time2Svga.totalFrames, 1, function () {
time2Svga.visible = false;
});
})
.wait(1000)
.call(function () {
time1Svga.visible = true;
time1Svga.startAniRange(0, time1Svga.totalFrames, 1, function () {
time1Svga.visible = false;
var timeBg = new FYGE.Sprite(RES_1.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 = 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();
FYGE.Tween.removeTweens(self);
})
.to({ alpha: 0 }, 200)
.call(function () {
_this.removeChild(allIn);
});
});
});
}
else {
t_1.set({ alpha: 0 });
}
if (i_1 == 0) {
t_1.call(function () {
timeBg.alpha = 1;
});
}
}
};
return TimerCount;
}(FYGE.Container));
......@@ -8253,12 +8509,12 @@ var GameFailPanel = (function (_super) {
this.addChild(bg);
exports.centerImage(bg);
var isAgain = this.data.isAgain;
var title = Tools_1.Tool.getText("" + (isAgain ? "不想失去奖励" : "猫咪累了"), 38, "#333333", FYGE.TEXT_ALIGN.CENTER, 230);
var title = Tools_1.Tool.getText("" + (isAgain ? "不想失去奖励?" : "猫咪累了"), 38, "#333333", FYGE.TEXT_ALIGN.CENTER, 280);
this.addChild(title);
title.position.set(260, 820);
var getPrizeText = Tools_1.Tool.getText("" + (isAgain ? "不如再试一次" : "等等再来玩"), 32, "" + (isAgain ? "#3b8edd" : "#333333"), FYGE.TEXT_ALIGN.CENTER, 230);
title.position.set(240, 820);
var getPrizeText = Tools_1.Tool.getText("" + (isAgain ? "那再试一次吧~" : "过会儿再来陪它玩吧~"), 32, "" + (isAgain ? "#3b8edd" : "#333333"), FYGE.TEXT_ALIGN.CENTER, 400);
this.addChild(getPrizeText);
getPrizeText.position.set(260, 880);
getPrizeText.position.set(180, 880);
this.seeCat = new FYGE.Button(RES_1.RES.getRes("high_seecat.png"));
bg.addChild(this.seeCat);
exports.posImage(this.seeCat, 300, 437);
......@@ -8283,6 +8539,9 @@ var GameFailPanel = (function (_super) {
};
GameFailPanel.prototype.onClickSeeCat = function () {
if (this.againBtn.visible) {
StackHighMain_1.GDispatcher.dispatchEvent("clickBuried", { md: 51 });
}
else {
StackHighMain_1.GDispatcher.dispatchEvent("clickBuried", { md: 37 });
}
StackHighMain_1.GDispatcher.dispatchEvent("high-see-cat");
......@@ -8380,18 +8639,18 @@ var GameSuccessPanel = (function (_super) {
this.addChild(bg);
exports.centerImage(bg);
var _a = this.data, isAgain = _a.isAgain, glodCoin = _a.glodCoin;
var title = Tools_1.Tool.getText("达成目标分数", 34, "#333333", FYGE.TEXT_ALIGN.CENTER, 230);
var title = Tools_1.Tool.getText("太棒了,目标达成!", 34, "#333333", FYGE.TEXT_ALIGN.CENTER, 320);
this.addChild(title);
title.position.set(270, 800);
title.position.set(240, 800);
var getPrizeText = Tools_1.Tool.getText("获得奖励", 28, "#ff6b52", FYGE.TEXT_ALIGN.CENTER, 230);
this.addChild(getPrizeText);
getPrizeText.position.set(270, 860);
var coin = new FYGE.Sprite(RES_1.RES.getRes("high_coin.png"));
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);
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"));
bg.addChild(this.againBtn);
exports.posImage(this.againBtn, 300, 500);
......@@ -8415,6 +8674,7 @@ var GameSuccessPanel = (function (_super) {
};
GameSuccessPanel.prototype.onClickAwait = function () {
StackHighMain_1.GDispatcher.dispatchEvent("high-await");
StackHighMain_1.GDispatcher.dispatchEvent("clickBuried", { md: 50 });
this.hidePanel();
};
GameSuccessPanel.prototype.onClickShare = function () {
......@@ -8425,7 +8685,6 @@ var GameSuccessPanel = (function (_super) {
StackHighMain_1.GDispatcher.dispatchEvent("clickBuried", { md: 35 });
}
StackHighMain_1.GDispatcher.dispatchEvent("high-share");
this.hidePanel();
};
GameSuccessPanel.prototype.initEvents = function () {
_super.prototype.initEvents.call(this);
......@@ -8489,6 +8748,7 @@ var __extends = (this && this.__extends) || (function () {
Object.defineProperty(exports, "__esModule", { value: true });
var Scene_1 = __webpack_require__(/*! ../../module/views/Scene */ "./module/views/Scene.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 TimerCountMgr_1 = __webpack_require__(/*! ../Mgr/TimerCountMgr */ "./src/Mgr/TimerCountMgr.ts");
var StackHigh_1 = __webpack_require__(/*! ../game/StackHigh */ "./src/game/StackHigh.ts");
......@@ -8503,7 +8763,7 @@ var GameScenes = (function (_super) {
}
Object.defineProperty(GameScenes.prototype, "groupNames", {
get: function () {
return ["stackHigh", "catHighSvga", "hideAndSeek"];
return ["stackHigh", "catHighSvga"];
},
enumerable: true,
configurable: true
......@@ -8526,7 +8786,12 @@ var GameScenes = (function (_super) {
if (!this.game) {
this.game = new StackHigh_1.default(this);
}
TimerCountMgr_1.default.instance.drawTimerCount();
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();
}
var hidden, visibilityChange, self = this;
if (typeof document.hidden !== "undefined") {
hidden = "hidden";
......
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"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"
},
{
......@@ -17,7 +17,7 @@
"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"
}
],
......
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 { MConfigs } from "../Global/MConfigs";
import GuideMask from "../game/GuideMask";
import { GDispatcher } from "../StackHighMain";
import TimerCountMgr from "./TimerCountMgr";
// import Pot from "../game/Pot";
// import Food from "../game/Food";
......@@ -44,15 +46,20 @@ export default class GuideMgr {
private currentGuideMask: GuideMask = null;
//first
public drawFirstGuide(isEnd: boolean = false) {
public async drawFirstGuide(isEnd: boolean = false) {
DataMgr.game.pause = true;
this.currentGuideMask = new GuideMask();
this.currentGuideMask.onClick = (context) => {
//新手引导
GDispatcher.dispatchEvent("new-guide");
console.log("888")
//@ts-ignore
context.dispose();
this.currentGuideMask = null;
DataMgr.game.pause = false;
DataMgr.game.newGuideOver();
// TimerCountMgr.instance.drawTimerCount();
if (isEnd) {
this.guideFlag = false;
}
......
export const ResJson = {
"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"
},
{
......@@ -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",
"atlas": {
"cat_house.png": {
"x": 432,
"y": 1320,
"y": 1502,
"w": 205,
"h": 171,
"ox": 0,
"oy": 0,
"sw": 205,
"sh": 171,
"ro": true
"ro": false
},
"cat_jiazi.png": {
"x": 2,
"y": 3572,
"x": 432,
"y": 1283,
"w": 207,
"h": 217,
"ox": 0,
......@@ -203,19 +203,19 @@ export const ResJson = {
"ro": false
},
"cat_shadow.png": {
"x": 992,
"y": 292,
"x": 916,
"y": 1981,
"w": 96,
"h": 30,
"ox": 0,
"oy": 0,
"sw": 96,
"sh": 30,
"ro": true
"ro": false
},
"fish.png": {
"x": 982,
"y": 942,
"x": 897,
"y": 1553,
"w": 36,
"h": 107,
"ox": 0,
......@@ -225,52 +225,63 @@ export const ResJson = {
"ro": false
},
"high_cat_common.png": {
"x": 754,
"y": 1045,
"x": 432,
"y": 1908,
"w": 166,
"h": 226,
"ox": 0,
"oy": 0,
"sw": 166,
"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
},
"high_down.png": {
"x": 754,
"y": 292,
"x": 611,
"y": 1743,
"w": 236,
"h": 404,
"ox": 0,
"oy": 0,
"sw": 236,
"sh": 404,
"ro": false
"ro": true
},
"high_fish.png": {
"x": 432,
"y": 1527,
"x": 600,
"y": 2199,
"w": 160,
"h": 214,
"ox": 0,
"oy": 0,
"sw": 160,
"sh": 214,
"ro": false
"ro": true
},
"high_global_scor.png": {
"x": 754,
"y": 162,
"high_global_score.png": {
"x": 958,
"y": 136,
"w": 254,
"h": 58,
"ox": 0,
"oy": 0,
"sw": 254,
"sh": 58,
"ro": false
"ro": true
},
"high_ground.png": {
"x": 2,
"y": 1320,
"y": 1283,
"w": 2250,
"h": 428,
"ox": 0,
......@@ -280,8 +291,8 @@ export const ResJson = {
"ro": true
},
"high_hetun.png": {
"x": 754,
"y": 2,
"x": 639,
"y": 1553,
"w": 256,
"h": 158,
"ox": 0,
......@@ -291,8 +302,8 @@ export const ResJson = {
"ro": false
},
"high_pointer.png": {
"x": 432,
"y": 1743,
"x": 816,
"y": 2335,
"w": 140,
"h": 134,
"ox": 0,
......@@ -303,84 +314,84 @@ export const ResJson = {
},
"high_ready.png": {
"x": 2,
"y": 1140,
"w": 621,
"h": 178,
"y": 1137,
"w": 640,
"h": 144,
"ox": 0,
"oy": 0,
"sw": 621,
"sh": 178,
"sw": 640,
"sh": 144,
"ro": false
},
"high_score_0.png": {
"x": 805,
"y": 1213,
"x": 958,
"y": 794,
"w": 44,
"h": 65,
"ox": 4,
"oy": 1,
"sw": 50,
"sh": 67,
"ro": true
"ro": false
},
"high_score_1.png": {
"x": 982,
"y": 877,
"x": 958,
"y": 96,
"w": 38,
"h": 63,
"ox": 8,
"oy": 2,
"sw": 50,
"sh": 67,
"ro": false
"ro": true
},
"high_score_2.png": {
"x": 738,
"y": 1213,
"x": 958,
"y": 727,
"w": 44,
"h": 65,
"ox": 4,
"oy": 0,
"sw": 50,
"sh": 67,
"ro": true
"ro": false
},
"high_score_3.png": {
"x": 625,
"y": 1278,
"x": 958,
"y": 660,
"w": 44,
"h": 65,
"ox": 3,
"oy": 1,
"sw": 50,
"sh": 67,
"ro": true
"ro": false
},
"high_score_4.png": {
"x": 692,
"y": 1140,
"x": 958,
"y": 2,
"w": 46,
"h": 63,
"ox": 3,
"oy": 2,
"sw": 50,
"sh": 67,
"ro": false
"ro": true
},
"high_score_5.png": {
"x": 625,
"y": 1232,
"x": 958,
"y": 593,
"w": 44,
"h": 65,
"ox": 3,
"oy": 1,
"sw": 50,
"sh": 67,
"ro": true
"ro": false
},
"high_score_6.png": {
"x": 692,
"y": 1205,
"x": 958,
"y": 526,
"w": 44,
"h": 65,
"ox": 4,
......@@ -390,8 +401,8 @@ export const ResJson = {
"ro": false
},
"high_score_7.png": {
"x": 872,
"y": 1213,
"x": 958,
"y": 50,
"w": 44,
"h": 63,
"ox": 4,
......@@ -401,106 +412,227 @@ export const ResJson = {
"ro": true
},
"high_score_8.png": {
"x": 625,
"y": 1186,
"x": 958,
"y": 459,
"w": 44,
"h": 65,
"ox": 4,
"oy": 1,
"sw": 50,
"sh": 67,
"ro": true
"ro": false
},
"high_score_9.png": {
"x": 625,
"y": 1140,
"x": 958,
"y": 392,
"w": 44,
"h": 65,
"ox": 3,
"oy": 1,
"sw": 50,
"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": {
"x": 754,
"y": 222,
"x": 949,
"y": 1448,
"w": 252,
"h": 68,
"ox": 0,
"oy": 0,
"sw": 252,
"sh": 68,
"ro": false
"ro": true
},
"high_timer_1.png": {
"x": 692,
"y": 1272,
"x": 641,
"y": 1353,
"w": 198,
"h": 305,
"ox": 0,
"oy": 0,
"sw": 198,
"sh": 305,
"h": 306,
"ox": 73,
"oy": 12,
"sw": 330,
"sh": 330,
"ro": true
},
"high_timer_2.png": {
"x": 594,
"y": 1680,
"w": 205,
"h": 294,
"ox": 0,
"oy": 0,
"sw": 205,
"sh": 294,
"x": 644,
"y": 1137,
"w": 214,
"h": 310,
"ox": 61,
"oy": 8,
"sw": 330,
"sh": 330,
"ro": true
},
"high_timer_3.png": {
"x": 605,
"y": 1472,
"w": 206,
"h": 295,
"ox": 0,
"oy": 0,
"sw": 206,
"sh": 295,
"x": 600,
"y": 1981,
"w": 216,
"h": 314,
"ox": 57,
"oy": 8,
"sw": 330,
"sh": 330,
"ro": true
},
"high_tv.png": {
"x": 754,
"y": 877,
"x": 432,
"y": 2136,
"w": 226,
"h": 166,
"ox": 0,
"oy": 0,
"sw": 226,
"sh": 166,
"ro": false
"ro": true
},
"high_yaohaung.png": {
"x": 754,
"y": 698,
"x": 432,
"y": 1675,
"w": 177,
"h": 231,
"ox": 0,
"oy": 0,
"sw": 177,
"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
},
"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": {
"x": 2,
"y": 2,
"w": 750,
"h": 1136,
"w": 1133,
"h": 954,
"ox": 0,
"oy": 0,
"sw": 750,
"sh": 1136,
"ro": false
"oy": 409,
"sw": 1133,
"sh": 1624,
"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 { layers } from "../../module/views/layers";
import { MConst } from "../Global/MConst";
import { DataMgr } from "../Mgr/DataMgr";
const blockPng = {
catHouse: "cat_house.png",
catJiazi: "cat_jiazi.png",
......@@ -10,7 +11,8 @@ const blockPng = {
export class Block extends FYGE.Container {
public dir: -1 | 1; //叠块高度
private blockBitmap: FYGE.Sprite;
private blockName: string = "catHouse"; //叠块名
// private blockSvga: FYGE.MovieClip;
public blockName: string = "catHouse"; //叠块名
public currentScore: number = 1;
constructor() {
super();
......@@ -20,6 +22,12 @@ export class Block extends FYGE.Container {
blockBitmap.anchorY = blockBitmap.height / 2;
this.addChild(blockBitmap);
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 初始化 */
......@@ -28,11 +36,26 @@ export class Block extends FYGE.Container {
this.currentScore = id+1;
this.dir = Math.random() > 0.5 ? 1 : -1;
this.blockName = MConst.blockName[id];
this.blockBitmap.texture = RES.getRes(blockPng[this.blockName]);
console.log(this.blockName)
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]);
}
// console.log(this.blockName)
}
/** 叠块飞入 */
onMove(index) {
onMove(index,lastBlockName) {
let self = this;
this.visible = true;
this.x =
this.dir > 0
......@@ -52,6 +75,9 @@ export class Block extends FYGE.Container {
MConst.blockEnterTimer *
(Math.random() > 0.5 ? 1 : -1);
console.log("时间++", duration);
if(lastBlockName == ""){
duration = 1500;
}
// let globalX =
// this.dir > 0
// ? -this.dir * MConst.blockConfig[this.blockName][0] -
......@@ -60,7 +86,9 @@ export class Block extends FYGE.Container {
let globalX = 750 / 2 - this.blockBitmap.width / 2;
console.log("目标位置++", this.dir, globalX, 750);
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 {
}
/** 初始化 */
init({ initY }) {
this.initY = initY - 270 + 10;
this.initY = initY - 270;
this.y = this.initY;
this.jumping = false;
// this.onChange();
......@@ -107,7 +107,7 @@ export class Cat extends FYGE.Container {
}
set catStatus(v: CatStatus) {
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;
//改变SVga
this.catSvaga && this.SVGAContainer.removeChildren(this.catSvaga);
......
......@@ -40,7 +40,7 @@ export default class GuideMask extends FYGE.Container {
//描述
let descText = Tool.getText(
"看准时机,在物体飞进来的瞬间踩住\n跳到更高的地方",
"帮助猫咪跳到最高处\n它才能抓住小鱼干哦~",
30,
"#ffffff",
FYGE.TEXT_ALIGN.CENTER,
......
......@@ -54,6 +54,7 @@ export default class StackHigh extends FYGE.Container {
private isHitFish: boolean = true; //是否碰撞鱼干
public timer: number = 0;
private timing = false;
private timeLabel: FYGE.BitmapText;
constructor(parent: Scene) {
super();
......@@ -69,7 +70,7 @@ export default class StackHigh extends FYGE.Container {
GDispatcher.once("gameDead", this.gameDead, this);
//弹窗测试
// showPanel(GameFailPanel);
// showPanel(GameSuccessPanel);
//引导
GuideMgr.instance.container = parent;
......@@ -98,13 +99,13 @@ export default class StackHigh extends FYGE.Container {
//背景SVGA
let bgSVGA = new FYGE.MovieClip(RES.getRes("high_bg.svga"));
this.node.addChild(bgSVGA);
bgSVGA.startAniRange(0,bgSVGA.totalFrames,-1);
bgSVGA.startAniRange(0, bgSVGA.totalFrames, 0);
//游戏层
const gameContainer = new FYGE.Container();
gameContainer.width = 750;
gameContainer.height = 1624;
gameContainer.anchorX = layers.width / 2;
gameContainer.anchorX = 750 / 2;
gameContainer.anchorY = layers.height;
this.node.addChild(gameContainer);
this.gameContainer = gameContainer;
......@@ -127,7 +128,7 @@ export default class StackHigh extends FYGE.Container {
this.cat = new Cat();
gameContainer.addChild(this.cat);
console.log(this.cat.x);
this.cat.init({ initY: this.baseOffsetY });
this.cat.init({ initY: this.baseOffsetY+20 });
//TODO 猫咪y值
// this.cat.y = this.baseOffsetY + 30;
catShadow.y = 250 + this.cat.y - 20;
......@@ -141,15 +142,15 @@ export default class StackHigh extends FYGE.Container {
for (var i = 0; i < 10; i++)
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);
globalScore.y = 206;
globalScore.x = 180;
globalScore.x = 130;
let topScore = new FYGE.BitmapText(textures);
topScore.textAlign = FYGE.TEXT_ALIGN.CENTER;
topScore.y = 206;
topScore.x = 526;
topScore.x = 476;
topScore.text = `${MConst.options.targetScore}`; //可配置
topScore.scaleX = 0.8;
topScore.scaleY = 0.8;
......@@ -162,13 +163,55 @@ export default class StackHigh extends FYGE.Container {
var catScore = new FYGE.BitmapText(textures);
catScore.textAlign = FYGE.TEXT_ALIGN.CENTER;
catScore.y = 304;
catScore.x = 375;
catScore.x = 325;
this.catScoreLabel = catScore;
this.catScoreLabel.text = "0";
this.node.addChild(this.catScoreLabel);
this.node.mouseChildren = 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(
FYGE.MouseEvent.MOUSE_DOWN,
......@@ -182,6 +225,7 @@ export default class StackHigh extends FYGE.Container {
this.playZoom("in");
//开始倒计时
this.timing = true;
}
/**
......@@ -193,7 +237,7 @@ export default class StackHigh extends FYGE.Container {
this._score = v;
this.catScoreLabel.text = this._score + "";
//出现鱼干
if (this._score > MConst.options.targetScore - 95) {
if (this._score >= MConst.options.targetScore) {
this.createFish();
}
}
......@@ -229,9 +273,9 @@ export default class StackHigh extends FYGE.Container {
if (this.blockIndex > 0) this._posH = v;
this.gameContainer.y = this._posH;
}
/** 倒计时 */
downTimer() {
if(this.pause) return;
/** 倒计时 */
downTimer() {
if (this.pause) return;
if (this.timing) {
if (this.timer > 0) {
if (MTimer.deltaTime > 0) {
......@@ -245,6 +289,8 @@ export default class StackHigh extends FYGE.Container {
this.isAppearBlock = false;
this.gameOver();
}
let temp = Math.ceil(this.timer / 1000);
this.timeLabel.text = temp + "";
}
}
......@@ -253,22 +299,18 @@ export default class StackHigh extends FYGE.Container {
GDispatcher.dispatchEvent("game-destroy");
}
/** 倒计时结束 */
timerOver(){
timerOver() {
//是否新手引导
console.log("是否新手引导++++",GuideMgr.instance.guideFlag);
if (GuideMgr.instance.guideFlag == true && MConst.options.scheduleFinished == 1) {
GuideMgr.instance.drawFirstGuide(true);
}else{
this.createBlock();
}
console.log("是否新手引导++++", MConst.options.scheduleFinished);
this.createBlock();
}
/** 新手引导结束 */
newGuideOver(){
this.createBlock();
newGuideOver() {
TimerCountMgr.instance.drawTimerCount();
}
/** 存储上一个叠块 */
private lastBlockName = "";
/** 创建叠块 */
private createBlock() {
if (!this.isAppearBlock) return;
......@@ -285,12 +327,23 @@ export default class StackHigh extends FYGE.Container {
block.height,
this.cat.y
);
block.y = this.topY - block.height;
// 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;
}
}
this.topY = block.y;
block.onMove(this.blockIndex);
block.onMove(this.blockIndex, this.lastBlockName);
this.needHitTest = true;
this.currentBlock = block;
this.lastBlockName = block.blockName;
}
/** 创建鱼干 */
......@@ -298,14 +351,14 @@ export default class StackHigh extends FYGE.Container {
if (this.lineFish) return;
let line = new Fish();
line.init({ lineH: 300 });
this.node.addChildAt(line,2);
this.node.addChildAt(line, 2);
line.onEnterScene();
this.lineFish = line;
}
/** 按下起跳 */
async onTabScenes() {
if(this.pause) return;
if (this.pause) return;
let self = this;
this.catShadow.visible = false;
console.log("按下起跳+++", this.cat.y, this.gameContainer.y);
......@@ -326,7 +379,7 @@ export default class StackHigh extends FYGE.Container {
)
.call(() => {
resolve();
this.score += this.currentBlock.currentScore;
if (!self.pause) this.score += this.currentBlock.currentScore;
this.createBlock();
this._touchdown = true;
});
......@@ -342,7 +395,7 @@ export default class StackHigh extends FYGE.Container {
}
/** 帧检测 */
onEnterFrame() {
if(this.pause)return;
if (this.pause) return;
this.downTimer();
if (this.needHitTest) {
if (this.currentBlock) {
......@@ -352,10 +405,10 @@ export default class StackHigh extends FYGE.Container {
let blockHitWidth = this.currentBlock.width;
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);
this.cat.baseY = by - this.cat.height;
if (py > by - this.cat.height) {
this.cat.baseY = by - this.cat.height +10;
if (py > by - this.cat.height+10) {
hitOn = true;
}
}
......@@ -379,31 +432,31 @@ export default class StackHigh extends FYGE.Container {
/** 碰撞检测 */
async onHitOn(dir) {
console.log("碰撞了");
this.catShadow.visible = false;
this.needHitTest = false;
this._touchdown = false;
this.isAppearBlock = false;
await this.cat.onHitAway(dir);
this.playZoom("out");
FYGE.Tween.get(this)
.wait(2000)
.call(() => {
this.gameOver();
});
.wait(2000)
.call(() => {
this.gameOver();
});
await this.cat.onDropAway(this.posH);
}
/** 鱼干碰撞了 */
onHitFish() {
//音效
SoundMgr.instance.playSound("getFish",false);
SoundMgr.instance.playSound("getFish", false);
this.isHitFish = false;
this.lineFish.onEatFish();
this.cat.onChangeFish();
}
/** 分数+1 */
onAddCount(countY: number){
onAddCount(countY: number) {
var addCount = Tool.getText(
`+${this.currentBlock.currentScore}`,
40,
......@@ -416,10 +469,10 @@ export default class StackHigh extends FYGE.Container {
addCount.alpha = 1;
this.gameContainer.addChild(addCount);
FYGE.Tween.get(addCount)
.to({y:countY-80,alpha:0},500)
.call(() => {
addCount && this.gameContainer.removeChild(addCount);
});
.to({ y: countY - 80, alpha: 0 }, 500)
.call(() => {
addCount && this.gameContainer.removeChild(addCount);
});
}
/** 游戏暂停 */
......@@ -473,14 +526,15 @@ export default class StackHigh extends FYGE.Container {
async gameOver() {
console.log("游戏结束");
this.gamePause();
// FYGE.Tween.removeAllTweens();
FYGE.Tween.removeAllTweens();
//弹窗 TODO
const result = await submitGame(this.score);
if(result.success){
if (result.data.pass) {
if (result.success) {
if (!result.data.pass) {
if (result.data.leftTimes > 0) {
showPanel(GameFailPanel, { isAgain: true });
GDispatcher.dispatchEvent("showBuried", { md: 36 });
GDispatcher.dispatchEvent("showBuried", { md: 51 });
} else {
showPanel(GameFailPanel, { isAgain: false });
GDispatcher.dispatchEvent("showBuried", { md: 37 });
......@@ -499,6 +553,7 @@ export default class StackHigh extends FYGE.Container {
glodCoin: result.data.goldenCorn,
});
GDispatcher.dispatchEvent("showBuried", { md: 35 });
GDispatcher.dispatchEvent("showBuried", { md: 50 });
}
}
}
......
......@@ -26,47 +26,104 @@ export default class TimerCount extends FYGE.Container {
private countDown(callback: () => void) {
let allIn = new FYGE.Container();
this.addChild(allIn);
SoundMgr.instance.playSound("timeCount",false);
//加入SVGA
let readySvga = new FYGE.MovieClip(RES.getRes("high_ready.svga"));
allIn.addChild(readySvga);
readySvga.stop();
let time1Svga = new FYGE.MovieClip(RES.getRes("high_timer_1.svga"));
allIn.addChild(time1Svga);
time1Svga.stop();
let time2Svga = new FYGE.MovieClip(RES.getRes("high_timer_2.svga"));
allIn.addChild(time2Svga);
time2Svga.stop();
let time3Svga = new FYGE.MovieClip(RES.getRes("high_timer_3.svga"));
allIn.addChild(time3Svga);
time3Svga.stop();
// let readySvga = new FYGE.MovieClip(RES.getRes("high_ready.svga"));
// allIn.addChild(readySvga);
// readySvga.stop();
// let time1Svga = new FYGE.MovieClip(RES.getRes("high_timer_1.svga"));
// allIn.addChild(time1Svga);
// time1Svga.stop();
// let time2Svga = new FYGE.MovieClip(RES.getRes("high_timer_2.svga"));
// allIn.addChild(time2Svga);
// time2Svga.stop();
// let time3Svga = new FYGE.MovieClip(RES.getRes("high_timer_3.svga"));
// allIn.addChild(time3Svga);
// time3Svga.stop();
time1Svga.visible = time2Svga.visible = time3Svga.visible = false;
//倒计时音效
SoundMgr.instance.playSound("timeCount",false);
readySvga.startAniRange(0, readySvga.totalFrames, 1, () => {
FYGE.Tween.get(this)
.call(() => {
time3Svga.visible = true;
time3Svga.startAniRange(0, time3Svga.totalFrames, 1, () => {
time3Svga.visible = false;
});
})
.wait(1000)
.call(() => {
time2Svga.visible = true;
time2Svga.startAniRange(0, time2Svga.totalFrames, 1, () => {
time2Svga.visible = false;
});
// time1Svga.visible = time2Svga.visible = time3Svga.visible = false;
// //倒计时音效
// readySvga.startAniRange(0, readySvga.totalFrames, 1, () => {
// FYGE.Tween.get(this)
// .call(() => {
// time3Svga.visible = true;
// time3Svga.startAniRange(0, time3Svga.totalFrames, 1, () => {
// time3Svga.visible = false;
// });
// })
// .wait(1000)
// .call(() => {
// time2Svga.visible = true;
// time2Svga.startAniRange(0, time2Svga.totalFrames, 1, () => {
// time2Svga.visible = false;
// });
// })
// .wait(1000)
// .call(() => {
// time1Svga.visible = true;
// time1Svga.startAniRange(0, time1Svga.totalFrames, 1, () => {
// time1Svga.visible = false;
// callback();
// FYGE.Tween.removeTweens(self);
// });
// });
// });
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)
.call(() => {
time1Svga.visible = true;
time1Svga.startAniRange(0, time1Svga.totalFrames, 1, () => {
time1Svga.visible = false;
callback();
FYGE.Tween.removeTweens(self);
.to({ alpha: 0 }, 200)
.call(() => {
//执行完销毁吧,浏览器自己回收吧
// allIn.destroy();
this.removeChild(allIn);
// if (getBgOn()) playBg();
});
} else {
t.set({ alpha: 0 });
}
if (i == 0) {
t.call(() => {
timeBg.alpha = 1;
});
});
}
}
}
}
......@@ -4,8 +4,8 @@ export namespace MConst {
width: 750,
height: 1624
};
export const CatJumpSpeed = 28;//貓起跳速度
export const gravity = 0.98;//下落加速度
export const CatJumpSpeed = 26;//貓起跳速度
export const gravity = 0.9;//下落加速度
export const baseTrueH = 300;//底座真实高度
export const catTrueH = 226;//猫咪真实高度
export const blockName = ["catTV","catJiazi","catHouse","catHetun"];
......@@ -18,7 +18,7 @@ export namespace MConst {
export const blockAverageH = 178;//叠块皮平均高度
export const blockInitOffsetX = 10;//滑块初始偏移量X
export const baseOffsetY = 250;//物体block偏移量
export const blockDurationRange = [500,1200];//叠块出现所需时间
export const blockDurationRange = [1100,1300];//叠块出现所需时间
export const blockAddSpeed = 20;//叠块时间递减
export const blockEnterTimer = 0.2;//叠块进入时间系数
export let options = {
......
......@@ -33,24 +33,24 @@ export class GameFailPanel extends Panel {
//描述
let title = Tool.getText(
`${isAgain ? "不想失去奖励" : "猫咪累了"}`,
`${isAgain ? "不想失去奖励?" : "猫咪累了"}`,
38,
"#333333",
FYGE.TEXT_ALIGN.CENTER,
230
280
);
this.addChild(title);
title.position.set(260, 820);
title.position.set(240, 820);
//获得奖励
let getPrizeText = Tool.getText(
`${isAgain ? "不如再试一次" : "等等再来玩"}`,
`${isAgain ? "那再试一次吧~" : "过会儿再来陪它玩吧~"}`,
32,
`${isAgain ? "#3b8edd" : "#333333"}`,
FYGE.TEXT_ALIGN.CENTER,
230
400
);
this.addChild(getPrizeText);
getPrizeText.position.set(260, 880);
getPrizeText.position.set(180, 880);
//看猫
this.seeCat = new FYGE.Button(RES.getRes("high_seecat.png"));
......@@ -86,6 +86,8 @@ export class GameFailPanel extends Panel {
//看猫咪
onClickSeeCat() {
if (this.againBtn.visible) {
GDispatcher.dispatchEvent("clickBuried", { md: 51 });
}else{
GDispatcher.dispatchEvent("clickBuried", { md: 37 });
}
GDispatcher.dispatchEvent("high-see-cat");
......
......@@ -36,18 +36,18 @@ export class GameSuccessPanel extends Panel {
//数据
const { isAgain, glodCoin } = this.data;
// var isAgain = false;
// var isAgain = false,glodCoin=77;
//描述
let title = Tool.getText(
"达成目标分数",
"太棒了,目标达成!",
34,
"#333333",
FYGE.TEXT_ALIGN.CENTER,
230
320
);
this.addChild(title);
title.position.set(270, 800);
title.position.set(240, 800);
//获得奖励
let getPrizeText = Tool.getText(
"获得奖励",
......@@ -62,7 +62,7 @@ export class GameSuccessPanel extends Panel {
//金币
let coin = new FYGE.Sprite(RES.getRes("high_coin.png"));
this.addChild(coin);
coin.position.set(315, 920);
coin.position.set(330, 920);
let coinText = Tool.getText(
`X${glodCoin}`,
......@@ -72,7 +72,7 @@ export class GameSuccessPanel extends Panel {
90
);
this.addChild(coinText);
coinText.position.set(365, 928);
coinText.position.set(360, 928);
//再来一次
this.againBtn = new FYGE.Button(RES.getRes("high_again.png"));
......@@ -105,6 +105,7 @@ export class GameSuccessPanel extends Panel {
//等等再来玩
onClickAwait() {
GDispatcher.dispatchEvent("high-await");
GDispatcher.dispatchEvent("clickBuried", { md: 50 });
this.hidePanel();
}
......@@ -116,7 +117,7 @@ export class GameSuccessPanel extends Panel {
GDispatcher.dispatchEvent("clickBuried", { md: 35 });
}
GDispatcher.dispatchEvent("high-share");
this.hidePanel();
// this.hidePanel();
}
initEvents() {
......
......@@ -11,7 +11,7 @@ import { SoundMgr } from "../Mgr/SoundMgr";
export class GameScenes extends Scene {
public game: StackHigh = null;
get groupNames() {
return ["stackHigh", "catHighSvga", "hideAndSeek"];
return ["stackHigh", "catHighSvga"];
}
initUi() {
......@@ -33,7 +33,12 @@ export class GameScenes extends Scene {
if (!this.game) {
this.game = new StackHigh(this);
}
TimerCountMgr.instance.drawTimerCount();
if (MConst.options.scheduleFinished == 0) {
GuideMgr.instance.drawFirstGuide(true);
} else if (MConst.options.scheduleFinished == 1) {
TimerCountMgr.instance.drawTimerCount();
}
//设置隐藏属性和改变可见属性的事件的名称
let hidden: 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