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
2b02b347
Commit
2b02b347
authored
Oct 09, 2024
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
上传
parent
5c6ed55e
Changes
21
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
2484 additions
and
290 deletions
+2484
-290
GuideGame.scene
assets/Bundles/MainGame/GuideGame.scene
+1658
-231
Guide1.png
assets/Bundles/MainGame/png/Guide1.png
+0
-0
Guide1.png.meta
assets/Bundles/MainGame/png/Guide1.png.meta
+134
-0
Guide2.png
assets/Bundles/MainGame/png/Guide2.png
+0
-0
Guide2.png.meta
assets/Bundles/MainGame/png/Guide2.png.meta
+134
-0
Guide3.png
assets/Bundles/MainGame/png/Guide3.png
+0
-0
Guide3.png.meta
assets/Bundles/MainGame/png/Guide3.png.meta
+134
-0
next.png
assets/Bundles/MainGame/png/next.png
+0
-0
next.png.meta
assets/Bundles/MainGame/png/next.png.meta
+134
-0
组 34.png
assets/Bundles/MainGame/png/组 34.png
+0
-0
组 34.png.meta
assets/Bundles/MainGame/png/组 34.png.meta
+134
-0
Wall2.prefab
assets/Bundles/MainGame/prefab/Wall2.prefab
+1
-0
PrizePanel.prefab
assets/Bundles/PrizePanel/PrizePanel.prefab
+6
-6
HomeScene.ts
assets/Scripts/Scenes/HomeScene.ts
+3
-5
GuideGame.ts
assets/Scripts/Scenes/MainGame/GuideGame.ts
+77
-35
GuideNode.ts
assets/Scripts/Scenes/MainGame/GuideNode.ts
+50
-0
GuideNode.ts.meta
assets/Scripts/Scenes/MainGame/GuideNode.ts.meta
+9
-0
MainGame.ts
assets/Scripts/Scenes/MainGame/MainGame.ts
+0
-6
Wall.ts
assets/Scripts/Scenes/MainGame/Wall.ts
+8
-4
packages.json
profiles/v2/editor/packages.json
+1
-1
engine.json
settings/v2/packages/engine.json
+1
-2
No files found.
assets/Bundles/MainGame/GuideGame.scene
View file @
2b02b347
This diff is collapsed.
Click to expand it.
assets/Bundles/MainGame/png/Guide1.png
0 → 100644
View file @
2b02b347
7.8 KB
assets/Bundles/MainGame/png/Guide1.png.meta
0 → 100644
View file @
2b02b347
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "b981b0f3-5cf9-42bf-9e72-224a4f6a2455",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "b981b0f3-5cf9-42bf-9e72-224a4f6a2455@6c48a",
"displayName": "Guide1",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "b981b0f3-5cf9-42bf-9e72-224a4f6a2455",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "b981b0f3-5cf9-42bf-9e72-224a4f6a2455@f9941",
"displayName": "Guide1",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 586,
"height": 163,
"rawWidth": 586,
"rawHeight": 163,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-293,
-81.5,
0,
293,
-81.5,
0,
-293,
81.5,
0,
293,
81.5,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
163,
586,
163,
0,
0,
586,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-293,
-81.5,
0
],
"maxPos": [
293,
81.5,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "b981b0f3-5cf9-42bf-9e72-224a4f6a2455@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "b981b0f3-5cf9-42bf-9e72-224a4f6a2455@6c48a"
}
}
assets/Bundles/MainGame/png/Guide2.png
0 → 100644
View file @
2b02b347
8.73 KB
assets/Bundles/MainGame/png/Guide2.png.meta
0 → 100644
View file @
2b02b347
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "317e12d4-50c1-42d7-b17c-d7a0a001bc7b",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "317e12d4-50c1-42d7-b17c-d7a0a001bc7b@6c48a",
"displayName": "Guide2",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "317e12d4-50c1-42d7-b17c-d7a0a001bc7b",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "317e12d4-50c1-42d7-b17c-d7a0a001bc7b@f9941",
"displayName": "Guide2",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 586,
"height": 163,
"rawWidth": 586,
"rawHeight": 163,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-293,
-81.5,
0,
293,
-81.5,
0,
-293,
81.5,
0,
293,
81.5,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
163,
586,
163,
0,
0,
586,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-293,
-81.5,
0
],
"maxPos": [
293,
81.5,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "317e12d4-50c1-42d7-b17c-d7a0a001bc7b@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "317e12d4-50c1-42d7-b17c-d7a0a001bc7b@6c48a"
}
}
assets/Bundles/MainGame/png/Guide3.png
0 → 100644
View file @
2b02b347
6.93 KB
assets/Bundles/MainGame/png/Guide3.png.meta
0 → 100644
View file @
2b02b347
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "5ac7c111-9ab9-4d53-976a-1be72b2cc718",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "5ac7c111-9ab9-4d53-976a-1be72b2cc718@6c48a",
"displayName": "Guide3",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "5ac7c111-9ab9-4d53-976a-1be72b2cc718",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "5ac7c111-9ab9-4d53-976a-1be72b2cc718@f9941",
"displayName": "Guide3",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 586,
"height": 163,
"rawWidth": 586,
"rawHeight": 163,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-293,
-81.5,
0,
293,
-81.5,
0,
-293,
81.5,
0,
293,
81.5,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
163,
586,
163,
0,
0,
586,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-293,
-81.5,
0
],
"maxPos": [
293,
81.5,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "5ac7c111-9ab9-4d53-976a-1be72b2cc718@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "5ac7c111-9ab9-4d53-976a-1be72b2cc718@6c48a"
}
}
assets/Bundles/MainGame/png/next.png
0 → 100644
View file @
2b02b347
1.94 KB
assets/Bundles/MainGame/png/next.png.meta
0 → 100644
View file @
2b02b347
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "62812253-e666-4efc-ad0a-d4d60e1e415c",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "62812253-e666-4efc-ad0a-d4d60e1e415c@6c48a",
"displayName": "next",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "62812253-e666-4efc-ad0a-d4d60e1e415c",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "62812253-e666-4efc-ad0a-d4d60e1e415c@f9941",
"displayName": "next",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 140,
"height": 58,
"rawWidth": 140,
"rawHeight": 58,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-70,
-29,
0,
70,
-29,
0,
-70,
29,
0,
70,
29,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
58,
140,
58,
0,
0,
140,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-70,
-29,
0
],
"maxPos": [
70,
29,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "62812253-e666-4efc-ad0a-d4d60e1e415c@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "62812253-e666-4efc-ad0a-d4d60e1e415c@6c48a"
}
}
assets/Bundles/MainGame/png/组 34.png
0 → 100644
View file @
2b02b347
138 KB
assets/Bundles/MainGame/png/组 34.png.meta
0 → 100644
View file @
2b02b347
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "2e216ba4-f0b7-49dd-a264-303eb1275af9",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "2e216ba4-f0b7-49dd-a264-303eb1275af9@6c48a",
"displayName": "组 34",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "2e216ba4-f0b7-49dd-a264-303eb1275af9",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "2e216ba4-f0b7-49dd-a264-303eb1275af9@f9941",
"displayName": "组 34",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 574,
"height": 406,
"rawWidth": 574,
"rawHeight": 406,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-287,
-203,
0,
287,
-203,
0,
-287,
203,
0,
287,
203,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
406,
574,
406,
0,
0,
574,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-287,
-203,
0
],
"maxPos": [
287,
203,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "2e216ba4-f0b7-49dd-a264-303eb1275af9@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "2e216ba4-f0b7-49dd-a264-303eb1275af9@6c48a"
}
}
assets/Bundles/MainGame/prefab/Wall2.prefab
View file @
2b02b347
...
@@ -617,6 +617,7 @@
...
@@ -617,6 +617,7 @@
"__id__": 0
"__id__": 0
},
},
"fileId": "d4iYkvxtJO87QMcNhqpzME",
"fileId": "d4iYkvxtJO87QMcNhqpzME",
"instance": null,
"targetOverrides": null
"targetOverrides": null
}
}
]
]
\ No newline at end of file
assets/Bundles/PrizePanel/PrizePanel.prefab
View file @
2b02b347
...
@@ -849,7 +849,7 @@
...
@@ -849,7 +849,7 @@
"_lpos": {
"_lpos": {
"__type__": "cc.Vec3",
"__type__": "cc.Vec3",
"x": 0,
"x": 0,
"y": -
60.11199999999994
,
"y": -
28.09050000000002
,
"z": 0
"z": 0
},
},
"_lrot": {
"_lrot": {
...
@@ -889,13 +889,13 @@
...
@@ -889,13 +889,13 @@
},
},
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
"width":
137.3142547607422
,
"width":
490
,
"height": 34.208999999999996
"height": 34.208999999999996
},
},
"_anchorPoint": {
"_anchorPoint": {
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x": 0.5,
"x": 0.5,
"y":
0.5
"y":
1
},
},
"_id": ""
"_id": ""
},
},
...
@@ -927,12 +927,12 @@
...
@@ -927,12 +927,12 @@
},
},
"_string": "prizeName",
"_string": "prizeName",
"_horizontalAlign": 1,
"_horizontalAlign": 1,
"_verticalAlign":
1
,
"_verticalAlign":
2
,
"_actualFontSize": 27.15,
"_actualFontSize": 27.15,
"_fontSize": 27.15,
"_fontSize": 27.15,
"_fontFamily": "Arial",
"_fontFamily": "Arial",
"_lineHeight": 27.15,
"_lineHeight": 27.15,
"_overflow":
0
,
"_overflow":
3
,
"_enableWrapText": true,
"_enableWrapText": true,
"_font": null,
"_font": null,
"_isSystemFontUsed": true,
"_isSystemFontUsed": true,
...
@@ -987,7 +987,7 @@
...
@@ -987,7 +987,7 @@
"_target": null,
"_target": null,
"_left": 0,
"_left": 0,
"_right": 0,
"_right": 0,
"_top": 8
55.0074999999999
,
"_top": 8
40.0905
,
"_bottom": 0,
"_bottom": 0,
"_horizontalCenter": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_verticalCenter": 0,
...
...
assets/Scripts/Scenes/HomeScene.ts
View file @
2b02b347
...
@@ -9,11 +9,10 @@ import { GuideScene } from "./GuideScene";
...
@@ -9,11 +9,10 @@ import { GuideScene } from "./GuideScene";
import
GameMgr
from
"../GameMgr"
;
import
GameMgr
from
"../GameMgr"
;
import
RankPanel
from
"../Panels/RankPanel"
;
import
RankPanel
from
"../Panels/RankPanel"
;
import
{
UIMgr
}
from
"../../Module/UIMgr"
;
import
{
UIMgr
}
from
"../../Module/UIMgr"
;
import
{
AudioMgr
}
from
"../../core_tgx/base/AudioMgr"
;
import
BackPanel
from
"../Panels/BackPanel"
;
import
BackPanel
from
"../Panels/BackPanel"
;
import
{
GuideGame
}
from
"./MainGame/GuideGame"
;
import
{
GuideGame
}
from
"./MainGame/GuideGame"
;
const
{
ccclass
,
property
}
=
_decorator
;
const
{
ccclass
,
property
}
=
_decorator
;
@
observer
@
observer
@
ccclass
(
'HomeScene'
)
@
ccclass
(
'HomeScene'
)
...
@@ -52,12 +51,11 @@ export class HomeScene extends Scene {
...
@@ -52,12 +51,11 @@ export class HomeScene extends Scene {
clickStart
=
_asyncThrottle
(
async
()
=>
{
clickStart
=
_asyncThrottle
(
async
()
=>
{
const
{
alreadyGuideSteps
,
allGuideSteps
}
=
store
.
homeInfo
;
const
{
alreadyGuideSteps
,
allGuideSteps
}
=
store
.
homeInfo
;
if
(
alreadyGuideSteps
<
allGuideSteps
)
{
if
(
alreadyGuideSteps
<
allGuideSteps
)
{
changeScene
(
GuideGame
);
changeScene
(
GuideGame
);
}
else
{
}
else
{
const
success
=
await
GameMgr
.
ins
.
start
();
const
success
=
await
GameMgr
.
ins
.
start
();
if
(
!
success
)
{
if
(
!
success
)
{
return
;
return
;
...
@@ -69,7 +67,7 @@ export class HomeScene extends Scene {
...
@@ -69,7 +67,7 @@ export class HomeScene extends Scene {
clickRule
=
_asyncThrottle
(
async
()
=>
{
clickRule
=
_asyncThrottle
(
async
()
=>
{
// showPanel(RulePanel);
// showPanel(RulePanel);
changeScene
(
Guide
Scene
,
{
from
:
"HomeScene"
}
);
changeScene
(
Guide
Game
);
});
});
clickRank
=
_asyncThrottle
(()
=>
{
clickRank
=
_asyncThrottle
(()
=>
{
...
...
assets/Scripts/Scenes/MainGame/GuideGame.ts
View file @
2b02b347
import
{
import
{
_decorator
,
_decorator
,
Button
,
Collider
,
Collider
,
Color
,
Color
,
easing
,
EPhysicsDrawFlags
,
game
,
easing
,
EPhysicsDrawFlags
,
game
,
...
@@ -28,8 +28,9 @@ import GameMgr from "../../GameMgr";
...
@@ -28,8 +28,9 @@ import GameMgr from "../../GameMgr";
import
{
AudioMgr
}
from
"../../../core_tgx/base/AudioMgr"
;
import
{
AudioMgr
}
from
"../../../core_tgx/base/AudioMgr"
;
import
{
mdEvent
}
from
"../../AppTool"
;
import
{
mdEvent
}
from
"../../AppTool"
;
import
{
BgAndColor
}
from
"./BgAndColor"
;
import
{
BgAndColor
}
from
"./BgAndColor"
;
import
{
GuideNode
}
from
"./GuideNode"
;
const
{
ccclass
,
property
}
=
_decorator
;
const
{
ccclass
,
property
}
=
_decorator
;
@
ccclass
(
"GuideGame"
)
@
ccclass
(
"GuideGame"
)
export
class
GuideGame
extends
Scene
{
export
class
GuideGame
extends
Scene
{
...
@@ -54,13 +55,16 @@ export class GuideGame extends Scene {
...
@@ -54,13 +55,16 @@ export class GuideGame extends Scene {
@
property
(
Light
)
light
:
Light
=
null
;
@
property
(
Light
)
light
:
Light
=
null
;
@
property
({
type
:
Label
,
group
:
"UI"
})
scoreLabel
:
Label
=
null
;
@
property
({
type
:
Label
,
group
:
"UI"
})
scoreLabel
:
Label
=
null
;
@
property
({
type
:
Node
,
group
:
"UI"
})
hitTip
:
Node
=
null
;
@
property
({
type
:
Node
,
group
:
"UI"
})
hitTip
:
Node
=
null
;
@
property
({
type
:
Node
})
bg
:
Node
=
null
;
@
property
({
type
:
Node
})
bg
:
Node
=
null
;
@
property
({
type
:
[
BgAndColor
],
visible
:
true
,
displayName
:
`背景和颜色`
})
@
property
({
type
:
[
BgAndColor
],
visible
:
true
,
displayName
:
`背景和颜色`
})
private
bgAndColor
:
BgAndColor
[]
=
[];
private
bgAndColor
:
BgAndColor
[]
=
[];
@
property
(
GuideNode
)
guideNode
:
GuideNode
=
null
;
private
_score
:
number
=
0
;
private
_score
:
number
=
0
;
set
score
(
value
:
number
)
{
set
score
(
value
:
number
)
{
...
@@ -79,9 +83,11 @@ export class GuideGame extends Scene {
...
@@ -79,9 +83,11 @@ export class GuideGame extends Scene {
maxZ
=
0
;
maxZ
=
0
;
scoreRadio
=
1
;
scoreRadio
=
1
;
phyUpdate
=
true
;
onLoad
()
{
onLoad
()
{
mdEvent
({
pageView
:
"gamsStart"
})
;
PhysicsSystem
.
instance
.
autoSimulation
=
false
;
const
playerCollider
=
this
.
player
.
getComponent
(
Collider
);
const
playerCollider
=
this
.
player
.
getComponent
(
Collider
);
playerCollider
.
on
(
"onCollisionEnter"
,
this
.
onPlayerCollision
,
this
);
playerCollider
.
on
(
"onCollisionEnter"
,
this
.
onPlayerCollision
,
this
);
...
@@ -105,18 +111,22 @@ export class GuideGame extends Scene {
...
@@ -105,18 +111,22 @@ export class GuideGame extends Scene {
for
(
let
i
=
5
;
i
<=
11
;
i
++
)
{
for
(
let
i
=
5
;
i
<=
11
;
i
++
)
{
this
.
wallArr
[
i
]
=
this
.
createCube
();
this
.
wallArr
[
i
]
=
this
.
createCube
();
if
(
i
==
11
)
{
const
wallTs
=
this
.
wallArr
[
i
].
getComponent
(
Wall
);
wallTs
.
createRing
(
wallTs
.
dH
);
}
}
}
// await sleep(0.5);
// await sleep(0.5);
input
.
on
(
Input
.
EventType
.
TOUCH_START
,
this
.
onTouchStart
,
this
);
input
.
on
(
Input
.
EventType
.
TOUCH_START
,
this
.
onTouchStart
,
this
);
input
.
on
(
Input
.
EventType
.
TOUCH_MOVE
,
this
.
onTouchMove
,
this
);
input
.
on
(
Input
.
EventType
.
TOUCH_END
,
this
.
onTouchEnd
,
this
);
input
.
on
(
Input
.
EventType
.
TOUCH_END
,
this
.
onTouchEnd
,
this
);
input
.
on
(
Input
.
EventType
.
TOUCH_CANCEL
,
this
.
onTouchEnd
,
this
);
input
.
on
(
Input
.
EventType
.
TOUCH_CANCEL
,
this
.
onTouchEnd
,
this
);
this
.
guideNode
.
show
(
1
);
}
}
onDestroy
()
{
onDestroy
()
{
input
.
off
(
Input
.
EventType
.
TOUCH_START
,
this
.
onTouchStart
,
this
);
input
.
off
(
Input
.
EventType
.
TOUCH_START
,
this
.
onTouchStart
,
this
);
input
.
off
(
Input
.
EventType
.
TOUCH_MOVE
,
this
.
onTouchMove
,
this
);
input
.
off
(
Input
.
EventType
.
TOUCH_END
,
this
.
onTouchEnd
,
this
);
input
.
off
(
Input
.
EventType
.
TOUCH_END
,
this
.
onTouchEnd
,
this
);
input
.
off
(
Input
.
EventType
.
TOUCH_CANCEL
,
this
.
onTouchEnd
,
this
);
input
.
off
(
Input
.
EventType
.
TOUCH_CANCEL
,
this
.
onTouchEnd
,
this
);
...
@@ -152,8 +162,8 @@ export class GuideGame extends Scene {
...
@@ -152,8 +162,8 @@ export class GuideGame extends Scene {
this
.
scoreRadio
=
1
;
this
.
scoreRadio
=
1
;
}
}
onTriggerEnter
(
event
:
ITriggerEvent
)
{
async
onTriggerEnter
(
event
:
ITriggerEvent
)
{
const
{
otherCollider
,
selfCollider
}
=
event
;
const
{
otherCollider
,
selfCollider
}
=
event
;
const
otherName
=
otherCollider
.
node
.
name
;
const
otherName
=
otherCollider
.
node
.
name
;
...
@@ -161,14 +171,25 @@ export class GuideGame extends Scene {
...
@@ -161,14 +171,25 @@ export class GuideGame extends Scene {
otherCollider
.
node
.
active
=
false
;
otherCollider
.
node
.
active
=
false
;
this
.
changeMainColor
();
this
.
changeMainColor
();
}
else
if
(
otherName
==
"圆环"
)
{
}
else
if
(
otherName
==
"圆环"
)
{
await
new
Promise
<
void
>
((
resolve
)
=>
{
this
.
phyUpdate
=
false
;
this
.
guideNode
.
show
(
3
);
this
.
guideNode
.
guide3Next
.
once
(
Button
.
EventType
.
CLICK
,
()
=>
{
this
.
phyUpdate
=
true
;
this
.
guideNode
.
hide
();
resolve
();
});
});
otherCollider
.
node
.
active
=
false
;
otherCollider
.
node
.
active
=
false
;
this
.
scoreRadio
=
2
;
this
.
scoreRadio
=
2
;
this
.
unschedule
(
this
.
scoreRadioFunc
);
this
.
unschedule
(
this
.
scoreRadioFunc
);
this
.
scheduleOnce
(
this
.
scoreRadioFunc
,
5
);
this
.
scheduleOnce
(
this
.
scoreRadioFunc
,
5
);
tween
(
this
.
hitTip
)
tween
(
this
.
hitTip
)
.
set
({
active
:
true
})
.
set
({
active
:
true
})
.
delay
(
2
)
.
delay
(
2
)
.
set
({
active
:
false
})
.
set
({
active
:
false
})
.
start
();
.
start
();
const
crushNode
=
instantiate
(
this
.
crushPrefab
);
const
crushNode
=
instantiate
(
this
.
crushPrefab
);
...
@@ -185,7 +206,7 @@ export class GuideGame extends Scene {
...
@@ -185,7 +206,7 @@ export class GuideGame extends Scene {
onPlayerCollision
(
event
:
ICollisionEvent
)
{
onPlayerCollision
(
event
:
ICollisionEvent
)
{
if
(
this
.
isOver
)
return
;
if
(
this
.
isOver
)
return
;
const
{
otherCollider
,
selfCollider
}
=
event
;
const
{
otherCollider
,
selfCollider
}
=
event
;
const
otherGroup
=
otherCollider
.
getGroup
();
const
otherGroup
=
otherCollider
.
getGroup
();
...
@@ -213,12 +234,12 @@ export class GuideGame extends Scene {
...
@@ -213,12 +234,12 @@ export class GuideGame extends Scene {
changeMainColor
()
{
changeMainColor
()
{
this
.
randomMainColor
();
this
.
randomMainColor
();
const
{
bg
,
color
}
=
this
.
mainColor
;
const
{
bg
,
color
}
=
this
.
mainColor
;
this
.
bg
.
getComponent
(
MeshRenderer
).
material
.
setProperty
(
"mainTexture"
,
bg
);
this
.
bg
.
getComponent
(
MeshRenderer
).
material
.
setProperty
(
"mainTexture"
,
bg
);
this
.
lightTween
?.
removeSelf
();
this
.
lightTween
?.
removeSelf
();
this
.
lightTween
=
tween
({
radio
:
0
})
this
.
lightTween
=
tween
({
radio
:
0
})
.
to
(
1
,
{
radio
:
1
},
{
.
to
(
1
,
{
radio
:
1
},
{
easing
:
easing
.
quadInOut
,
easing
:
easing
.
quadInOut
,
onUpdate
:
(
target
,
ratio
)
=>
{
onUpdate
:
(
target
,
ratio
)
=>
{
this
.
lightColor
.
lerp
(
color
,
ratio
);
this
.
lightColor
.
lerp
(
color
,
ratio
);
...
@@ -232,11 +253,20 @@ export class GuideGame extends Scene {
...
@@ -232,11 +253,20 @@ export class GuideGame extends Scene {
const
singular
=
z
%
2
==
0
;
const
singular
=
z
%
2
==
0
;
const
newGroup
=
instantiate
(
singular
?
this
.
wallPrefab
:
this
.
wallPrefab2
);
const
newGroup
=
instantiate
(
singular
?
this
.
wallPrefab
:
this
.
wallPrefab2
);
this
.
node
.
addChild
(
newGroup
);
this
.
node
.
addChild
(
newGroup
);
newGroup
.
setPosition
(
v3
(
0
,
Math
.
random
(),
z
));
newGroup
.
setPosition
(
v3
(
0
,
0
,
z
));
newGroup
.
getComponent
(
Wall
).
resetGuide
();
// newGroup.setPosition(v3(0, Math.random(), z));
return
newGroup
;
return
newGroup
;
}
}
onTouchStart
(
event
:
any
)
{
onTouchStart
(
event
:
any
)
{
if
(
this
.
guideNode
.
guideShow
&&
this
.
guideNode
.
guideIndex
>
1
)
{
return
;
}
if
(
this
.
isOver
)
return
;
if
(
this
.
isOver
)
return
;
this
.
isTouch
=
true
;
this
.
isTouch
=
true
;
...
@@ -276,10 +306,19 @@ export class GuideGame extends Scene {
...
@@ -276,10 +306,19 @@ export class GuideGame extends Scene {
this
.
playerBody
.
getAngularVelocity
(
angular
);
this
.
playerBody
.
getAngularVelocity
(
angular
);
angular
.
multiplyScalar
(
velocityMultiplier
);
angular
.
multiplyScalar
(
velocityMultiplier
);
this
.
playerBody
.
setAngularVelocity
(
v3
());
this
.
playerBody
.
setAngularVelocity
(
v3
());
}
onTouchMove
(
event
:
any
)
{
// 新手引导
if
(
this
.
guideNode
.
guideIndex
==
1
)
{
this
.
guideNode
.
hide
();
this
.
scheduleOnce
(()
=>
{
this
.
phyUpdate
=
false
;
this
.
guideNode
.
show
(
2
);
this
.
guideNode
.
guide2Next
.
on
(
Button
.
EventType
.
CLICK
,
()
=>
{
this
.
guideNode
.
hide
();
this
.
phyUpdate
=
true
;
});
},
0.65
);
}
}
}
onTouchEnd
(
event
:
any
)
{
onTouchEnd
(
event
:
any
)
{
...
@@ -296,13 +335,13 @@ export class GuideGame extends Scene {
...
@@ -296,13 +335,13 @@ export class GuideGame extends Scene {
{
{
lastZ
:
0
,
lastZ
:
0
,
create
:
false
,
create
:
false
,
interval
:
50
,
interval
:
1111111
,
funcName
:
"createLight"
,
funcName
:
"createLight"
,
},
},
{
{
lastZ
:
0
,
lastZ
:
0
,
create
:
false
,
create
:
false
,
interval
:
25
,
interval
:
1111111
,
funcName
:
"createRing"
,
funcName
:
"createRing"
,
},
},
]
]
...
@@ -316,7 +355,7 @@ export class GuideGame extends Scene {
...
@@ -316,7 +355,7 @@ export class GuideGame extends Scene {
const
propLen
=
this
.
propCFG
.
length
;
const
propLen
=
this
.
propCFG
.
length
;
let
create
=
false
;
let
create
=
false
;
for
(
let
i
=
0
;
i
<
propLen
;
i
++
)
{
for
(
let
i
=
0
;
i
<
propLen
;
i
++
)
{
const
{
lastZ
,
interval
}
=
this
.
propCFG
[
i
];
const
{
lastZ
,
interval
}
=
this
.
propCFG
[
i
];
const
dz
=
lastZ
-
pz
;
const
dz
=
lastZ
-
pz
;
if
(
create
)
{
if
(
create
)
{
this
.
propCFG
[
i
].
lastZ
=
pz
;
this
.
propCFG
[
i
].
lastZ
=
pz
;
...
@@ -334,10 +373,10 @@ export class GuideGame extends Scene {
...
@@ -334,10 +373,10 @@ export class GuideGame extends Scene {
this
.
wallArr
.
push
(
wall
);
this
.
wallArr
.
push
(
wall
);
const
wallTs
=
wall
.
getComponent
(
Wall
);
const
wallTs
=
wall
.
getComponent
(
Wall
);
wallTs
.
reset
();
wallTs
.
reset
Guide
();
for
(
let
i
=
0
;
i
<
propLen
;
i
++
)
{
for
(
let
i
=
0
;
i
<
propLen
;
i
++
)
{
const
{
funcName
,
create
}
=
this
.
propCFG
[
i
];
const
{
funcName
,
create
}
=
this
.
propCFG
[
i
];
if
(
create
)
{
if
(
create
)
{
this
.
propCFG
[
i
].
create
=
false
;
this
.
propCFG
[
i
].
create
=
false
;
wallTs
[
funcName
]();
wallTs
[
funcName
]();
...
@@ -365,14 +404,17 @@ export class GuideGame extends Scene {
...
@@ -365,14 +404,17 @@ export class GuideGame extends Scene {
}
}
protected
lateUpdate
(
dt
:
number
)
{
protected
lateUpdate
(
dt
:
number
)
{
// PhysicsSystem.instance.physicsWorld.syncSceneToPhysics();
//
if
(
!
this
.
phyUpdate
)
return
;
// // PhysicsSystem.instance.fixedTimeStep = dt;
// // PhysicsSystem.instance.update(dt);
PhysicsSystem
.
instance
.
physicsWorld
.
syncSceneToPhysics
();
// PhysicsSystem.instance.step(1/60, dt);
//
// PhysicsSystem.instance.fixedTimeStep = dt;
// PhysicsSystem.instance.physicsWorld.emitEvents();
// PhysicsSystem.instance.update(dt);
// PhysicsSystem.instance.physicsWorld.syncAfterEvents();
PhysicsSystem
.
instance
.
step
(
1
/
60
,
dt
);
PhysicsSystem
.
instance
.
physicsWorld
.
emitEvents
();
PhysicsSystem
.
instance
.
physicsWorld
.
syncAfterEvents
();
}
}
update
(
dt
:
number
)
{
update
(
dt
:
number
)
{
...
@@ -393,7 +435,7 @@ export class GuideGame extends Scene {
...
@@ -393,7 +435,7 @@ export class GuideGame extends Scene {
this
.
checkWall
();
this
.
checkWall
();
}
}
if
(
this
.
isTouch
)
{
if
(
this
.
phyUpdate
&&
this
.
isTouch
)
{
const
lineScale
=
Vec3
.
distance
(
this
.
player
.
position
,
this
.
linkPoint
.
position
);
const
lineScale
=
Vec3
.
distance
(
this
.
player
.
position
,
this
.
linkPoint
.
position
);
this
.
line
.
setScale
(
1
,
lineScale
/
2
,
1
);
this
.
line
.
setScale
(
1
,
lineScale
/
2
,
1
);
...
...
assets/Scripts/Scenes/MainGame/GuideNode.ts
0 → 100644
View file @
2b02b347
import
{
_decorator
,
Component
,
Node
}
from
'cc'
;
const
{
ccclass
,
property
}
=
_decorator
;
@
ccclass
(
'GuideNode'
)
export
class
GuideNode
extends
Component
{
@
property
(
Node
)
guideNode
:
Node
[]
=
[];
@
property
(
Node
)
guide2Next
:
Node
=
null
;
@
property
(
Node
)
guide3Next
:
Node
=
null
;
guideIndex
:
0
|
1
|
2
|
3
|
4
=
0
;
get
guideShow
()
{
return
this
.
node
.
active
;
}
show
(
index
:
1
|
2
|
3
|
4
)
{
for
(
let
i
=
0
;
i
<
this
.
guideNode
.
length
;
i
++
)
{
if
(
this
.
guideNode
[
i
])
{
this
.
guideNode
[
i
].
active
=
false
;
}
}
this
.
node
.
active
=
true
;
if
(
this
.
guideNode
[
index
-
1
])
{
this
.
guideNode
[
index
-
1
].
active
=
true
;
}
this
.
guideIndex
=
index
;
}
hide
()
{
this
.
node
.
active
=
false
;
}
start
()
{
this
.
hide
();
}
update
(
deltaTime
:
number
)
{
}
}
assets/Scripts/Scenes/MainGame/GuideNode.ts.meta
0 → 100644
View file @
2b02b347
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "73861398-a19a-4182-9e14-35c4e3467520",
"files": [],
"subMetas": {},
"userData": {}
}
assets/Scripts/Scenes/MainGame/MainGame.ts
View file @
2b02b347
...
@@ -110,14 +110,12 @@ export class MainGame extends Scene {
...
@@ -110,14 +110,12 @@ export class MainGame extends Scene {
// await sleep(0.5);
// await sleep(0.5);
input
.
on
(
Input
.
EventType
.
TOUCH_START
,
this
.
onTouchStart
,
this
);
input
.
on
(
Input
.
EventType
.
TOUCH_START
,
this
.
onTouchStart
,
this
);
input
.
on
(
Input
.
EventType
.
TOUCH_MOVE
,
this
.
onTouchMove
,
this
);
input
.
on
(
Input
.
EventType
.
TOUCH_END
,
this
.
onTouchEnd
,
this
);
input
.
on
(
Input
.
EventType
.
TOUCH_END
,
this
.
onTouchEnd
,
this
);
input
.
on
(
Input
.
EventType
.
TOUCH_CANCEL
,
this
.
onTouchEnd
,
this
);
input
.
on
(
Input
.
EventType
.
TOUCH_CANCEL
,
this
.
onTouchEnd
,
this
);
}
}
onDestroy
()
{
onDestroy
()
{
input
.
off
(
Input
.
EventType
.
TOUCH_START
,
this
.
onTouchStart
,
this
);
input
.
off
(
Input
.
EventType
.
TOUCH_START
,
this
.
onTouchStart
,
this
);
input
.
off
(
Input
.
EventType
.
TOUCH_MOVE
,
this
.
onTouchMove
,
this
);
input
.
off
(
Input
.
EventType
.
TOUCH_END
,
this
.
onTouchEnd
,
this
);
input
.
off
(
Input
.
EventType
.
TOUCH_END
,
this
.
onTouchEnd
,
this
);
input
.
off
(
Input
.
EventType
.
TOUCH_CANCEL
,
this
.
onTouchEnd
,
this
);
input
.
off
(
Input
.
EventType
.
TOUCH_CANCEL
,
this
.
onTouchEnd
,
this
);
...
@@ -279,10 +277,6 @@ export class MainGame extends Scene {
...
@@ -279,10 +277,6 @@ export class MainGame extends Scene {
this
.
playerBody
.
setAngularVelocity
(
v3
());
this
.
playerBody
.
setAngularVelocity
(
v3
());
}
}
onTouchMove
(
event
:
any
)
{
}
onTouchEnd
(
event
:
any
)
{
onTouchEnd
(
event
:
any
)
{
if
(
this
.
isOver
)
return
;
if
(
this
.
isOver
)
return
;
if
(
!
this
.
isTouch
)
return
;
if
(
!
this
.
isTouch
)
return
;
...
...
assets/Scripts/Scenes/MainGame/Wall.ts
View file @
2b02b347
import
{
_decorator
,
Component
,
instantiate
,
lerp
,
Node
,
Prefab
}
from
'cc'
;
import
{
_decorator
,
Component
,
instantiate
,
lerp
,
Node
,
Prefab
}
from
'cc'
;
const
{
ccclass
,
property
}
=
_decorator
;
const
{
ccclass
,
property
}
=
_decorator
;
@
ccclass
(
'Wall'
)
@
ccclass
(
'Wall'
)
export
class
Wall
extends
Component
{
export
class
Wall
extends
Component
{
...
@@ -16,7 +16,7 @@ export class Wall extends Component {
...
@@ -16,7 +16,7 @@ export class Wall extends Component {
dH
:
number
=
1
;
dH
:
number
=
1
;
start
()
{
onLoad
()
{
if
(
!
this
.
isInit
)
{
if
(
!
this
.
isInit
)
{
this
.
reset
();
this
.
reset
();
}
}
...
@@ -35,6 +35,11 @@ export class Wall extends Component {
...
@@ -35,6 +35,11 @@ export class Wall extends Component {
this
.
ring
?.
destroy
();
this
.
ring
?.
destroy
();
}
}
resetGuide
()
{
this
.
dH
=
Math
.
random
()
*
0.5
+
4.5
;
this
.
top
.
setPosition
(
0
,
this
.
dH
/
2
,
0
);
this
.
bottom
.
setPosition
(
0
,
-
this
.
dH
/
2
,
0
);
}
light
:
Node
=
null
;
light
:
Node
=
null
;
...
@@ -46,11 +51,10 @@ export class Wall extends Component {
...
@@ -46,11 +51,10 @@ export class Wall extends Component {
ring
:
Node
=
null
;
ring
:
Node
=
null
;
createRing
()
{
createRing
(
scale
=
lerp
(
this
.
dH
*
0.4
,
this
.
dH
*
0.75
,
Math
.
random
())
)
{
this
.
ring
=
instantiate
(
this
.
ringPrefab
);
this
.
ring
=
instantiate
(
this
.
ringPrefab
);
this
.
node
.
addChild
(
this
.
ring
);
this
.
node
.
addChild
(
this
.
ring
);
const
scale
=
lerp
(
this
.
dH
*
0.4
,
this
.
dH
*
0.75
,
Math
.
random
());
this
.
ring
.
setScale
(
scale
,
scale
);
this
.
ring
.
setScale
(
scale
,
scale
);
const
dyHalf
=
(
this
.
dH
-
scale
)
/
2
;
const
dyHalf
=
(
this
.
dH
-
scale
)
/
2
;
...
...
profiles/v2/editor/packages.json
View file @
2b02b347
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
"8"
:
{
"8"
:
{
"3
\\
extension"
:
{
"3
\\
extension"
:
{
"name"
:
"extension"
,
"name"
:
"extension"
,
"time"
:
1728
353677505
"time"
:
1728
438098234
}
}
}
}
}
}
...
...
settings/v2/packages/engine.json
View file @
2b02b347
...
@@ -68,7 +68,7 @@
...
@@ -68,7 +68,7 @@
"_value"
:
true
"_value"
:
true
},
},
"profiler"
:
{
"profiler"
:
{
"_value"
:
tru
e
"_value"
:
fals
e
},
},
"occlusion-query"
:
{
"occlusion-query"
:
{
"_value"
:
true
"_value"
:
true
...
@@ -148,7 +148,6 @@
...
@@ -148,7 +148,6 @@
"physics-physx"
,
"physics-physx"
,
"primitive"
,
"primitive"
,
"procedural-animation"
,
"procedural-animation"
,
"profiler"
,
"skeletal-animation"
,
"skeletal-animation"
,
"tween"
,
"tween"
,
"ui"
"ui"
...
...
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