Commit ad7ed5bd authored by 智慧's avatar 智慧

feat:添加一点儿敌机死亡效果

parent a090e283
......@@ -818,8 +818,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
154.476,
509.117,
152.312,
683.293,
0,
0,
0,
......
......@@ -3,15 +3,34 @@ const {ccclass, property} = cc._decorator;
@ccclass
export default class EnemyControl extends cc.Component {
//是否死亡
isDie : boolean = false;
start () {
}
update (dt) {}
update (dt) {
if (this.isDie == false) {
// 移动
this.node.y -= 300 * dt;
}
if (this.node.y < - 700) {
this.node.destroy();
}
}
//死亡
die() {
this.isDie = true;
//动态加载图片
// cc.loader.loadRes("enemy1_die", cc.SpriteFrame, (err, res) => {
// this.node.getComponent(cc.Sprite).spriteFrame = res;
// });
// 300毫秒后销毁
setTimeout(() => {
this.node.destroy();
}, 300);
}
}
{
"ver": "2.3.5",
"uuid": "465db448-d2aa-49cb-84eb-be22d59815ed",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 57,
"height": 51,
"platformSettings": {},
"subMetas": {
"enemy1_die": {
"ver": "1.0.4",
"uuid": "2a2f2599-24ee-4b0c-9455-103f981e1e08",
"rawTextureUuid": "465db448-d2aa-49cb-84eb-be22d59815ed",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": -2.5,
"trimX": 3,
"trimY": 5,
"width": 51,
"height": 46,
"rawWidth": 57,
"rawHeight": 51,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
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