Commit 426cdc81 authored by zjz1994's avatar zjz1994

调整333

parent 403187b9
This diff is collapsed.
This diff is collapsed.
......@@ -12,6 +12,7 @@
function injectProps(p) {
engine.injectProp(props, p);
}
//# sourceMappingURL=props.js.map
var ObjectPool = engine.ObjectPool;
var Road = (function (_super) {
......@@ -117,6 +118,7 @@
};
return Road;
}(engine.Container));
//# sourceMappingURL=Road.js.map
function getTexture(uuid) {
return engine.Texture.from(getAssetByUUID(uuid).uuid);
......@@ -132,6 +134,7 @@
inst.source = engine.getAssetByName(name).uuid;
return inst;
}
//# sourceMappingURL=utils.js.map
var GuideLayer = (function (_super) {
tslib.__extends(GuideLayer, _super);
......@@ -175,6 +178,7 @@
};
return GuideLayer;
}(engine.Container));
//# sourceMappingURL=GuideLayer.js.map
var LoopComponent = (function (_super) {
tslib.__extends(LoopComponent, _super);
......@@ -250,6 +254,7 @@
};
return LoopComponent;
}(engine.Container));
//# sourceMappingURL=LoopComponent.js.map
var Background = (function (_super) {
tslib.__extends(Background, _super);
......@@ -325,6 +330,7 @@
};
return Background;
}(engine.Container));
//# sourceMappingURL=Background.js.map
var Pier = (function (_super) {
tslib.__extends(Pier, _super);
......@@ -395,6 +401,7 @@
};
return Pier;
}(engine.Container));
//# sourceMappingURL=Pier.js.map
var Player = (function (_super) {
tslib.__extends(Player, _super);
......@@ -472,6 +479,7 @@
};
return Player;
}(engine.Container));
//# sourceMappingURL=Player.js.map
var Strut = (function (_super) {
tslib.__extends(Strut, _super);
......@@ -571,6 +579,7 @@
};
return Strut;
}(engine.Container));
//# sourceMappingURL=Strut.js.map
var ObjectPool$1 = engine.ObjectPool;
var PoolName = 'pier';
......@@ -700,21 +709,15 @@
GameView.prototype.initLabScore = function () {
};
GameView.prototype.registerEvent = function () {
this._touchLayer.addEventListener(engine.MouseEvent.MOUSE_DOWN, this.onMouseDown, this);
this._touchLayer.addEventListener(engine.MouseEvent.MOUSE_UP, this.onMouseUp, this);
this.removeListener();
this.addEventListener(engine.MouseEvent.MOUSE_DOWN, this.onMouseDown, this);
this.addEventListener(engine.MouseEvent.MOUSE_UP, this.onMouseUp, this);
};
GameView.prototype.removeListener = function () {
this._touchLayer.removeEventListener(engine.MouseEvent.MOUSE_DOWN, this.onMouseDown, this);
this._touchLayer.removeEventListener(engine.MouseEvent.MOUSE_UP, this.onMouseUp, this);
this.removeEventListener(engine.MouseEvent.MOUSE_DOWN, this.onMouseDown, this);
this.removeEventListener(engine.MouseEvent.MOUSE_UP, this.onMouseUp, this);
};
GameView.prototype.initTouch = function () {
this._touchLayer = new engine.Rect();
this.addChild(this._touchLayer);
this._touchLayer.width = getStage().width;
this._touchLayer.height = getStage().height;
this._touchLayer.x = 0;
this._touchLayer.y = 0;
this._touchLayer.alpha = 0;
};
GameView.prototype.setScoreShow = function () {
};
......@@ -825,6 +828,7 @@
};
return GameWrapper;
}(engine.Container));
//# sourceMappingURL=GameWrapper.js.map
function index (props) {
prepareProps();
......@@ -832,6 +836,7 @@
var instance = new GameWrapper();
return instance;
}
//# sourceMappingURL=index.js.map
return index;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -31,7 +31,7 @@ export default class GameView extends engine.Container {
_player:Player;
_strut:Strut;
_touchLayer: engine.Rect;
// _touchLayer: engine.Rect;
_isTouchLayer;
// _scoreContainer;
moveX = 0;
......@@ -187,22 +187,35 @@ export default class GameView extends engine.Container {
// this._scoreContainer.addChild(this.labScore);
}
registerEvent(){
this._touchLayer.addEventListener(engine.MouseEvent.MOUSE_DOWN,this.onMouseDown,this);
this._touchLayer.addEventListener(engine.MouseEvent.MOUSE_UP,this.onMouseUp,this);
// console.log("注册mouse监听1");
this.removeListener();
// if(!this.hasEventListener(engine.MouseEvent.MOUSE_DOWN)){
// console.log("注册mouse监听2");
this.addEventListener(engine.MouseEvent.MOUSE_DOWN,this.onMouseDown,this);
// }
// if(!this.hasEventListener(engine.MouseEvent.MOUSE_UP)){
// console.log("注册mouse监听3");
this.addEventListener(engine.MouseEvent.MOUSE_UP,this.onMouseUp,this);
// }
// this._touchLayer.addEventListener(engine.MouseEvent.MOUSE_DOWN,this.onMouseDown,this);
// this._touchLayer.addEventListener(engine.MouseEvent.MOUSE_UP,this.onMouseUp,this);
}
removeListener(){
this._touchLayer.removeEventListener(engine.MouseEvent.MOUSE_DOWN,this.onMouseDown,this);
this._touchLayer.removeEventListener(engine.MouseEvent.MOUSE_UP,this.onMouseUp,this);
this.removeEventListener(engine.MouseEvent.MOUSE_DOWN,this.onMouseDown,this);
this.removeEventListener(engine.MouseEvent.MOUSE_UP,this.onMouseUp,this);
// this._touchLayer.removeEventListener(engine.MouseEvent.MOUSE_DOWN,this.onMouseDown,this);
// this._touchLayer.removeEventListener(engine.MouseEvent.MOUSE_UP,this.onMouseUp,this);
}
//触碰层
initTouch(){
this._touchLayer = new engine.Rect();
this.addChild(this._touchLayer);
this._touchLayer.width = getStage().width;
this._touchLayer.height = getStage().height;
this._touchLayer.x = 0;
this._touchLayer.y = 0;
this._touchLayer.alpha = 0;
// this._touchLayer = new engine.Rect();
// this.addChild(this._touchLayer);
// this._touchLayer.width = getStage().width;
// this._touchLayer.height = getStage().height;
// this._touchLayer.x = 0;
// this._touchLayer.y = 0;
// this._touchLayer.alpha = 0;
// this.testrevive = new engine.Label();
......
......@@ -10,7 +10,6 @@
function getTextureByName(name) {
return getTexture(engine.getAssetByName(name).uuid);
}
//# sourceMappingURL=utils.js.map
var Element = (function (_super) {
tslib.__extends(Element, _super);
......@@ -88,7 +87,6 @@
};
return Element;
}(engine.Container));
//# sourceMappingURL=Element.js.map
var ElementType;
(function (ElementType) {
......@@ -184,7 +182,6 @@
MapData.elePool = [];
return MapData;
}());
//# sourceMappingURL=MapData.js.map
var GameView = (function (_super) {
tslib.__extends(GameView, _super);
......@@ -500,40 +497,47 @@
var uprow = relerow2 - 1;
var rightcol = relecol + 1;
var leftcol = relecol - 1;
var mayeleidxs = new Array();
if (downrow < MapData.row) {
if (rightcol < MapData.col) {
mayeleidxs.push(downrow + "_" + rightcol);
var nexttype = this.getEleTypeByRc(downrow, rightcol);
if (nexttype == checktype) {
attiondata = [downrow + "_" + relecol, downrow + "_" + rightcol];
break;
}
}
if (leftcol > -1) {
mayeleidxs.push(downrow + "_" + leftcol);
var nexttype = this.getEleTypeByRc(downrow, leftcol);
if (nexttype == checktype) {
attiondata = [downrow + "_" + relecol, downrow + "_" + leftcol];
break;
}
}
}
if (uprow > -1) {
if (rightcol < MapData.col) {
mayeleidxs.push(uprow + "_" + rightcol);
var nexttype = this.getEleTypeByRc(uprow, rightcol);
if (nexttype == checktype) {
attiondata = [uprow + "_" + relecol, uprow + "_" + rightcol];
break;
}
}
if (leftcol > -1) {
mayeleidxs.push(uprow + "_" + leftcol);
}
}
for (var ir = 0; ir < mayeleidxs.length; ir++) {
var iridx = mayeleidxs[ir];
var irename = this.lattices[iridx];
if (irename) {
var irerow = Number(iridx.split("_")[0]);
var irecol = Number(iridx.split("_")[1]);
var iretype = this.getEleTypeByRc(irerow, irecol);
if (iretype == checktype) {
console.log("相邻检测到了", iridx);
attiondata = iridx;
return;
var nexttype = this.getEleTypeByRc(uprow, leftcol);
if (nexttype == checktype) {
attiondata = [uprow + "_" + relecol, uprow + "_" + leftcol];
break;
}
}
}
}
if (edatacol.length == 2) {
console.log("竖向查找", edatacol);
var releidx1 = edatarow[0];
var releidx2 = edatarow[1];
var relerow = Number(releidx1.split("_")[0]);
var relecol1 = Number(releidx1.split("_")[1]);
var relecol2 = Number(releidx2.split("_")[1]);
console.log("竖向检查啦啦啦", relerow, relecol1, relecol2);
}
}
}
......@@ -666,7 +670,6 @@
};
return GameWrapper;
}(engine.Container));
//# sourceMappingURL=GameWrapper.js.map
var props = {};
function prepareProps() {
......@@ -676,7 +679,6 @@
function injectProps(p) {
engine.injectProp(props, p);
}
//# sourceMappingURL=props.js.map
function index (props) {
prepareProps();
......@@ -684,7 +686,6 @@
var instance = new GameWrapper();
return instance;
}
//# sourceMappingURL=index.js.map
return index;
......
This diff is collapsed.
......@@ -394,43 +394,65 @@ export default class GameView extends engine.Container {
let rightcol = relecol+1;
let leftcol = relecol-1;
let mayeleidxs = new Array();
if(downrow<MapData.row){
if(rightcol<MapData.col){
mayeleidxs.push(downrow+"_"+rightcol)
let nexttype = this.getEleTypeByRc(downrow,rightcol);
if(nexttype==checktype){
attiondata = [downrow+"_"+relecol,downrow+"_"+rightcol]
break;
}
}
if(leftcol>-1){
mayeleidxs.push(downrow+"_"+leftcol);
let nexttype = this.getEleTypeByRc(downrow,leftcol);
if(nexttype==checktype){
attiondata = [downrow+"_"+relecol,downrow+"_"+leftcol];
break;
}
}
}
if(uprow>-1){
if(rightcol<MapData.col){
mayeleidxs.push(uprow+"_"+rightcol)
let nexttype = this.getEleTypeByRc(uprow,rightcol);
if(nexttype==checktype){
attiondata = [uprow+"_"+relecol,uprow+"_"+rightcol];
break;
}
}
if(leftcol>-1){
mayeleidxs.push(uprow+"_"+leftcol);
}
}
for(let ir=0;ir<mayeleidxs.length;ir++){
let iridx = mayeleidxs[ir];
let irename = this.lattices[iridx];
if(irename){
let irerow = Number(iridx.split("_")[0]);
let irecol = Number(iridx.split("_")[1]);
let iretype = this.getEleTypeByRc(irerow,irecol);
if(iretype==checktype){
console.log("相邻检测到了",iridx);
attiondata = iridx;
return;
let nexttype = this.getEleTypeByRc(uprow,leftcol);
if(nexttype==checktype){
attiondata = [uprow+"_"+relecol,uprow+"_"+leftcol];
break;
}
}
}
// for(let ir=0;ir<mayeleidxs.length;ir++){
// let iridx = mayeleidxs[ir];
// let irename = this.lattices[iridx];
// if(irename){
// let irerow = Number(iridx.split("_")[0]);
// let irecol = Number(iridx.split("_")[1]);
// let iretype = this.getEleTypeByRc(irerow,irecol);
// if(iretype==checktype){
// console.log("相邻检测到了",iridx);
// attiondata = iridx;
// return;
// }
// }
// }
}
if(edatacol.length==2){
console.log("竖向查找",edatacol);
let releidx1 = edatarow[0];
let releidx2 = edatarow[1];
let relerow = Number(releidx1.split("_")[0]);
let relecol1 = Number(releidx1.split("_")[1]);
let relecol2 = Number(releidx2.split("_")[1]);
console.log("竖向检查啦啦啦",relerow,relecol1,relecol2);
}
}
}
......
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