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
3d7c9bb6
Commit
3d7c9bb6
authored
Aug 23, 2024
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GuideLayer
parent
82b0f61a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
19 deletions
+43
-19
MainGame.scene
assets/Bundles/MainGame/MainGame.scene
+8
-8
MainGame.ts
assets/Scripts/Scenes/MainGame/MainGame.ts
+35
-11
No files found.
assets/Bundles/MainGame/MainGame.scene
View file @
3d7c9bb6
...
@@ -3369,15 +3369,15 @@
...
@@ -3369,15 +3369,15 @@
"_lpos": {
"_lpos": {
"__type__": "cc.Vec3",
"__type__": "cc.Vec3",
"x": 5,
"x": 5,
"y": 0,
"y": 0
.5
,
"z": 2.8
"z": 2.8
},
},
"_lrot": {
"_lrot": {
"__type__": "cc.Quat",
"__type__": "cc.Quat",
"x":
1.7347234759768069e-18
,
"x":
0
,
"y": 0.
4999999999999999
4,
"y": 0.
505666209602815
4,
"z":
3.004629197474319e-18
,
"z":
0
,
"w": 0.86
60254037844387
"w": 0.86
27292069160065
},
},
"_lscale": {
"_lscale": {
"__type__": "cc.Vec3",
"__type__": "cc.Vec3",
...
@@ -3390,8 +3390,8 @@
...
@@ -3390,8 +3390,8 @@
"_euler": {
"_euler": {
"__type__": "cc.Vec3",
"__type__": "cc.Vec3",
"x": 0,
"x": 0,
"y": 60,
"y": 60
.751173663453024
,
"z":
3.975693351829396e-16
"z":
0
},
},
"_id": "06+Blx3VBJcKGdRFbBnVpe"
"_id": "06+Blx3VBJcKGdRFbBnVpe"
},
},
...
@@ -3540,7 +3540,7 @@
...
@@ -3540,7 +3540,7 @@
"followOffset": {
"followOffset": {
"__type__": "cc.Vec3",
"__type__": "cc.Vec3",
"x": 5,
"x": 5,
"y":
-0.5
,
"y":
0
,
"z": 2.8
"z": 2.8
},
},
"followDamping": 0,
"followDamping": 0,
...
...
assets/Scripts/Scenes/MainGame/MainGame.ts
View file @
3d7c9bb6
import
{
import
{
_decorator
,
Collider
,
CollisionEventType
,
color
,
Color
,
easing
,
ICollisionEvent
,
_decorator
,
Collider
,
Color
,
easing
,
ICollisionEvent
,
Input
,
Input
,
input
,
input
,
instantiate
,
ITriggerEvent
,
Label
,
Light
,
instantiate
,
Node
,
ParticleSystem
,
PhysicsGroup
,
PhysicsSystem
,
ITriggerEvent
,
Label
,
Light
,
Node
,
ParticleSystem
,
PhysicsSystem
,
PointToPointConstraint
,
PointToPointConstraint
,
Prefab
,
Prefab
,
primitives
,
RigidBody
,
RigidBody
,
Tween
,
tween
,
Tween
,
tween
,
v3
,
v3
,
Vec3
,
Vec3
,
}
from
"cc"
;
}
from
"cc"
;
...
@@ -15,7 +25,7 @@ import Scene from "db://assets/Module/Scene";
...
@@ -15,7 +25,7 @@ import Scene from "db://assets/Module/Scene";
import
{
ImprovedNoise
}
from
"../../Utils/ImprovedNoise"
;
import
{
ImprovedNoise
}
from
"../../Utils/ImprovedNoise"
;
import
{
Wall
}
from
"./Wall"
;
import
{
Wall
}
from
"./Wall"
;
import
{
sleep
}
from
"../../Utils/Utils"
;
import
{
sleep
}
from
"../../Utils/Utils"
;
import
{
MainColor
,
randomManColor
}
from
"./Config"
;
import
{
randomManColor
}
from
"./Config"
;
const
{
ccclass
,
property
}
=
_decorator
;
const
{
ccclass
,
property
}
=
_decorator
;
...
@@ -43,7 +53,18 @@ export class MainGame extends Scene {
...
@@ -43,7 +53,18 @@ export class MainGame extends Scene {
@
property
({
type
:
Label
,
group
:
"UI"
})
scoreLabel
:
Label
=
null
;
@
property
({
type
:
Label
,
group
:
"UI"
})
scoreLabel
:
Label
=
null
;
_score
:
number
=
0
;
private
_propScore
:
number
=
0
;
set
propScore
(
value
:
number
)
{
this
.
_propScore
=
value
;
this
.
updateScore
();
}
get
propScore
()
{
return
this
.
_propScore
;
}
private
_score
:
number
=
0
;
set
score
(
value
:
number
)
{
set
score
(
value
:
number
)
{
this
.
_score
=
value
;
this
.
_score
=
value
;
this
.
scoreLabel
.
string
=
value
.
toString
();
this
.
scoreLabel
.
string
=
value
.
toString
();
...
@@ -114,7 +135,7 @@ export class MainGame extends Scene {
...
@@ -114,7 +135,7 @@ export class MainGame extends Scene {
this
.
changeMainColor
(
color
);
this
.
changeMainColor
(
color
);
}
else
if
(
otherName
==
"圆环"
)
{
}
else
if
(
otherName
==
"圆环"
)
{
otherCollider
.
node
.
active
=
false
;
otherCollider
.
node
.
active
=
false
;
this
.
s
core
+=
10
;
this
.
propS
core
+=
10
;
}
}
}
}
...
@@ -271,13 +292,16 @@ export class MainGame extends Scene {
...
@@ -271,13 +292,16 @@ export class MainGame extends Scene {
maxZ
=
0
;
maxZ
=
0
;
updateScore
()
{
this
.
score
=
~~
(
this
.
maxZ
*
10
)
+
this
.
propScore
;
}
update
(
dt
:
number
)
{
update
(
dt
:
number
)
{
const
pPos
=
this
.
player
.
position
;
const
pz
=
-
this
.
player
.
position
.
z
;
const
pz
=
Math
.
abs
(
Math
.
round
(
pPos
.
z
));
if
(
pz
>
this
.
maxZ
)
{
if
(
pz
>
this
.
maxZ
)
{
this
.
score
+=
pz
-
this
.
maxZ
;
this
.
maxZ
=
pz
;
this
.
maxZ
=
pz
;
this
.
updateScore
();
}
}
this
.
checkFrame
++
;
this
.
checkFrame
++
;
...
...
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