Commit 6dff793e authored by zhangjinzhou's avatar zhangjinzhou

事件重命名

parent b5a62234
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -41,17 +41,17 @@ function launchWithCustomModule(customModule) {
}, 100);
setTimeout(() => {
engine.globalEvent.dispatchEvent('game-create', {
engine.globalEvent.dispatchEvent('bqgame-create', {
});
}, 500);
setTimeout(() => {
engine.globalEvent.dispatchEvent('game-start', {
engine.globalEvent.dispatchEvent('bqgame-start', {
guide:true
});
}, 510);
engine.globalEvent.addEventListener('game-start', (e) => {
engine.globalEvent.addEventListener('bqgame-start', (e) => {
console.log(e.type, e.data);
});
});
......
......@@ -858,11 +858,6 @@
function CarDi(wid, hei) {
var _this = _super.call(this) || this;
engine.globalEvent.addEventListener("carDiMove", _this.carDiMove, _this);
var rect = new engine.Shape();
rect.beginFill(0xff0000, 0.5);
rect.drawRect(0, 0, wid, hei);
rect.endFill();
_this.addChild(rect);
var collider = _this.collider = _this.addComponent(RectCollider);
collider.setData(0, 0, wid, hei);
collider.group = ColliderGroup.Car;
......@@ -2733,7 +2728,7 @@
};
Game.prototype.over = function () {
this.pause = true;
engine.globalEvent.dispatchEvent("game-over", this._updateData);
engine.globalEvent.dispatchEvent("bqgame-over", this._updateData);
this.onGameOver && this.onGameOver();
};
Game.prototype.createWall = function () {
......@@ -2814,7 +2809,7 @@
}
}
if (needSend) {
engine.globalEvent.dispatchEvent("game-update", updateData);
engine.globalEvent.dispatchEvent("bqgame-update", updateData);
}
};
Game.prototype.updateMaxBallNum = function (bulletScore) {
......@@ -2898,7 +2893,7 @@
configurable: true
});
Game.prototype.onGuideDone = function () {
engine.globalEvent.dispatchEvent('game-start');
engine.globalEvent.dispatchEvent('bqgame-start');
};
Object.defineProperty(Game.prototype, "_PowerScore", {
get: function () {
......@@ -2920,28 +2915,28 @@
function ShootPlanet() {
var _this = _super.call(this) || this;
_this.game = null;
_this.ntype = "game-create";
_this.ntype = "bqgame-create";
_this.customProperty();
_this.width = 750;
_this.height = 1624;
_this.init();
engine.globalEvent.addEventListener('game-create', _this.onActive, _this);
engine.globalEvent.addEventListener('game-destroy', _this.onSleep, _this);
engine.globalEvent.addEventListener('game-revive', _this.onRevive, _this);
engine.globalEvent.addEventListener('game-pause', _this.onPause, _this);
engine.globalEvent.addEventListener('game-resume', _this.onResume, _this);
engine.globalEvent.addEventListener("game-start", _this.onStart, _this);
engine.globalEvent.addEventListener("game_reset", _this.onReset, _this);
engine.globalEvent.addEventListener('bqgame-create', _this.onActive, _this);
engine.globalEvent.addEventListener('bqgame-destroy', _this.onSleep, _this);
engine.globalEvent.addEventListener('bqgame-revive', _this.onRevive, _this);
engine.globalEvent.addEventListener('bqgame-pause', _this.onPause, _this);
engine.globalEvent.addEventListener('bqgame-resume', _this.onResume, _this);
engine.globalEvent.addEventListener("bqgame-start", _this.onStart, _this);
engine.globalEvent.addEventListener("bqgame_reset", _this.onReset, _this);
return _this;
}
ShootPlanet.prototype.changeStage = function () {
if (this.ntype == "game-create") {
if (this.ntype == "bqgame-create") {
this.onSleep();
this.ntype = "game-destroy";
this.ntype = "bqgame-destroy";
}
else {
this.onActive();
this.ntype = "game-create";
this.ntype = "bqgame-create";
}
};
ShootPlanet.prototype.onActive = function () {
......@@ -2990,6 +2985,7 @@
};
return ShootPlanet;
}(engine.Container));
//# sourceMappingURL=ShootPlanet.js.map
function index (props) {
prepareProps();
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -36,27 +36,27 @@
},
"events": {
"in": {
"game-create": {
"bqgame-create": {
"alias": "初始化游戏"
},
"game-destroy": {
"bqgame-destroy": {
"alias": "销毁游戏"
},
"game-pause": {
"bqgame-pause": {
"alias": "暂停游戏"
},
"game-resume": {
"bqgame-resume": {
"alias": "恢复游戏"
},
"game-revive": {
"bqgame-revive": {
"alias": "复活"
}
},
"out": {
"game-start": {
"bqgame-start": {
"alias": "游戏开始"
},
"game-update": {
"bqgame-update": {
"alias": "游戏更新",
"data": {
"score": "分数",
......@@ -64,7 +64,7 @@
"powerScore": "火力分数"
}
},
"game-over": {
"bqgame-over": {
"alias": "游戏结束",
"data": {
"score": "分数",
......
......@@ -13,11 +13,11 @@ export default class CarDi extends GameObject{
engine.globalEvent.addEventListener("carDiMove",this.carDiMove,this);
let rect = new engine.Shape();
rect.beginFill(0xff0000,0.5);
rect.drawRect(0,0,wid,hei);
rect.endFill();
this.addChild(rect);
// let rect = new engine.Shape();
// rect.beginFill(0xff0000,0.5);
// rect.drawRect(0,0,wid,hei);
// rect.endFill();
// this.addChild(rect);
// //rect
// console.log("rect",rect);
let collider = this.collider = this.addComponent<RectCollider>(RectCollider);
......
......@@ -241,7 +241,7 @@ export default class Game {
private over() {
this.pause = true;
engine.globalEvent.dispatchEvent("game-over", this._updateData);
engine.globalEvent.dispatchEvent("bqgame-over", this._updateData);
this.onGameOver && this.onGameOver();
}
......@@ -347,7 +347,7 @@ export default class Game {
}
}
if (needSend) {
engine.globalEvent.dispatchEvent("game-update", updateData);
engine.globalEvent.dispatchEvent("bqgame-update", updateData);
}
}
......@@ -458,7 +458,7 @@ export default class Game {
}
public onGuideDone() {
engine.globalEvent.dispatchEvent('game-start');
engine.globalEvent.dispatchEvent('bqgame-start');
}
public set _BulletScore(v: number) {
......
......@@ -17,13 +17,13 @@ export class ShootPlanet extends engine.Container {
this.height = 1624;
this.init();
engine.globalEvent.addEventListener('game-create', this.onActive, this);
engine.globalEvent.addEventListener('game-destroy', this.onSleep, this);
engine.globalEvent.addEventListener('game-revive', this.onRevive, this);
engine.globalEvent.addEventListener('game-pause', this.onPause, this);
engine.globalEvent.addEventListener('game-resume', this.onResume, this);
engine.globalEvent.addEventListener("game-start",this.onStart,this);
engine.globalEvent.addEventListener("game_reset",this.onReset,this);
engine.globalEvent.addEventListener('bqgame-create', this.onActive, this);
engine.globalEvent.addEventListener('bqgame-destroy', this.onSleep, this);
engine.globalEvent.addEventListener('bqgame-revive', this.onRevive, this);
engine.globalEvent.addEventListener('bqgame-pause', this.onPause, this);
engine.globalEvent.addEventListener('bqgame-resume', this.onResume, this);
engine.globalEvent.addEventListener("bqgame-start",this.onStart,this);
engine.globalEvent.addEventListener("bqgame_reset",this.onReset,this);
// this.testbtn = new engine.Shape();
// this.testbtn.beginFill(0xff0000,1);
......@@ -33,14 +33,14 @@ export class ShootPlanet extends engine.Container {
// this.testbtn.addEventListener(engine.MouseEvent.CLICK,this.changeStage,this);
}
//stage测试233
ntype = "game-create";
ntype = "bqgame-create";
changeStage(){
if(this.ntype=="game-create"){
if(this.ntype=="bqgame-create"){
this.onSleep();
this.ntype = "game-destroy"
this.ntype = "bqgame-destroy"
}else{
this.onActive();
this.ntype = "game-create";
this.ntype = "bqgame-create";
}
}
......
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