Commit 2c83eaea authored by rockyl's avatar rockyl

优化消消乐

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