Commit 426cdc81 authored by zjz1994's avatar zjz1994

调整333

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