Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Plane_Fight
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
Plane_Fight
Commits
ad7ed5bd
Commit
ad7ed5bd
authored
Feb 20, 2022
by
智慧
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:添加一点儿敌机死亡效果
parent
a090e283
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
4 deletions
+59
-4
cocos_generator.fire
assets/cocos_generator/scene/cocos_generator.fire
+2
-2
enemyControl.ts
assets/cocos_generator/scene/enemyControl.ts
+21
-2
enemy1_die.png
assets/cocos_generator/textures/enemy1_die.png
+0
-0
enemy1_die.png.meta
assets/cocos_generator/textures/enemy1_die.png.meta
+36
-0
No files found.
assets/cocos_generator/scene/cocos_generator.fire
View file @
ad7ed5bd
...
...
@@ -818,8 +818,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
15
4.476
,
509.117
,
15
2.312
,
683.293
,
0,
0,
0,
...
...
assets/cocos_generator/scene/enemyControl.ts
View file @
ad7ed5bd
...
...
@@ -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
);
}
}
assets/cocos_generator/textures/enemy1_die.png
0 → 100644
View file @
ad7ed5bd
3.84 KB
assets/cocos_generator/textures/enemy1_die.png.meta
0 → 100644
View file @
ad7ed5bd
{
"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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment