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
bf03933e
Commit
bf03933e
authored
Dec 12, 2024
by
spc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
6a5972ed
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
692 additions
and
296 deletions
+692
-296
MainGame.scene
assets/Bundles/MainGame/MainGame.scene
+176
-286
topCard.meta
assets/Bundles/MainGame/prefab/topCard.meta
+9
-0
卡A.prefab
assets/Bundles/MainGame/prefab/topCard/卡A.prefab
+148
-0
卡A.prefab.meta
assets/Bundles/MainGame/prefab/topCard/卡A.prefab.meta
+13
-0
卡B.prefab
assets/Bundles/MainGame/prefab/topCard/卡B.prefab
+148
-0
卡B.prefab.meta
assets/Bundles/MainGame/prefab/topCard/卡B.prefab.meta
+13
-0
卡C.prefab
assets/Bundles/MainGame/prefab/topCard/卡C.prefab
+148
-0
卡C.prefab.meta
assets/Bundles/MainGame/prefab/topCard/卡C.prefab.meta
+13
-0
Target.ts
assets/Scripts/Scenes/MainGame/Components/Target.ts
+17
-4
Player.ts
assets/Scripts/Scenes/MainGame/Player.ts
+4
-3
Snake.ts
assets/Scripts/Scenes/MainGame/Snake.ts
+3
-3
No files found.
assets/Bundles/MainGame/MainGame.scene
View file @
bf03933e
This diff is collapsed.
Click to expand it.
assets/Bundles/MainGame/prefab/topCard.meta
0 → 100644
View file @
bf03933e
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "fbacf0e6-8508-4b2c-a549-b16565465d93",
"files": [],
"subMetas": {},
"userData": {}
}
assets/Bundles/MainGame/prefab/topCard/卡A.prefab
0 → 100644
View file @
bf03933e
[
{
"__type__": "cc.Prefab",
"_name": "卡A",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"persistent": false
},
{
"__type__": "cc.Node",
"_name": "卡A",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
"_children": [],
"_active": true,
"_components": [
{
"__id__": 2
},
{
"__id__": 4
}
],
"_prefab": {
"__id__": 6
},
"_lpos": {
"__type__": "cc.Vec3",
"x": -62,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 3
},
"_contentSize": {
"__type__": "cc.Size",
"width": 32,
"height": 42
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 1
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "5642TlQL1CK4ABo3qDa+2a"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 5
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "c6b39193-6b92-404d-b4d1-c3a9cc8b0f80@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 1,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "afHtW6TeRC4q8TNa1K0hop"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "46Rpq6Y0NL+bdngJRKYFsc",
"instance": null,
"targetOverrides": null
}
]
\ No newline at end of file
assets/Bundles/MainGame/prefab/topCard/卡A.prefab.meta
0 → 100644
View file @
bf03933e
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "1a1ee9df-0637-4a3b-bac1-5bf21366600d",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "卡A"
}
}
assets/Bundles/MainGame/prefab/topCard/卡B.prefab
0 → 100644
View file @
bf03933e
[
{
"__type__": "cc.Prefab",
"_name": "卡B",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"persistent": false
},
{
"__type__": "cc.Node",
"_name": "卡B",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
"_children": [],
"_active": true,
"_components": [
{
"__id__": 2
},
{
"__id__": 4
}
],
"_prefab": {
"__id__": 6
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 3
},
"_contentSize": {
"__type__": "cc.Size",
"width": 32,
"height": 42
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 1
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "6c81ev881EFb0eViEGD3dC"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 5
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "a4050df6-9647-4152-ad4b-20e2878a272e@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 1,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "edCi47OidDDJiqOkO/Jm+F"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "baGm5VSc5I3Iv3pjwhR/Ee",
"instance": null,
"targetOverrides": null
}
]
\ No newline at end of file
assets/Bundles/MainGame/prefab/topCard/卡B.prefab.meta
0 → 100644
View file @
bf03933e
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "e61990c1-7e66-4f38-9579-8d37500e8cfe",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "卡B"
}
}
assets/Bundles/MainGame/prefab/topCard/卡C.prefab
0 → 100644
View file @
bf03933e
[
{
"__type__": "cc.Prefab",
"_name": "卡C",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"persistent": false
},
{
"__type__": "cc.Node",
"_name": "卡C",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
"_children": [],
"_active": true,
"_components": [
{
"__id__": 2
},
{
"__id__": 4
}
],
"_prefab": {
"__id__": 6
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 62,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 3
},
"_contentSize": {
"__type__": "cc.Size",
"width": 32,
"height": 42
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 1
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "1f0liy8jdOzY21EnW9lveu"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 5
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "20710d44-64c2-4fc5-9736-896ca6e505d9@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 1,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "5fhJR3XJJLV5NSZtJtHaDU"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "c2Ft7FcclOpaw6rqMoweol",
"instance": null,
"targetOverrides": null
}
]
\ No newline at end of file
assets/Bundles/MainGame/prefab/topCard/卡C.prefab.meta
0 → 100644
View file @
bf03933e
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "492d9db9-cc02-4806-9b44-880aecb2d6aa",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "卡C"
}
}
assets/Scripts/Scenes/MainGame/Components/Target.ts
View file @
bf03933e
import
{
_decorator
,
Component
,
easing
,
Graphics
,
Label
,
Animation
,
misc
,
Node
,
Tween
,
tween
,
v3
,
UIOpacity
}
from
"cc"
;
import
{
_decorator
,
Component
,
easing
,
Graphics
,
Label
,
Animation
,
misc
,
Node
,
Tween
,
tween
,
v3
,
UIOpacity
}
from
"cc"
;
import
{
Global
}
from
"../Global"
;
import
{
Global
}
from
"../Global"
;
import
Svga
from
"../../../../Component/Svga/Svga"
;
import
Svga
from
"../../../../Component/Svga/Svga"
;
import
{
ECard
}
from
"../Common/Enums"
;
const
{
ccclass
,
property
,
executeInEditMode
}
=
_decorator
;
const
{
ccclass
,
property
,
executeInEditMode
}
=
_decorator
;
...
@@ -34,6 +35,8 @@ export class Target extends Component {
...
@@ -34,6 +35,8 @@ export class Target extends Component {
@
property
(
Node
)
topCard
:
Node
=
null
;
@
property
(
Node
)
topCard
:
Node
=
null
;
@
property
(
Node
)
topCardList
:
Node
=
null
;
constructor
()
{
constructor
()
{
super
();
super
();
Target
.
_ins
=
this
;
Target
.
_ins
=
this
;
...
@@ -122,13 +125,23 @@ export class Target extends Component {
...
@@ -122,13 +125,23 @@ export class Target extends Component {
}
}
showTopCard
()
{
showTopCard
()
{
this
.
topCard
.
active
=
true
;
if
(
!
this
.
topCard
.
active
)
{
this
.
top
.
active
=
false
;
this
.
topCard
.
active
=
true
;
this
.
top
.
active
=
false
;
}
}
}
showTop
()
{
showTop
()
{
this
.
top
.
active
=
true
;
if
(
!
this
.
top
.
active
)
{
this
.
topCard
.
active
=
false
this
.
top
.
active
=
true
;
this
.
topCard
.
active
=
false
}
}
updateCard
(
type
:
ECard
)
{
this
.
showTopCard
()
this
.
topCardList
.
addChild
()
}
}
private
_cd
=
0
;
private
_cd
=
0
;
...
...
assets/Scripts/Scenes/MainGame/Player.ts
View file @
bf03933e
...
@@ -5,8 +5,9 @@ import {
...
@@ -5,8 +5,9 @@ import {
import
{
Snake
}
from
"./Snake"
;
import
{
Snake
}
from
"./Snake"
;
import
{
Joystick
}
from
"./Components/Joystick"
;
import
{
Joystick
}
from
"./Components/Joystick"
;
import
{
FastBtn
}
from
"./Components/FastBtn"
;
import
{
FastBtn
}
from
"./Components/FastBtn"
;
import
{
Events
}
from
"./Common/Enums"
;
import
{
E
Card
,
E
vents
}
from
"./Common/Enums"
;
import
gameStore
from
"../../store/gameStore"
;
import
gameStore
from
"../../store/gameStore"
;
import
{
Target
}
from
"./Components/Target"
;
const
{
ccclass
,
property
}
=
_decorator
;
const
{
ccclass
,
property
}
=
_decorator
;
...
@@ -48,8 +49,8 @@ export class Player extends Snake {
...
@@ -48,8 +49,8 @@ export class Player extends Snake {
gameStore
.
gameInfo
.
luckNum
=
value
;
gameStore
.
gameInfo
.
luckNum
=
value
;
}
}
checkCard
()
{
checkCard
(
type
:
ECard
)
{
console
.
warn
(
"xxxx"
,
this
.
cardMap
)
Target
.
ins
.
updateCard
(
type
);
}
}
onLoad
()
{
onLoad
()
{
...
...
assets/Scripts/Scenes/MainGame/Snake.ts
View file @
bf03933e
...
@@ -194,7 +194,7 @@ export class Snake extends Component {
...
@@ -194,7 +194,7 @@ export class Snake extends Component {
}
}
setSkin
(
skinName
:
string
)
{
setSkin
(
skinName
:
string
)
{
const
skin
=
assetManager
.
getBundle
(
"MainGame"
).
get
(
`skin/
${
skinName
}
`
,
SpriteAtlas
);
const
skin
=
assetManager
.
getBundle
(
"MainGame"
).
get
(
`skin/
${
skinName
}
`
,
SpriteAtlas
);
this
.
imgHead
=
skin
.
getSpriteFrame
(
"head"
);
this
.
imgHead
=
skin
.
getSpriteFrame
(
"head"
);
let
bodyIndex
=
1
;
let
bodyIndex
=
1
;
...
@@ -282,10 +282,10 @@ export class Snake extends Component {
...
@@ -282,10 +282,10 @@ export class Snake extends Component {
this
.
cardMap
.
set
(
type
,
0
);
this
.
cardMap
.
set
(
type
,
0
);
}
}
this
.
cardMap
.
set
(
type
,
this
.
cardMap
.
get
(
type
)
+
1
);
this
.
cardMap
.
set
(
type
,
this
.
cardMap
.
get
(
type
)
+
1
);
this
.
checkCard
();
this
.
checkCard
(
type
);
}
}
checkCard
()
{
checkCard
(
type
:
ECard
)
{
}
}
...
...
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