Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
TNGD_CaveCruiser
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
SparkProjects
TNGD_CaveCruiser
Commits
f8fd2e42
Commit
f8fd2e42
authored
Sep 02, 2024
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
上传
parent
520ca91d
Changes
28
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
1361 additions
and
990 deletions
+1361
-990
MainGame.scene
assets/Bundles/MainGame/MainGame.scene
+526
-369
1.jpg.meta
assets/Bundles/MainGame/bg/1.jpg.meta
+3
-95
2.jpg.meta
assets/Bundles/MainGame/bg/2.jpg.meta
+7
-98
3.jpg.meta
assets/Bundles/MainGame/bg/3.jpg.meta
+7
-98
4.jpg.meta
assets/Bundles/MainGame/bg/4.jpg.meta
+7
-98
5.jpg.meta
assets/Bundles/MainGame/bg/5.jpg.meta
+7
-98
6.jpg.meta
assets/Bundles/MainGame/bg/6.jpg.meta
+7
-98
Wall2.mtl
assets/Bundles/MainGame/material/Wall2.mtl
+102
-0
Wall2.mtl.meta
assets/Bundles/MainGame/material/Wall2.mtl.meta
+1
-0
Wall2.prefab
assets/Bundles/MainGame/prefab/Wall2.prefab
+622
-0
Wall2.prefab.meta
assets/Bundles/MainGame/prefab/Wall2.prefab.meta
+13
-0
Bg.ts
assets/Scripts/Scenes/MainGame/Bg.ts
+2
-2
Config.ts
assets/Scripts/Scenes/MainGame/Config.ts
+0
-19
MainGame.ts
assets/Scripts/Scenes/MainGame/MainGame.ts
+48
-15
test.meta
assets/test.meta
+9
-0
飞球色块.meta
assets/test/飞球色块.meta
+0
-0
1.png
assets/test/飞球色块/1.png
+0
-0
1.png.meta
assets/test/飞球色块/1.png.meta
+0
-0
2.png
assets/test/飞球色块/2.png
+0
-0
2.png.meta
assets/test/飞球色块/2.png.meta
+0
-0
3.png
assets/test/飞球色块/3.png
+0
-0
3.png.meta
assets/test/飞球色块/3.png.meta
+0
-0
4.png
assets/test/飞球色块/4.png
+0
-0
4.png.meta
assets/test/飞球色块/4.png.meta
+0
-0
5.png
assets/test/飞球色块/5.png
+0
-0
5.png.meta
assets/test/飞球色块/5.png.meta
+0
-0
6.png
assets/test/飞球色块/6.png
+0
-0
6.png.meta
assets/test/飞球色块/6.png.meta
+0
-0
No files found.
assets/Bundles/MainGame/MainGame.scene
View file @
f8fd2e42
This diff is collapsed.
Click to expand it.
assets/Bundles/MainGame/bg/1.jpg.meta
View file @
f8fd2e42
...
...
@@ -20,8 +20,8 @@
"imageUuidOrDatabaseUri": "5cd68bd9-12b8-4f3a-8561-6f04bee36fab",
"isUuid": true,
"visible": false,
"minfilter": "
linear
",
"magfilter": "
linear
",
"minfilter": "
nearest
",
"magfilter": "
nearest
",
"mipfilter": "none",
"anisotropy": 0
},
...
...
@@ -31,102 +31,10 @@
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "5cd68bd9-12b8-4f3a-8561-6f04bee36fab@f9941",
"displayName": "1",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 8583,
"height": 2112,
"rawWidth": 8583,
"rawHeight": 2112,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-4291.5,
-1056,
0,
4291.5,
-1056,
0,
-4291.5,
1056,
0,
4291.5,
1056,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
2112,
8583,
2112,
0,
0,
8583,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-4291.5,
-1056,
0
],
"maxPos": [
4291.5,
1056,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "5cd68bd9-12b8-4f3a-8561-6f04bee36fab@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "
sprite-fram
e",
"type": "
textur
e",
"hasAlpha": false,
"fixAlphaTransparencyArtifacts": false,
"redirect": "5cd68bd9-12b8-4f3a-8561-6f04bee36fab@6c48a",
...
...
assets/Bundles/MainGame/bg/2.jpg.meta
View file @
f8fd2e42
...
...
@@ -15,13 +15,13 @@
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "
clamp-to-edge
",
"wrapModeT": "
clamp-to-edge
",
"wrapModeS": "
mirrored-repeat
",
"wrapModeT": "
mirrored-repeat
",
"imageUuidOrDatabaseUri": "ddac7794-c7a4-48c5-af61-9b423244cd56",
"isUuid": true,
"visible": false,
"minfilter": "
linear
",
"magfilter": "
linear
",
"minfilter": "
nearest
",
"magfilter": "
nearest
",
"mipfilter": "none",
"anisotropy": 0
},
...
...
@@ -31,104 +31,13 @@
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "ddac7794-c7a4-48c5-af61-9b423244cd56@f9941",
"displayName": "2",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 8583,
"height": 2112,
"rawWidth": 8583,
"rawHeight": 2112,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-4291.5,
-1056,
0,
4291.5,
-1056,
0,
-4291.5,
1056,
0,
4291.5,
1056,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
2112,
8583,
2112,
0,
0,
8583,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-4291.5,
-1056,
0
],
"maxPos": [
4291.5,
1056,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "ddac7794-c7a4-48c5-af61-9b423244cd56@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "
sprite-fram
e",
"type": "
textur
e",
"hasAlpha": false,
"fixAlphaTransparencyArtifacts": false,
"redirect": "ddac7794-c7a4-48c5-af61-9b423244cd56@6c48a"
"redirect": "ddac7794-c7a4-48c5-af61-9b423244cd56@6c48a",
"flipVertical": false
}
}
assets/Bundles/MainGame/bg/3.jpg.meta
View file @
f8fd2e42
...
...
@@ -15,13 +15,13 @@
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "
clamp-to-edge
",
"wrapModeT": "
clamp-to-edge
",
"wrapModeS": "
mirrored-repeat
",
"wrapModeT": "
mirrored-repeat
",
"imageUuidOrDatabaseUri": "e2d279b1-9efa-4892-9fda-ec634890607a",
"isUuid": true,
"visible": false,
"minfilter": "
linear
",
"magfilter": "
linear
",
"minfilter": "
nearest
",
"magfilter": "
nearest
",
"mipfilter": "none",
"anisotropy": 0
},
...
...
@@ -31,104 +31,13 @@
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "e2d279b1-9efa-4892-9fda-ec634890607a@f9941",
"displayName": "3",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 8583,
"height": 2112,
"rawWidth": 8583,
"rawHeight": 2112,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-4291.5,
-1056,
0,
4291.5,
-1056,
0,
-4291.5,
1056,
0,
4291.5,
1056,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
2112,
8583,
2112,
0,
0,
8583,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-4291.5,
-1056,
0
],
"maxPos": [
4291.5,
1056,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "e2d279b1-9efa-4892-9fda-ec634890607a@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "
sprite-fram
e",
"type": "
textur
e",
"hasAlpha": false,
"fixAlphaTransparencyArtifacts": false,
"redirect": "e2d279b1-9efa-4892-9fda-ec634890607a@6c48a"
"redirect": "e2d279b1-9efa-4892-9fda-ec634890607a@6c48a",
"flipVertical": false
}
}
assets/Bundles/MainGame/bg/4.jpg.meta
View file @
f8fd2e42
...
...
@@ -15,13 +15,13 @@
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "
clamp-to-edge
",
"wrapModeT": "
clamp-to-edge
",
"wrapModeS": "
mirrored-repeat
",
"wrapModeT": "
mirrored-repeat
",
"imageUuidOrDatabaseUri": "5f469da0-8050-49f7-b1ee-f0c22b0d417c",
"isUuid": true,
"visible": false,
"minfilter": "
linear
",
"magfilter": "
linear
",
"minfilter": "
nearest
",
"magfilter": "
nearest
",
"mipfilter": "none",
"anisotropy": 0
},
...
...
@@ -31,104 +31,13 @@
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "5f469da0-8050-49f7-b1ee-f0c22b0d417c@f9941",
"displayName": "4",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 8583,
"height": 2112,
"rawWidth": 8583,
"rawHeight": 2112,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-4291.5,
-1056,
0,
4291.5,
-1056,
0,
-4291.5,
1056,
0,
4291.5,
1056,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
2112,
8583,
2112,
0,
0,
8583,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-4291.5,
-1056,
0
],
"maxPos": [
4291.5,
1056,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "5f469da0-8050-49f7-b1ee-f0c22b0d417c@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "
sprite-fram
e",
"type": "
textur
e",
"hasAlpha": false,
"fixAlphaTransparencyArtifacts": false,
"redirect": "5f469da0-8050-49f7-b1ee-f0c22b0d417c@6c48a"
"redirect": "5f469da0-8050-49f7-b1ee-f0c22b0d417c@6c48a",
"flipVertical": false
}
}
assets/Bundles/MainGame/bg/5.jpg.meta
View file @
f8fd2e42
...
...
@@ -15,13 +15,13 @@
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "
clamp-to-edge
",
"wrapModeT": "
clamp-to-edge
",
"wrapModeS": "
mirrored-repeat
",
"wrapModeT": "
mirrored-repeat
",
"imageUuidOrDatabaseUri": "ce62197d-60bb-42b0-9956-41a4dd6d8f02",
"isUuid": true,
"visible": false,
"minfilter": "
linear
",
"magfilter": "
linear
",
"minfilter": "
nearest
",
"magfilter": "
nearest
",
"mipfilter": "none",
"anisotropy": 0
},
...
...
@@ -31,104 +31,13 @@
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "ce62197d-60bb-42b0-9956-41a4dd6d8f02@f9941",
"displayName": "5",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 8583,
"height": 2112,
"rawWidth": 8583,
"rawHeight": 2112,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-4291.5,
-1056,
0,
4291.5,
-1056,
0,
-4291.5,
1056,
0,
4291.5,
1056,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
2112,
8583,
2112,
0,
0,
8583,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-4291.5,
-1056,
0
],
"maxPos": [
4291.5,
1056,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "ce62197d-60bb-42b0-9956-41a4dd6d8f02@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "
sprite-fram
e",
"type": "
textur
e",
"hasAlpha": false,
"fixAlphaTransparencyArtifacts": false,
"redirect": "ce62197d-60bb-42b0-9956-41a4dd6d8f02@6c48a"
"redirect": "ce62197d-60bb-42b0-9956-41a4dd6d8f02@6c48a",
"flipVertical": false
}
}
assets/Bundles/MainGame/bg/6.jpg.meta
View file @
f8fd2e42
...
...
@@ -15,13 +15,13 @@
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "
clamp-to-edge
",
"wrapModeT": "
clamp-to-edge
",
"wrapModeS": "
mirrored-repeat
",
"wrapModeT": "
mirrored-repeat
",
"imageUuidOrDatabaseUri": "69e69ee3-3317-4297-ba6d-9e4689622de0",
"isUuid": true,
"visible": false,
"minfilter": "
linear
",
"magfilter": "
linear
",
"minfilter": "
nearest
",
"magfilter": "
nearest
",
"mipfilter": "none",
"anisotropy": 0
},
...
...
@@ -31,104 +31,13 @@
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "69e69ee3-3317-4297-ba6d-9e4689622de0@f9941",
"displayName": "6",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 8583,
"height": 2112,
"rawWidth": 8583,
"rawHeight": 2112,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-4291.5,
-1056,
0,
4291.5,
-1056,
0,
-4291.5,
1056,
0,
4291.5,
1056,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
2112,
8583,
2112,
0,
0,
8583,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-4291.5,
-1056,
0
],
"maxPos": [
4291.5,
1056,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "69e69ee3-3317-4297-ba6d-9e4689622de0@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "
sprite-fram
e",
"type": "
textur
e",
"hasAlpha": false,
"fixAlphaTransparencyArtifacts": false,
"redirect": "69e69ee3-3317-4297-ba6d-9e4689622de0@6c48a"
"redirect": "69e69ee3-3317-4297-ba6d-9e4689622de0@6c48a",
"flipVertical": false
}
}
assets/Bundles/MainGame/material/Wall2.mtl
0 → 100644
View file @
f8fd2e42
{
"__type__": "cc.Material",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"_effectAsset": {
"__uuid__": "c8f66d17-351a-48da-a12c-0212d28575c4",
"__expectedType__": "cc.EffectAsset"
},
"_techIdx": 0,
"_defines": [
{
"USE_INSTANCING": true
},
{},
{},
{},
{},
{}
],
"_states": [
{
"rasterizerState": {},
"depthStencilState": {},
"blendState": {
"targets": [
{}
]
}
},
{
"rasterizerState": {},
"depthStencilState": {},
"blendState": {
"targets": [
{}
]
}
},
{
"rasterizerState": {},
"depthStencilState": {},
"blendState": {
"targets": [
{}
]
}
},
{
"rasterizerState": {},
"depthStencilState": {},
"blendState": {
"targets": [
{}
]
}
},
{
"rasterizerState": {},
"depthStencilState": {},
"blendState": {
"targets": [
{}
]
}
},
{
"rasterizerState": {},
"depthStencilState": {},
"blendState": {
"targets": [
{}
]
}
}
],
"_props": [
{
"roughness": 1,
"specularIntensity": 0,
"emissive": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"emissiveScale": {
"__type__": "cc.Vec3",
"x": 0.025,
"y": 0.025,
"z": 0.025
}
},
{},
{},
{},
{},
{}
]
}
\ No newline at end of file
assets/Bundles/MainGame/material/Wall2.mtl.meta
0 → 100644
View file @
f8fd2e42
{"ver":"1.0.21","importer":"material","imported":true,"uuid":"70aede3c-4375-42c6-abc9-54a869f7adba","files":[".json"],"subMetas":{},"userData":{}}
assets/Bundles/MainGame/prefab/Wall2.prefab
0 → 100644
View file @
f8fd2e42
This diff is collapsed.
Click to expand it.
assets/Bundles/MainGame/prefab/Wall2.prefab.meta
0 → 100644
View file @
f8fd2e42
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "50650cb7-af92-4041-93d7-e8d9a7fa446d",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "Wall2"
}
}
assets/Scripts/Scenes/MainGame/Bg.ts
View file @
f8fd2e42
...
...
@@ -22,8 +22,8 @@ export class Bg extends Component {
}
update
(
dt
:
number
)
{
this
.
node
.
setPosition
(
0
,
-
this
.
camera
.
position
.
y
,
this
.
initZ
);
this
.
material
.
setProperty
(
this
.
camera
.
position
&&
this
.
node
.
setPosition
(
0
,
-
this
.
camera
.
position
.
y
,
this
.
initZ
);
this
.
player
.
position
&&
this
.
material
.
setProperty
(
'tilingOffset'
,
v4
(
1
,
1
,
-
this
.
player
.
position
.
z
/
100
,
0
)
);
...
...
assets/Scripts/Scenes/MainGame/Config.ts
View file @
f8fd2e42
import
{
color
,
Color
}
from
"cc"
;
export
const
MainColor
=
[
new
Color
().
fromHEX
(
0x0022D1
),
new
Color
().
fromHEX
(
0x17328c
),
];
let
mainColor
=
MainColor
.
splice
(
0
,
1
)[
0
];
export
function
randomManColor
()
{
const
index
=
Math
.
floor
(
Math
.
random
()
*
MainColor
.
length
);
mainColor
=
MainColor
.
splice
(
index
,
1
,
mainColor
)[
0
];
return
mainColor
;
}
export
enum
PROP_TYPE
{
LIGHT
,
RING
,
}
\ No newline at end of file
assets/Scripts/Scenes/MainGame/MainGame.ts
View file @
f8fd2e42
...
...
@@ -9,27 +9,36 @@ import {
instantiate
,
ITriggerEvent
,
Label
,
lerp
,
Light
,
Light
,
MeshRenderer
,
Node
,
ParticleSystem
,
ParticleSystemComponent
,
PhysicsSystem
,
PointToPointConstraint
,
Prefab
,
RigidBody
,
RigidBody
,
Texture2D
,
Tween
,
tween
,
v3
,
Vec3
,
}
from
"cc"
;
import
Scene
from
"db://assets/Module/Scene"
;
import
{
ImprovedNoise
}
from
"../../Utils/ImprovedNoise"
;
import
{
Wall
}
from
"./Wall"
;
import
{
sleep
}
from
"../../Utils/Utils"
;
import
{
randomManColor
}
from
"./Config"
;
import
GameMgr
from
"../../GameMgr"
;
const
{
ccclass
,
property
}
=
_decorator
;
@
ccclass
(
`BgAndColor`
)
class
BgAndColor
{
@
property
({
type
:
Texture2D
})
bg
:
Texture2D
=
null
;
@
property
({
type
:
Color
})
color
:
Color
=
Color
.
clone
(
Color
.
WHITE
);
}
@
ccclass
(
"MainGame"
)
export
class
MainGame
extends
Scene
{
static
bundle
:
string
=
"MainGame"
;
...
...
@@ -47,6 +56,7 @@ export class MainGame extends Scene {
@
property
(
Node
)
initWall
:
Node
=
null
;
@
property
(
Prefab
)
wallPrefab
:
Prefab
=
null
;
@
property
(
Prefab
)
wallPrefab2
:
Prefab
=
null
;
@
property
(
Prefab
)
crushPrefab
:
Prefab
=
null
;
...
...
@@ -55,6 +65,11 @@ export class MainGame extends Scene {
@
property
({
type
:
Label
,
group
:
"UI"
})
scoreLabel
:
Label
=
null
;
@
property
({
type
:
Node
,
group
:
"UI"
})
hitTip
:
Node
=
null
;
@
property
({
type
:
Node
})
bg
:
Node
=
null
;
@
property
({
type
:
[
BgAndColor
],
visible
:
true
,
displayName
:
`背景和颜色`
})
private
bgAndColor
:
BgAndColor
[]
=
[];
private
_propScore
:
number
=
0
;
set
propScore
(
value
:
number
)
{
this
.
_propScore
=
value
;
...
...
@@ -78,8 +93,6 @@ export class MainGame extends Scene {
isTouch
=
false
;
pNoise
:
ImprovedNoise
=
new
ImprovedNoise
();
wallArr
:
Node
[]
=
[];
maxZ
=
0
;
...
...
@@ -100,7 +113,10 @@ export class MainGame extends Scene {
playerCollider
.
on
(
"onCollisionEnter"
,
this
.
onPlayerCollision
,
this
);
playerCollider
.
on
(
'onTriggerEnter'
,
this
.
onTriggerEnter
,
this
);
this
.
lightColor
=
Color
.
clone
(
this
.
light
.
color
);
this
.
mainColor
=
this
.
bgAndColor
.
splice
(
0
,
1
)[
0
];
this
.
bg
.
getComponent
(
MeshRenderer
).
material
.
setProperty
(
"mainTexture"
,
this
.
mainColor
.
bg
);
this
.
light
.
color
=
Color
.
clone
(
this
.
mainColor
.
color
);
this
.
lightColor
=
Color
.
clone
(
this
.
mainColor
.
color
);
this
.
playerBody
=
this
.
player
.
getComponent
(
RigidBody
);
this
.
playerConstraint
=
this
.
linkPoint
.
getComponent
(
PointToPointConstraint
);
...
...
@@ -113,14 +129,24 @@ export class MainGame extends Scene {
this
.
wallArr
[
i
]
=
this
.
createCube
(
4
-
i
);
}
for
(
let
i
=
5
;
i
<=
1
0
;
i
++
)
{
for
(
let
i
=
5
;
i
<=
1
1
;
i
++
)
{
this
.
wallArr
[
i
]
=
this
.
createCube
();
}
}
onDestroy
()
{
this
.
playerConstraint
.
connectedBody
=
null
;
this
.
playerConstraint
.
enabled
=
false
;
this
.
linkPoint
.
destroy
();
// this.playerConstraint.connectedBody = null;
// this.playerConstraint.enabled = false;
}
mainColor
:
BgAndColor
=
null
;
randomMainColor
()
{
const
index
=
Math
.
floor
(
Math
.
random
()
*
this
.
bgAndColor
.
length
);
this
.
mainColor
=
this
.
bgAndColor
.
splice
(
index
,
1
,
this
.
mainColor
)[
0
];
return
this
.
mainColor
;
}
isOver
:
boolean
=
false
;
...
...
@@ -141,8 +167,7 @@ export class MainGame extends Scene {
if
(
otherName
==
"光幕"
)
{
otherCollider
.
node
.
active
=
false
;
const
color
=
randomManColor
();
this
.
changeMainColor
(
color
);
this
.
changeMainColor
();
}
else
if
(
otherName
==
"圆环"
)
{
otherCollider
.
node
.
active
=
false
;
this
.
propScore
+=
10
;
...
...
@@ -174,7 +199,7 @@ export class MainGame extends Scene {
if
(
otherGroup
===
PhysicsSystem
.
PhysicsGroup
[
'Wall'
])
{
// 死了
this
.
playerBody
.
enabled
=
false
;
this
.
player
.
destroy
()
;
this
.
player
.
active
=
false
;
const
crushNode
=
instantiate
(
this
.
crushPrefab
);
this
.
node
.
addChild
(
crushNode
);
...
...
@@ -193,7 +218,11 @@ export class MainGame extends Scene {
lightTween
:
Tween
<
any
>
=
null
;
lightColor
:
Color
=
null
;
changeMainColor
(
color
:
Color
)
{
changeMainColor
()
{
this
.
randomMainColor
();
const
{
bg
,
color
}
=
this
.
mainColor
;
this
.
bg
.
getComponent
(
MeshRenderer
).
material
.
setProperty
(
"mainTexture"
,
bg
);
this
.
lightTween
?.
removeSelf
();
this
.
lightTween
=
tween
({
radio
:
0
})
.
to
(
1
,
{
radio
:
1
},
{
...
...
@@ -207,7 +236,8 @@ export class MainGame extends Scene {
}
createCube
(
z
=
this
.
wallArr
[
this
.
wallArr
.
length
-
1
].
position
.
z
-
1
)
{
const
newGroup
=
instantiate
(
this
.
wallPrefab
);
const
singular
=
z
%
2
==
0
;
const
newGroup
=
instantiate
(
singular
?
this
.
wallPrefab
:
this
.
wallPrefab2
);
this
.
node
.
addChild
(
newGroup
);
newGroup
.
setPosition
(
v3
(
0
,
Math
.
random
(),
z
));
return
newGroup
;
...
...
@@ -244,6 +274,7 @@ export class MainGame extends Scene {
const
linear
=
v3
();
this
.
playerBody
.
getLinearVelocity
(
linear
);
console
.
log
(
linear
)
linear
.
multiplyScalar
(
velocityMultiplier
);
this
.
playerBody
.
setLinearVelocity
(
linear
);
...
...
@@ -355,6 +386,8 @@ export class MainGame extends Scene {
this
.
line
.
setScale
(
1
,
lineScale
/
2
,
1
);
this
.
playerBody
.
applyForce
(
v3
(
0
,
0
,
-
10
));
}
else
{
// this.playerBody.applyForce(v3(0, 0, -10));
}
}
...
...
assets/test.meta
0 → 100644
View file @
f8fd2e42
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "ebdf37fe-a429-4125-b997-440e3fa269ab",
"files": [],
"subMetas": {},
"userData": {}
}
assets/
Bundles/MainGame
/飞球色块.meta
→
assets/
test
/飞球色块.meta
View file @
f8fd2e42
File moved
assets/
Bundles/MainGame
/飞球色块/1.png
→
assets/
test
/飞球色块/1.png
View file @
f8fd2e42
File moved
assets/
Bundles/MainGame
/飞球色块/1.png.meta
→
assets/
test
/飞球色块/1.png.meta
View file @
f8fd2e42
File moved
assets/
Bundles/MainGame
/飞球色块/2.png
→
assets/
test
/飞球色块/2.png
View file @
f8fd2e42
File moved
assets/
Bundles/MainGame
/飞球色块/2.png.meta
→
assets/
test
/飞球色块/2.png.meta
View file @
f8fd2e42
File moved
assets/
Bundles/MainGame
/飞球色块/3.png
→
assets/
test
/飞球色块/3.png
View file @
f8fd2e42
File moved
assets/
Bundles/MainGame
/飞球色块/3.png.meta
→
assets/
test
/飞球色块/3.png.meta
View file @
f8fd2e42
File moved
assets/
Bundles/MainGame
/飞球色块/4.png
→
assets/
test
/飞球色块/4.png
View file @
f8fd2e42
File moved
assets/
Bundles/MainGame
/飞球色块/4.png.meta
→
assets/
test
/飞球色块/4.png.meta
View file @
f8fd2e42
File moved
assets/
Bundles/MainGame
/飞球色块/5.png
→
assets/
test
/飞球色块/5.png
View file @
f8fd2e42
File moved
assets/
Bundles/MainGame
/飞球色块/5.png.meta
→
assets/
test
/飞球色块/5.png.meta
View file @
f8fd2e42
File moved
assets/
Bundles/MainGame
/飞球色块/6.png
→
assets/
test
/飞球色块/6.png
View file @
f8fd2e42
File moved
assets/
Bundles/MainGame
/飞球色块/6.png.meta
→
assets/
test
/飞球色块/6.png.meta
View file @
f8fd2e42
File moved
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