Commit 29b14f01 authored by zjz1994's avatar zjz1994

代码暂存

parent 4efdedb5
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -479,6 +479,7 @@
};
return Player;
}(engine.Container));
//# sourceMappingURL=Player.js.map
var Strut = (function (_super) {
tslib.__extends(Strut, _super);
......@@ -488,11 +489,9 @@
return _this;
}
Strut.prototype.init = function () {
this._strut = new engine.Rect();
this._strut = new engine.Image(getTextureByName("ganzi"));
this.addChild(this._strut);
this._strut.width = props.strutWidth;
this._strut.y = this.gany;
this._strut.fillColor = props.strutColor;
this._strut.rotation = 180;
};
Strut.prototype.onMouseDown = function (pierWidth, distance, callBack) {
......@@ -565,9 +564,7 @@
}
};
Strut.prototype.rest = function () {
this._strut.width = props.strutWidth;
this._strut.y = this.gany;
this._strut.fillColor = props.strutColor;
this._strut.rotation = 180;
this._strut.height = 0;
this._strut.visible = false;
......@@ -661,6 +658,9 @@
this.initTouch();
this.registerEvent();
}
engine.globalEvent.dispatchEvent("bjxd-game-inmove", {
"canstop": true
});
return [2];
});
});
......@@ -685,12 +685,18 @@
this.closeStrut();
this.changeBg(GameView.bgIndex);
this.startAnm();
engine.globalEvent.dispatchEvent("bjxd-game-inmove", {
"canstop": true
});
};
GameView.prototype.revive = function () {
this._player.revive();
this.startAnm();
this._isTouchLayer = true;
this.closeStrut();
engine.globalEvent.dispatchEvent("bjxd-game-inmove", {
"canstop": true
});
};
GameView.prototype.setGuide = function () {
var _this = this;
......@@ -722,6 +728,9 @@
};
GameView.prototype.onMouseDown = function () {
if (this._isTouchLayer && !this.inani) {
engine.globalEvent.dispatchEvent("bjxd-game-inmove", {
"canstop": false
});
this._isMouseDown = true;
this._strut.onMouseDown(this._road.getFristPier(), this._road.getDistance(), this.goCallBcak.bind(this));
}
......@@ -768,6 +777,9 @@
x: carx
}, props.pierMoveTime);
}
engine.globalEvent.dispatchEvent("bjxd-game-inmove", {
"canstop": true
});
this.closeStrut();
};
GameView.prototype.closeStrut = function () {
......@@ -793,7 +805,7 @@
}
};
GameView.bgIndex = 0;
GameView.speed = 10;
GameView.speed = 20;
return GameView;
}(engine.Container));
//# sourceMappingURL=GameView.js.map
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -178,6 +178,12 @@
"url": "//yun.duiba.com.cn/aurora/assets/57ad75aa036c04e13abcf32c464ff5ae37419495",
"uuid": "xiache",
"ext": ".svga"
},
{
"name": "ganzi",
"url": "//yun.duiba.com.cn/aurora/assets/501972d5960c29b7db1e476422e6fd3cb3a92c8f.png",
"uuid": "ganzi",
"ext": ".png"
}
],
"events": {
......@@ -222,6 +228,12 @@
"data": {
"score":0
}
},
"bjxd-game-inmove": {
"alias": "游戏进行状态",
"data": {
"canstop":false
}
}
}
}
......
......@@ -131,6 +131,9 @@ export default class GameView extends engine.Container {
this.initTouch();
this.registerEvent();
}
engine.globalEvent.dispatchEvent("bjxd-game-inmove",{
"canstop":true
});
}
startAnm(){
this.inani = true;
......@@ -153,6 +156,9 @@ export default class GameView extends engine.Container {
this.closeStrut();
this.changeBg(GameView.bgIndex);
this.startAnm();
engine.globalEvent.dispatchEvent("bjxd-game-inmove",{
"canstop":true
});
}
//复活
revive(){
......@@ -161,6 +167,9 @@ export default class GameView extends engine.Container {
this.startAnm();
this._isTouchLayer = true;
this.closeStrut();
engine.globalEvent.dispatchEvent("bjxd-game-inmove",{
"canstop":true
});
}
//新手引导
setGuide(){
......@@ -243,6 +252,9 @@ export default class GameView extends engine.Container {
//鼠标事件
onMouseDown(){
if(this._isTouchLayer&&!this.inani){
engine.globalEvent.dispatchEvent("bjxd-game-inmove",{
"canstop":false
});
this._isMouseDown = true;
this._strut.onMouseDown(this._road.getFristPier(),this._road.getDistance(),this.goCallBcak.bind(this));
}
......@@ -294,9 +306,11 @@ export default class GameView extends engine.Container {
engine.Tween.get(this.xiacheNode,{loop:false})
.to({
x:carx
},props.pierMoveTime);
},props.pierMoveTime)
}
engine.globalEvent.dispatchEvent("bjxd-game-inmove",{
"canstop":true
});
this.closeStrut();
}
......@@ -331,7 +345,7 @@ export default class GameView extends engine.Container {
this._road.changeBg();
}
}
static speed = 10;
static speed = 20;
changeSpeed(speed){
if(GameView.speed!=speed){
GameView.speed = speed;
......
import { props } from "../props";
import GameView from "./GameView";
import {getTextureByName} from "./utils";
export class Strut extends engine.Container{
_strut: engine.Rect;
_strut: engine.Image;
_distance;
_callBack;
gany = 1005;
init(){
this._strut = new engine.Rect();
this._strut = new engine.Image(getTextureByName("ganzi"));
this.addChild(this._strut);
this._strut.width = props.strutWidth;
// this._strut.width = props.strutWidth;
this._strut.y = this.gany;
this._strut.fillColor = props.strutColor;
// this._strut.fillColor = props.strutColor;
this._strut.rotation = 180;
}
onMouseDown(pierWidth,distance,callBack){
......@@ -99,9 +99,9 @@ export class Strut extends engine.Container{
}
}
rest(){
this._strut.width = props.strutWidth;
// this._strut.width = props.strutWidth;
this._strut.y = this.gany;
this._strut.fillColor = props.strutColor;
// this._strut.fillColor = props.strutColor;
this._strut.rotation = 180;
this._strut.height = 0;
this._strut.visible = false;
......
......@@ -39,7 +39,7 @@
//# sourceMappingURL=utils.js.map
var qietu = (function (url, type1, rows, cols, parent) { return tslib.__awaiter(void 0, void 0, void 0, function () {
var t, setimgwid, mwid1, mhei1, mwid, mhei, picarr, picnames, chax, chay, startlix, addlix, startliy, addliy, r, startx, endx, c, starty, endy, uvs, isprite, ispritename, e_1;
var t, setimgwid, mwid1, mhei1, mwid, mhei, picarr, picnames, chax, chay, startlix, addlix, startliy, addliy, txt1, r, startx, endx, c, starty, endy, uvs, isprite, ispritename, e_1;
return tslib.__generator(this, function (_a) {
switch (_a.label) {
case 0:
......@@ -68,7 +68,7 @@
})];
case 4:
_a.sent();
return [2, qietu(t, 1, rows, cols)];
return [2, qietu(t, 1, rows, cols, parent)];
case 5:
console.log('图片', t);
console.log("图片获取尺寸", mwid, mhei);
......@@ -107,6 +107,13 @@
startliy = chay / mhei;
addliy = (mwid / rows) / mhei;
}
console.log("切图准备", startlix, addlix, startliy, addliy, mwid, mhei);
txt1 = new engine.Label();
txt1.fillColor = "red";
txt1.size = 24;
txt1.text = startlix.toFixed(2) + ";" + addlix.toFixed(2) + ";" + startliy.toFixed(2) + ";" + addliy.toFixed(2) + ";" + mwid.toFixed(2) + ";" + mhei.toFixed(2) + ";";
parent.addChild(txt1);
txt1.y = -100;
for (r = 0; r < rows; r++) {
startx = startlix + addlix * r;
endx = startx + addlix;
......@@ -151,7 +158,6 @@
}
});
}); });
//# sourceMappingURL=qietu.js.map
var GameView = (function (_super) {
tslib.__extends(GameView, _super);
......@@ -543,6 +549,7 @@
};
return GameView;
}(engine.Container));
//# sourceMappingURL=GameView.js.map
var GameWrapper = (function (_super) {
tslib.__extends(GameWrapper, _super);
......
This diff is collapsed.
......@@ -68,6 +68,14 @@ export default async(url:any,type1:number, rows:number, cols:number,parent:engin
startliy = chay/mhei;
addliy = (mwid/rows)/mhei;
}
console.log("切图准备",startlix,addlix,startliy,addliy,mwid,mhei);
let txt1 = new engine.Label();
txt1.fillColor = "red";
txt1.size = 24;
txt1.text = startlix.toFixed(2)+";"+addlix.toFixed(2)+";"+startliy.toFixed(2)+";"+addliy.toFixed(2)+";"+mwid.toFixed(2)+";"+mhei.toFixed(2)+";"
parent.addChild(txt1);
txt1.y = -100;
for(let r=0;r<rows;r++){
let startx = startlix+addlix*r;
let endx = startx + addlix;
......@@ -86,6 +94,7 @@ export default async(url:any,type1:number, rows:number, cols:number,parent:engin
endx
])
let isprite = new engine.Sprite(t);
isprite.uvs = uvs;
isprite.width = mwid1;
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
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