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
b734a17d
Commit
b734a17d
authored
Aug 21, 2024
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更改
parent
3cba7dda
Changes
14
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
619 additions
and
589 deletions
+619
-589
custom.d.ts
@types/custom.d.ts
+0
-8
MainGame.scene
assets/Bundles/MainGame/MainGame.scene
+459
-430
fire.mtl
assets/Bundles/MainGame/fireBall/material/fire.mtl
+1
-1
fire2.png
assets/Bundles/MainGame/fireBall/texture/fire2.png
+0
-0
fire2.png.meta
assets/Bundles/MainGame/fireBall/texture/fire2.png.meta
+5
-5
stone.png
assets/Bundles/MainGame/fireBall/texture/stone.png
+0
-0
RulePanel.ts
assets/Scripts/Panels/RulePanel.ts
+27
-15
HomeScene.ts
assets/Scripts/Scenes/HomeScene.ts
+1
-4
MainGame.ts
assets/Scripts/Scenes/MainGame/MainGame.ts
+35
-5
RulePanel.prefab
assets/resources/RulePanel/RulePanel.prefab
+51
-81
bg.png
assets/resources/RulePanel/bg.png
+0
-0
bg.png.meta
assets/resources/RulePanel/bg.png.meta
+20
-20
close.png
assets/resources/common/close.png
+0
-0
close.png.meta
assets/resources/common/close.png.meta
+20
-20
No files found.
@types/custom.d.ts
deleted
100644 → 0
View file @
3cba7dda
declare
module
"cc"
{
export
enum
PhysicsGroup
{
DEFAULT
=
1
,
Ball
=
1
<<
1
,
Line
=
1
<<
2
,
Wall
=
1
<<
3
}
}
assets/Bundles/MainGame/MainGame.scene
View file @
b734a17d
This diff is collapsed.
Click to expand it.
assets/Bundles/MainGame/fireBall/material/fire.mtl
View file @
b734a17d
...
...
@@ -36,7 +36,7 @@
"_props": [
{
"mainTexture": {
"__uuid__": "
9965e7f3-4973-4ff3-b320-0cdb52bfc035
@6c48a",
"__uuid__": "
39e1e9d6-b461-4c06-81b9-f1ddc09193d7
@6c48a",
"__expectedType__": "cc.Texture2D"
}
},
...
...
assets/Bundles/MainGame/fireBall/texture/fire2.png
0 → 100644
View file @
b734a17d
64.9 KB
assets/Bundles/MainGame/fireBall/texture/
stone
.png.meta
→
assets/Bundles/MainGame/fireBall/texture/
fire2
.png.meta
View file @
b734a17d
...
...
@@ -2,7 +2,7 @@
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "
733ec699-4417-4297-acd8-d91def9cd825
",
"uuid": "
39e1e9d6-b461-4c06-81b9-f1ddc09193d7
",
"files": [
".json",
".png"
...
...
@@ -10,8 +10,8 @@
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "
733ec699-4417-4297-acd8-d91def9cd825
@6c48a",
"displayName": "
stone
",
"uuid": "
39e1e9d6-b461-4c06-81b9-f1ddc09193d7
@6c48a",
"displayName": "
fire2
",
"id": "6c48a",
"name": "texture",
"userData": {
...
...
@@ -22,7 +22,7 @@
"mipfilter": "linear",
"anisotropy": 0,
"isUuid": true,
"imageUuidOrDatabaseUri": "
733ec699-4417-4297-acd8-d91def9cd825
",
"imageUuidOrDatabaseUri": "
39e1e9d6-b461-4c06-81b9-f1ddc09193d7
",
"visible": false
},
"ver": "1.0.22",
...
...
@@ -36,7 +36,7 @@
"userData": {
"hasAlpha": true,
"type": "texture",
"redirect": "
733ec699-4417-4297-acd8-d91def9cd825
@6c48a",
"redirect": "
39e1e9d6-b461-4c06-81b9-f1ddc09193d7
@6c48a",
"fixAlphaTransparencyArtifacts": false
}
}
assets/Bundles/MainGame/fireBall/texture/stone.png
deleted
100644 → 0
View file @
3cba7dda
8.77 KB
assets/Scripts/Panels/RulePanel.ts
View file @
b734a17d
import
Panel
from
"../../Module/Panel"
;
import
{
_decorator
,
Button
,
RichText
,
UITransform
}
from
"cc"
;
import
{
sendWebNet
,
WebNetName
}
from
"../Utils/WebNet/WebNet"
;
import
{
_decorator
,
Button
,
RichText
,
UITransform
,
Node
}
from
"cc"
;
import
store
from
"../../store/store"
;
import
{
observer
,
render
}
from
"../../store/decorators"
;
const
{
ccclass
,
property
}
=
_decorator
;
@
observer
@
ccclass
(
'RulePanel'
)
export
default
class
RulePanel
extends
Panel
{
static
skin
=
"RulePanel"
;
static
group
=
"RulePanel"
;
@
property
(
Node
)
closeBtn
:
Node
=
null
;
@
property
(
Node
)
ruleNode
:
Node
=
null
;
@
property
(
Node
)
content
:
Node
=
null
;
async
start
()
{
store
.
updateRule
();
this
.
closeBtn
.
on
(
Button
.
EventType
.
CLICK
,
this
.
clickClose
);
}
clickClose
=
()
=>
{
this
.
hidePanel
();
}
@
render
render
()
{
const
{
ruleInfo
=
""
}
=
store
;
this
.
setRuleTxt
(
ruleInfo
);
this
.
view
[
"close"
].
on
(
Button
.
EventType
.
CLICK
,
()
=>
{
this
.
hidePanel
();
},
this
);
}
setRuleTxt
(
txt
)
{
const
ruleNode
=
this
.
view
[
'ruleBg/ScrollView/view/content/ruleTxt'
];
const
ruleTxt
=
ruleNode
.
getComponent
(
RichText
);
const
content
=
this
.
view
[
'ruleBg/ScrollView/view/content'
];
ruleTxt
.
maxWidth
=
content
.
getComponent
(
UITransform
).
width
;
const
ruleTxt
=
this
.
ruleNode
.
getComponent
(
RichText
);
ruleTxt
.
maxWidth
=
this
.
content
.
getComponent
(
UITransform
).
width
;
// this.scheduleOnce(() => {
ruleTxt
.
string
=
txt
.
replace
(
/<p
\b
.*
?(?:\>
|
\/
>
)
/gi
,
""
)
.
replace
(
/<
\/
p
\>
/gi
,
"<br/>"
)
.
replace
(
/<strong>/gi
,
"<b>"
)
.
replace
(
/<
\/
strong>/gi
,
"</b>"
);
content
.
getComponent
(
UITransform
).
height
=
ruleNode
.
getComponent
(
UITransform
).
height
;
ruleTxt
.
string
=
txt
.
replace
(
/<p
\b
.*
?(?:\>
|
\/
>
)
/gi
,
""
)
.
replace
(
/<
\/
p
\>
/gi
,
"<br/>"
)
.
replace
(
/<strong>/gi
,
"<b>"
)
.
replace
(
/<
\/
strong>/gi
,
"</b>"
);
this
.
content
.
getComponent
(
UITransform
).
height
=
this
.
ruleNode
.
getComponent
(
UITransform
).
height
;
// }, 0.166);
}
...
...
assets/Scripts/Scenes/HomeScene.ts
View file @
b734a17d
import
{
_decorator
,
Button
,
Label
,
Node
,
screen
,
UI
,
UITransform
,
Widget
}
from
'cc'
;
import
Scene
from
"db://assets/Module/Scene"
;
import
{
getWebData
,
LOG_TYPE
,
sendLog
,
sendWebNet
,
WebNetName
}
from
"db://assets/Scripts/Utils/WebNet/WebNet"
;
import
{
MainGame
}
from
"./MainGame/MainGame"
;
import
{
changeScene
,
showPanel
,
showToast
}
from
"db://assets/Module/UIFast"
;
import
GameMgr
from
"db://assets/Scripts/GameMgr"
;
import
{
changeScene
,
showPanel
}
from
"db://assets/Module/UIFast"
;
import
store
from
"../../store/store"
;
import
{
observer
,
render
}
from
"../../store/decorators"
;
import
{
PrizeScene
}
from
"./PrizeScene/PrizeScene"
;
import
{
_asyncThrottle
}
from
"../Utils/Utils"
;
import
RulePanel
from
"../Panels/RulePanel"
;
...
...
assets/Scripts/Scenes/MainGame/MainGame.ts
View file @
b734a17d
...
...
@@ -3,17 +3,18 @@ import {
Input
,
input
,
instantiate
,
Node
,
PhysicsGroup
,
PhysicsSystem
,
Node
,
P
articleSystem
,
P
hysicsGroup
,
PhysicsSystem
,
PointToPointConstraint
,
Prefab
,
primitives
,
RigidBody
,
RigidBody
,
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"
;
const
{
ccclass
,
property
}
=
_decorator
;
...
...
@@ -35,6 +36,8 @@ export class MainGame extends Scene {
@
property
(
Prefab
)
wallPrefab
:
Prefab
=
null
;
@
property
(
Node
)
crushNode
:
Node
=
null
;
isTouch
=
false
;
pNoise
:
ImprovedNoise
=
new
ImprovedNoise
();
...
...
@@ -65,17 +68,40 @@ export class MainGame extends Scene {
async
start
()
{
}
isOver
:
boolean
=
false
;
async
gameOver
(
success
)
{
this
.
isOver
=
true
;
await
sleep
(
3
);
}
onPlayerCollision
(
event
:
ICollisionEvent
)
{
console
.
log
(
event
.
type
,
event
)
if
(
this
.
isOver
)
return
;
const
{
otherCollider
,
selfCollider
}
=
event
;
const
otherGroup
=
otherCollider
.
getGroup
();
if
(
otherGroup
===
PhysicsSystem
.
PhysicsGroup
.
Wall
)
{
if
(
otherGroup
===
PhysicsSystem
.
PhysicsGroup
[
'Wall'
]
)
{
// 死了
console
.
log
(
"死了"
);
this
.
playerBody
.
enabled
=
false
;
this
.
player
.
destroy
();
this
.
crushNode
.
setPosition
(
this
.
player
.
position
);
this
.
crushNode
.
getComponent
(
ParticleSystem
)
.
play
();
this
.
gameOver
(
false
);
}
}
...
...
@@ -88,6 +114,8 @@ export class MainGame extends Scene {
}
onTouchStart
(
event
:
any
)
{
if
(
this
.
isOver
)
return
;
this
.
isTouch
=
true
;
this
.
line
.
active
=
true
;
...
...
@@ -119,6 +147,8 @@ export class MainGame extends Scene {
}
onTouchEnd
(
event
:
any
)
{
if
(
this
.
isOver
)
return
;
this
.
isTouch
=
false
;
this
.
line
.
active
=
false
;
this
.
playerConstraint
.
enabled
=
false
;
...
...
assets/resources/RulePanel/RulePanel.prefab
View file @
b734a17d
...
...
@@ -22,23 +22,23 @@
"__id__": 2
},
{
"__id__":
40
"__id__":
38
}
],
"_active": true,
"_components": [
{
"__id__":
50
"__id__":
48
},
{
"__id__": 5
2
"__id__": 5
0
},
{
"__id__": 5
4
"__id__": 5
2
}
],
"_prefab": {
"__id__": 5
6
"__id__": 5
4
},
"_lpos": {
"__type__": "cc.Vec3",
...
...
@@ -85,17 +85,17 @@
"_active": true,
"_components": [
{
"__id__": 3
3
"__id__": 3
1
},
{
"__id__": 3
5
"__id__": 3
3
},
{
"__id__": 3
7
"__id__": 3
5
}
],
"_prefab": {
"__id__": 3
9
"__id__": 3
7
},
"_lpos": {
"__type__": "cc.Vec3",
...
...
@@ -146,18 +146,15 @@
},
{
"__id__": 28
},
{
"__id__": 30
}
],
"_prefab": {
"__id__": 3
2
"__id__": 3
0
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 3
04
,
"y": 3
30
,
"z": 0
},
"_lrot": {
...
...
@@ -440,7 +437,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 4
50
,
"width": 4
85
,
"height": 0
},
"_anchorPoint": {
...
...
@@ -517,8 +514,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 4
50
,
"height":
69
0
"width": 4
85
,
"height":
81
0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
...
...
@@ -567,8 +564,8 @@
},
"_alignFlags": 45,
"_target": null,
"_left":
3
5,
"_right":
3
5,
"_left":
7.
5,
"_right":
7.
5,
"_top": 0,
"_bottom": 0,
"_horizontalCenter": 0,
...
...
@@ -662,8 +659,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 5
2
0,
"height":
69
0
"width": 5
0
0,
"height":
81
0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
...
...
@@ -707,42 +704,6 @@
"__type__": "cc.CompPrefabInfo",
"fileId": "10n9p8iARDA5rfeLyUD4z8"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 3
},
"_enabled": true,
"__prefab": {
"__id__": 31
},
"_alignFlags": 17,
"_target": null,
"_left": 7,
"_right": 0,
"_top": 110,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_alignMode": 2,
"_lockFlags": 0,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "006EM7Id5CWqCux6yUgmgT"
},
{
"__type__": "cc.PrefabInfo",
"root": {
...
...
@@ -766,12 +727,12 @@
},
"_enabled": true,
"__prefab": {
"__id__": 3
4
"__id__": 3
2
},
"_contentSize": {
"__type__": "cc.Size",
"width":
534
,
"height":
828
"width":
625
,
"height":
1114
},
"_anchorPoint": {
"__type__": "cc.Vec2",
...
...
@@ -794,7 +755,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 3
6
"__id__": 3
4
},
"_customMaterial": null,
"_srcBlendFactor": 2,
...
...
@@ -839,13 +800,13 @@
},
"_enabled": true,
"__prefab": {
"__id__": 3
8
"__id__": 3
6
},
"_alignFlags": 17,
"_target": null,
"_left": 108,
"_right": 0,
"_top":
231
.102,
"_top":
88
.102,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
...
...
@@ -889,6 +850,9 @@
"_children": [],
"_active": true,
"_components": [
{
"__id__": 39
},
{
"__id__": 41
},
...
...
@@ -897,18 +861,15 @@
},
{
"__id__": 45
},
{
"__id__": 47
}
],
"_prefab": {
"__id__": 4
9
"__id__": 4
7
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": -
328.23199999999997
,
"y": -
482.13200000000006
,
"z": 0
},
"_lrot": {
...
...
@@ -940,11 +901,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__":
40
"__id__":
38
},
"_enabled": true,
"__prefab": {
"__id__": 4
2
"__id__": 4
0
},
"_contentSize": {
"__type__": "cc.Size",
...
...
@@ -968,11 +929,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__":
40
"__id__":
38
},
"_enabled": true,
"__prefab": {
"__id__": 4
4
"__id__": 4
2
},
"_customMaterial": null,
"_srcBlendFactor": 2,
...
...
@@ -990,7 +951,7 @@
},
"_type": 0,
"_fillType": 0,
"_sizeMode":
1
,
"_sizeMode":
0
,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
...
...
@@ -1013,11 +974,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__":
40
"__id__":
38
},
"_enabled": true,
"__prefab": {
"__id__": 4
6
"__id__": 4
4
},
"clickEvents": [],
"_interactable": true,
...
...
@@ -1069,17 +1030,17 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__":
40
"__id__":
38
},
"_enabled": true,
"__prefab": {
"__id__": 4
8
"__id__": 4
6
},
"_alignFlags": 17,
"_target": null,
"_left": 335,
"_right": 0,
"_top": 1
100.2
32,
"_top": 1
254.1
32,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
...
...
@@ -1122,7 +1083,7 @@
},
"_enabled": true,
"__prefab": {
"__id__":
51
"__id__":
49
},
"_contentSize": {
"__type__": "cc.Size",
...
...
@@ -1150,7 +1111,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 5
3
"__id__": 5
1
},
"_alignFlags": 45,
"_target": null,
...
...
@@ -1186,7 +1147,16 @@
},
"_enabled": true,
"__prefab": {
"__id__": 55
"__id__": 53
},
"closeBtn": {
"__id__": 38
},
"ruleNode": {
"__id__": 6
},
"content": {
"__id__": 5
},
"_id": ""
},
...
...
assets/resources/RulePanel/bg.png
View replaced file @
3cba7dda
View file @
b734a17d
48.4 KB
|
W:
|
H:
146 KB
|
W:
|
H:
2-up
Swipe
Onion skin
assets/resources/RulePanel/bg.png.meta
View file @
b734a17d
...
...
@@ -46,10 +46,10 @@
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width":
534
,
"height":
828
,
"rawWidth":
534
,
"rawHeight":
828
,
"width":
625
,
"height":
1114
,
"rawWidth":
625
,
"rawHeight":
1114
,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
...
...
@@ -61,17 +61,17 @@
"meshType": 0,
"vertices": {
"rawPosition": [
-
267
,
-
414
,
-
312.5
,
-
557
,
0,
267
,
-
414
,
312.5
,
-
557
,
0,
-
267
,
414
,
-
312.5
,
557
,
0,
267
,
414
,
312.5
,
557
,
0
],
"indexes": [
...
...
@@ -84,12 +84,12 @@
],
"uv": [
0,
828
,
534
,
828
,
1114
,
625
,
1114
,
0,
0,
534
,
625
,
0
],
"nuv": [
...
...
@@ -103,13 +103,13 @@
1
],
"minPos": [
-
267
,
-
414
,
-
312.5
,
-
557
,
0
],
"maxPos": [
267
,
414
,
312.5
,
557
,
0
]
},
...
...
assets/resources/common/close.png
View replaced file @
3cba7dda
View file @
b734a17d
1.32 KB
|
W:
|
H:
2.11 KB
|
W:
|
H:
2-up
Swipe
Onion skin
assets/resources/common/close.png.meta
View file @
b734a17d
...
...
@@ -46,10 +46,10 @@
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width":
80
,
"height":
80
,
"rawWidth":
80
,
"rawHeight":
80
,
"width":
65
,
"height":
65
,
"rawWidth":
65
,
"rawHeight":
65
,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
...
...
@@ -61,17 +61,17 @@
"meshType": 0,
"vertices": {
"rawPosition": [
-
40
,
-
40
,
-
32.5
,
-
32.5
,
0,
40
,
-
40
,
32.5
,
-
32.5
,
0,
-
40
,
40
,
-
32.5
,
32.5
,
0,
40
,
40
,
32.5
,
32.5
,
0
],
"indexes": [
...
...
@@ -84,12 +84,12 @@
],
"uv": [
0,
80
,
80
,
80
,
65
,
65
,
65
,
0,
0,
80
,
65
,
0
],
"nuv": [
...
...
@@ -103,13 +103,13 @@
1
],
"minPos": [
-
40
,
-
40
,
-
32.5
,
-
32.5
,
0
],
"maxPos": [
40
,
40
,
32.5
,
32.5
,
0
]
},
...
...
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