Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
MingSnake_241120
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
MingSnake_241120
Commits
22be9808
Commit
22be9808
authored
Dec 06, 2024
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
600851d4
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
1149 additions
and
392 deletions
+1149
-392
GameResultPanel.prefab
assets/Bundles/GameResultPanel/GameResultPanel.prefab
+1012
-328
bg.png
assets/Bundles/GameResultPanel/png/bg.png
+0
-0
bg.png.meta
assets/Bundles/GameResultPanel/png/bg.png.meta
+22
-22
prizeItem.prefab
assets/Bundles/GameResultPanel/prizeItem.prefab
+61
-21
GameResultPanel.ts
assets/Scripts/Panels/GameResultPanel.ts
+0
-7
Target.ts
assets/Scripts/Scenes/MainGame/Components/Target.ts
+15
-3
Global.ts
assets/Scripts/Scenes/MainGame/Global.ts
+10
-0
MainGame.ts
assets/Scripts/Scenes/MainGame/MainGame.ts
+29
-11
No files found.
assets/Bundles/GameResultPanel/GameResultPanel.prefab
View file @
22be9808
This diff is collapsed.
Click to expand it.
assets/Bundles/GameResultPanel/png/bg.png
View replaced file @
600851d4
View file @
22be9808
93 KB
|
W:
|
H:
89.3 KB
|
W:
|
H:
2-up
Swipe
Onion skin
assets/Bundles/GameResultPanel/png/bg.png.meta
View file @
22be9808
...
...
@@ -42,14 +42,14 @@
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX":
-8
,
"offsetY":
-4
,
"trimX":
27
,
"trimY":
4
0,
"offsetX":
0
,
"offsetY":
0
,
"trimX":
0
,
"trimY": 0,
"width": 1224,
"height": 595,
"rawWidth": 12
9
4,
"rawHeight":
667
,
"rawWidth": 12
2
4,
"rawHeight":
595
,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
...
...
@@ -83,24 +83,24 @@
3
],
"uv": [
27
,
627
,
12
51
,
627
,
27
,
32
,
12
51
,
32
0
,
595
,
12
24
,
595
,
0
,
0
,
12
24
,
0
],
"nuv": [
0
.020865533230293665
,
0
.047976011994003
,
0.9667697063369397
,
0
.047976011994003
,
0
.020865533230293665
,
0.9400299850074962
,
0.9667697063369397
,
0.9400299850074962
0,
0,
1
,
0,
0,
1
,
1
,
1
],
"minPos": [
-612,
...
...
assets/Bundles/GameResultPanel/prizeItem.prefab
View file @
22be9808
...
...
@@ -22,22 +22,22 @@
"__id__": 2
},
{
"__id__":
8
"__id__":
10
}
],
"_active": true,
"_components": [
{
"__id__": 1
6
"__id__": 1
8
}
],
"_prefab": {
"__id__":
18
"__id__":
20
},
"_lpos": {
"__type__": "cc.Vec3",
"x":
5
0,
"y":
-5
0,
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
...
...
@@ -79,15 +79,18 @@
},
{
"__id__": 5
},
{
"__id__": 7
}
],
"_prefab": {
"__id__":
7
"__id__":
9
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y":
0
,
"y":
25
,
"z": 0
},
"_lrot": {
...
...
@@ -186,6 +189,42 @@
"__type__": "cc.CompPrefabInfo",
"fileId": "c28bWe7x9K7LYG81m3c0je"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 8
},
"_alignFlags": 17,
"_target": null,
"_left": 0,
"_right": 0,
"_top": 0,
"_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": "8fC9QrTS5HFr5rtMwYqycV"
},
{
"__type__": "cc.PrefabInfo",
"root": {
...
...
@@ -210,23 +249,23 @@
"_children": [],
"_active": true,
"_components": [
{
"__id__": 9
},
{
"__id__": 11
},
{
"__id__": 13
},
{
"__id__": 15
}
],
"_prefab": {
"__id__": 1
5
"__id__": 1
7
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": -
79.09699999999998
,
"y": -
50.120000000000005
,
"z": 0
},
"_lrot": {
...
...
@@ -258,11 +297,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__":
8
"__id__":
10
},
"_enabled": true,
"__prefab": {
"__id__": 1
0
"__id__": 1
2
},
"_contentSize": {
"__type__": "cc.Size",
...
...
@@ -286,11 +325,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__":
8
"__id__":
10
},
"_enabled": true,
"__prefab": {
"__id__": 1
2
"__id__": 1
4
},
"_customMaterial": null,
"_srcBlendFactor": 2,
...
...
@@ -357,17 +396,17 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__":
8
"__id__":
10
},
"_enabled": true,
"__prefab": {
"__id__": 1
4
"__id__": 1
6
},
"_alignFlags": 1,
"_target": null,
"_left": 0,
"_right": 0,
"_top": 11
3.97699999999998
,
"_top": 11
0
,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
...
...
@@ -410,12 +449,12 @@
},
"_enabled": true,
"__prefab": {
"__id__": 1
7
"__id__": 1
9
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 1
0
0
"height": 1
5
0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
...
...
@@ -437,6 +476,7 @@
"__id__": 0
},
"fileId": "37Q9JdyMlO7qcpn+8hIDo0",
"instance": null,
"targetOverrides": null
}
]
\ No newline at end of file
assets/Scripts/Panels/GameResultPanel.ts
View file @
22be9808
...
...
@@ -15,7 +15,6 @@ export default class GameResultPanel extends Panel {
static
skin
=
"GameResultPanel"
;
@
property
(
Node
)
share
:
Node
=
null
;
@
property
(
Node
)
again
:
Node
=
null
;
@
property
(
Node
)
back
:
Node
=
null
;
@
property
(
Node
)
prizeNode
:
Node
=
null
;
@
property
(
Prefab
)
prizePrefab
:
Prefab
=
null
;
...
...
@@ -24,7 +23,6 @@ export default class GameResultPanel extends Panel {
onLoad
()
{
this
.
share
.
on
(
Button
.
EventType
.
CLICK
,
this
.
clickShare
,
this
);
this
.
again
.
on
(
Button
.
EventType
.
CLICK
,
this
.
clickAgain
,
this
);
this
.
back
.
on
(
Button
.
EventType
.
CLICK
,
this
.
clickBack
,
this
);
}
...
...
@@ -54,11 +52,6 @@ export default class GameResultPanel extends Panel {
});
}
clickAgain
()
{
this
.
hidePanel
();
changeScene
(
HomeScene
);
}
clickBack
()
{
this
.
hidePanel
();
changeScene
(
HomeScene
);
...
...
assets/Scripts/Scenes/MainGame/Components/Target.ts
View file @
22be9808
import
{
_decorator
,
Component
,
easing
,
Graphics
,
Label
,
Animation
,
misc
,
Node
,
Tween
,
tween
,
v3
}
from
"cc"
;
import
{
Global
}
from
"../Global"
;
const
{
ccclass
,
property
,
executeInEditMode
}
=
_decorator
;
...
...
@@ -67,15 +68,26 @@ export class Target extends Component {
});
}
async
show
Banner
3
()
{
async
show
Target
3
()
{
await
this
.
showBanner
(
this
.
bannerArr
[
2
]);
}
async
showBanner2
()
{
async
showTarget2
()
{
const
{
time
,
length
}
=
Global
.
stageConfig
[
1
];
this
.
goalTxt
.
string
=
`
${
time
}
秒长度达到
${
length
}
`
;
this
.
bannerArr
[
1
].
getChildByName
(
"txt"
)
.
getComponent
(
Label
)
.
string
=
`
${
time
}
秒长度达到
${
length
}
`
;
await
this
.
showBanner
(
this
.
bannerArr
[
1
]);
}
async
showBanner1
()
{
async
showTarget1
()
{
const
{
time
}
=
Global
.
stageConfig
[
0
];
this
.
goalTxt
.
string
=
`存活
${
time
}
秒`
;
this
.
bannerArr
[
0
].
getChildByName
(
"txt"
)
.
getComponent
(
Label
)
.
string
=
`存活
${
time
}
秒`
;
await
this
.
showBanner
(
this
.
bannerArr
[
0
]);
}
...
...
assets/Scripts/Scenes/MainGame/Global.ts
View file @
22be9808
...
...
@@ -28,6 +28,16 @@ export class Global {
return
{
x
,
y
};
}
static
stageConfig
=
[
{
time
:
10
,
},
{
time
:
60
,
length
:
50
,
}
];
}
...
...
assets/Scripts/Scenes/MainGame/MainGame.ts
View file @
22be9808
...
...
@@ -121,7 +121,8 @@ export class MainGame extends Scene {
};
review
=
()
=>
{
review
=
async
()
=>
{
await
PreCd
.
ins
.
startCd
();
this
.
isOver
=
false
;
this
.
node
.
addChild
(
this
.
player
.
node
);
this
.
player
.
revive
();
...
...
@@ -150,7 +151,25 @@ export class MainGame extends Scene {
}
else
if
(
currentStage
==
2
)
{
const
{
time
,
length
}
=
Global
.
stageConfig
[
0
];
// TODO 判断条件
if
(
MainGame
.
ins
.
player
.
length
>=
length
)
{
const
submitSuc
=
await
gameStore
.
submitTwo
();
if
(
submitSuc
)
{
const
gameSuc
=
await
gameStore
.
startGame
();
if
(
gameSuc
)
{
// await changeScene(GameLoading, {
// callBack: async () => {
await
changeScene
(
MainGame
);
// }
// });
}
else
{
changeScene
(
HomeScene
);
}
}
}
else
{
showPanel
(
GameFailPanel
);
}
}
else
{
...
...
@@ -218,22 +237,21 @@ export class MainGame extends Scene {
PropManager.ins.init(10);
CardManager.ins.init(10);
LuckyBagManager.ins.init();
await Target.ins.show
Banner
3();
await Target.ins.show
Target
3();
await PreCd.ins.startCd();
} else if (currentStage == 2) {
Target.ins.totalCd = Target.ins.cd =
60
;
await Target.ins.show
Banner
2();
const { time } = Global.stageConfig[0];
Target.ins.totalCd = Target.ins.cd =
time
;
await Target.ins.show
Target
2();
await PreCd.ins.startCd();
Target.ins.startCd(60, this.cdOver);
Target.ins.startCd(time, this.cdOver);
} else if (currentStage == 1) {
Target.ins.totalCd = Target.ins.cd =
10
;
await Target.ins.show
Banner
1();
const { time } = Global.stageConfig[0];
Target.ins.totalCd = Target.ins.cd =
time
;
await Target.ins.show
Target
1();
await PreCd.ins.startCd();
Target.ins.startCd(
10
, this.cdOver);
Target.ins.startCd(
time
, this.cdOver);
}
}
...
...
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