Commit 2c83eaea authored by rockyl's avatar rockyl

优化消消乐

parent faa443a2
...@@ -12,13 +12,9 @@ ...@@ -12,13 +12,9 @@
function injectProps(p) { function injectProps(p) {
engine.injectProp(props, p); engine.injectProp(props, p);
} }
//# sourceMappingURL=props.js.map
function getTexture(uuid) {
return engine.Texture.from(getAssetByUUID(uuid).uuid);
}
function getTextureByName(name) { function getTextureByName(name) {
return getTexture(engine.getAssetByName(name).uuid); return engine.Texture.from(getAssetByName(name).uuid);
} }
function playSound(name) { function playSound(name) {
engine.playSound(engine.getAssetByName(name).uuid, { keep: true }); engine.playSound(engine.getAssetByName(name).uuid, { keep: true });
...@@ -28,7 +24,6 @@ ...@@ -28,7 +24,6 @@
inst.source = 'asset://' + engine.getAssetByName(name).uuid; inst.source = 'asset://' + engine.getAssetByName(name).uuid;
return inst; return inst;
} }
//# sourceMappingURL=utils.js.map
var Element = (function (_super) { var Element = (function (_super) {
tslib.__extends(Element, _super); tslib.__extends(Element, _super);
...@@ -153,7 +148,6 @@ ...@@ -153,7 +148,6 @@
}; };
return Element; return Element;
}(engine.Container)); }(engine.Container));
//# sourceMappingURL=Element.js.map
var ElementType; var ElementType;
(function (ElementType) { (function (ElementType) {
...@@ -397,7 +391,6 @@ ...@@ -397,7 +391,6 @@
]; ];
return MapData; return MapData;
}()); }());
//# sourceMappingURL=MapData.js.map
var boomAni = (function (_super) { var boomAni = (function (_super) {
tslib.__extends(boomAni, _super); tslib.__extends(boomAni, _super);
...@@ -477,7 +470,6 @@ ...@@ -477,7 +470,6 @@
}; };
return boomAni; return boomAni;
}(engine.Container)); }(engine.Container));
//# sourceMappingURL=boomAni.js.map
var GameView = (function (_super) { var GameView = (function (_super) {
tslib.__extends(GameView, _super); tslib.__extends(GameView, _super);
...@@ -2062,7 +2054,6 @@ ...@@ -2062,7 +2054,6 @@
}; };
return GameWrapper; return GameWrapper;
}(engine.Container)); }(engine.Container));
//# sourceMappingURL=GameWrapper.js.map
function index (props) { function index (props) {
prepareProps(); prepareProps();
...@@ -2070,7 +2061,6 @@ ...@@ -2070,7 +2061,6 @@
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.
...@@ -7,7 +7,7 @@ export function getTexture(uuid) { ...@@ -7,7 +7,7 @@ export function getTexture(uuid) {
} }
export function getTextureByName(name) { export function getTextureByName(name) {
return getTexture(engine.getAssetByName(name).uuid); return engine.Texture.from(getAssetByName(name).uuid);
} }
export function playSound(name) { export function playSound(name) {
......
...@@ -20,6 +20,7 @@ class RedPack extends engine.Image { ...@@ -20,6 +20,7 @@ class RedPack extends engine.Image {
get pos() { get pos() {
return this._pos; return this._pos;
} }
get globalPos() { get globalPos() {
return this._globalPos; return this._globalPos;
} }
...@@ -46,7 +47,7 @@ class RedPack extends engine.Image { ...@@ -46,7 +47,7 @@ class RedPack extends engine.Image {
this.x = this._pos.x += speedX; this.x = this._pos.x += speedX;
this.y = this._pos.y += speedY; this.y = this._pos.y += speedY;
this.wrapper.localToGlobal(this._pos, this._globalPos); this.parent.localToGlobal(this._pos, this._globalPos);
const {_globalPos: {x, y}} = this; const {_globalPos: {x, y}} = this;
if (y < -height || y > this.stage.height) { if (y < -height || y > this.stage.height) {
return true; return true;
...@@ -83,7 +84,7 @@ export class RedPackRain extends engine.Container { ...@@ -83,7 +84,7 @@ export class RedPackRain extends engine.Container {
engine.globalEvent.addEventListener('redpack-rain-stop', this.stop, this); engine.globalEvent.addEventListener('redpack-rain-stop', this.stop, this);
this.addEventListener(engine.Event.ENTER_FRAME, this.onEnterFrame, this); this.addEventListener(engine.Event.ENTER_FRAME, this.onEnterFrame, this);
this.addEventListener(engine.MouseEvent.CLICK, this.onTap, this); this.addEventListener(engine.MouseEvent.MOUSE_DOWN, this.onTap, this);
} }
reset() { reset() {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* Created by rockyl on 2019-11-16. * Created by rockyl on 2019-11-16.
*/ */
const toastProps = Object.assign({}, props, args); const toastProps = {...props, args};
global.gameStage.toast.show(toastProps); global.gameStage.toast.show(toastProps);
......
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