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
53d09435
Commit
53d09435
authored
Feb 20, 2022
by
智慧
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:随机生成敌机坐标
parent
ad7ed5bd
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
202 additions
and
64 deletions
+202
-64
cocos_generator.fire
assets/cocos_generator/scene/cocos_generator.fire
+8
-64
enemyManager.ts
assets/cocos_generator/script/enemyManager.ts
+21
-0
enemyManager.ts.meta
assets/cocos_generator/script/enemyManager.ts.meta
+9
-0
enemy.prefab
assets/cocos_generator/textures/enemy.prefab
+156
-0
enemy.prefab.meta
assets/cocos_generator/textures/enemy.prefab.meta
+8
-0
No files found.
assets/cocos_generator/scene/cocos_generator.fire
View file @
53d09435
...
@@ -777,7 +777,7 @@
...
@@ -777,7 +777,7 @@
},
},
{
{
"__type__": "cc.Node",
"__type__": "cc.Node",
"_name": "enemy",
"_name": "enemy
Manager
",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 1
"__id__": 1
...
@@ -787,12 +787,6 @@
...
@@ -787,12 +787,6 @@
"_components": [
"_components": [
{
{
"__id__": 21
"__id__": 21
},
{
"__id__": 22
},
{
"__id__": 23
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -806,8 +800,8 @@
...
@@ -806,8 +800,8 @@
},
},
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
"width":
51
,
"width":
0
,
"height":
38
"height":
0
},
},
"_anchorPoint": {
"_anchorPoint": {
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
...
@@ -841,69 +835,19 @@
...
@@ -841,69 +835,19 @@
"_is3DNode": false,
"_is3DNode": false,
"_groupIndex": 0,
"_groupIndex": 0,
"groupIndex": 0,
"groupIndex": 0,
"_id": "
5cdVHfYv9H8IDA7WFeGcrZ
"
"_id": "
e0xutPt5NAa7v9YNOOp+Lg
"
},
},
{
{
"__type__": "c
c.Sprite
",
"__type__": "c
8b4aZ/YolJe6S3VI9U49K3
",
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 20
"__id__": 20
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"enemyPre": {
{
"__uuid__": "2d5bd71d-83bc-495b-b587-33b5cf01281b"
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "5c693fcc-43f6-4f16-b3b7-55672662654a"
},
},
"_type": 0,
"_id": "3duspBSzBGLJD3AvOCutAq"
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "572uE6ztZLIYUz2tX5toAL"
},
{
"__type__": "cc.BoxCollider",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 20
},
"_enabled": true,
"tag": 1,
"_offset": {
"__type__": "cc.Vec2",
"x": 0,
"y": 1.9
},
"_size": {
"__type__": "cc.Size",
"width": 43.4,
"height": 32.3
},
"_id": "240JwdjLVGvLFBHWtOcYww"
},
{
"__type__": "e4cffTABZpCL58N/un/x4eE",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 20
},
"_enabled": true,
"_id": "4aLf5u87xPfJogtnzuJXnP"
}
}
]
]
\ No newline at end of file
assets/cocos_generator/script/enemyManager.ts
0 → 100644
View file @
53d09435
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
@
ccclass
export
default
class
EnemyManager
extends
cc
.
Component
{
//敌机预设体
@
property
(
cc
.
Prefab
)
enemyPre
:
cc
.
Prefab
=
null
;
start
()
{
this
.
schedule
(()
=>
{
let
enemy
=
cc
.
instantiate
(
this
.
enemyPre
);
enemy
.
setParent
(
cc
.
director
.
getScene
());
enemy
.
y
=
this
.
node
.
y
;
enemy
.
x
=
Math
.
random
()
*
324
+
20
;
},
2
);
//实例化预设体
}
// update (dt) {}
}
assets/cocos_generator/script/enemyManager.ts.meta
0 → 100644
View file @
53d09435
{
"ver": "1.0.8",
"uuid": "c8b4a67f-6289-497b-a4b7-548f54e3d2b7",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
assets/cocos_generator/textures/enemy.prefab
0 → 100644
View file @
53d09435
[
{
"__type__": "cc.Prefab",
"_name": "",
"_objFlags": 0,
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"asyncLoadAssets": false,
"readonly": false
},
{
"__type__": "cc.Node",
"_name": "enemy",
"_objFlags": 0,
"_parent": null,
"_children": [],
"_active": true,
"_components": [
{
"__id__": 2
},
{
"__id__": 3
},
{
"__id__": 4
}
],
"_prefab": {
"__id__": 5
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 51,
"height": 38
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
152.312,
683.293,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "5c693fcc-43f6-4f16-b3b7-55672662654a"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.BoxCollider",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"tag": 1,
"_offset": {
"__type__": "cc.Vec2",
"x": 0,
"y": 1.9
},
"_size": {
"__type__": "cc.Size",
"width": 43.4,
"height": 32.3
},
"_id": ""
},
{
"__type__": "e4cffTABZpCL58N/un/x4eE",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "",
"sync": false
}
]
\ No newline at end of file
assets/cocos_generator/textures/enemy.prefab.meta
0 → 100644
View file @
53d09435
{
"ver": "1.2.9",
"uuid": "2d5bd71d-83bc-495b-b587-33b5cf01281b",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"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