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
a4cdb39c
Commit
a4cdb39c
authored
Nov 27, 2024
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
910da6a4
Changes
14
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
2020 additions
and
258 deletions
+2020
-258
MainGame.scene
assets/Bundles/MainGame/MainGame.scene
+1388
-254
外部道具.meta
assets/Bundles/MainGame/png/外部道具.meta
+9
-0
加速.png
assets/Bundles/MainGame/png/外部道具/加速.png
+0
-0
加速.png.meta
assets/Bundles/MainGame/png/外部道具/加速.png.meta
+134
-0
加长.png
assets/Bundles/MainGame/png/外部道具/加长.png
+0
-0
加长.png.meta
assets/Bundles/MainGame/png/外部道具/加长.png.meta
+134
-0
双倍经验.png
assets/Bundles/MainGame/png/外部道具/双倍经验.png
+0
-0
双倍经验.png.meta
assets/Bundles/MainGame/png/外部道具/双倍经验.png.meta
+134
-0
护盾.png
assets/Bundles/MainGame/png/外部道具/护盾.png
+0
-0
护盾.png.meta
assets/Bundles/MainGame/png/外部道具/护盾.png.meta
+134
-0
PropBtn.ts
assets/Scripts/Scenes/MainGame/Components/PropBtn.ts
+74
-0
PropBtn.ts.meta
assets/Scripts/Scenes/MainGame/Components/PropBtn.ts.meta
+9
-0
MainGame.ts
assets/Scripts/Scenes/MainGame/MainGame.ts
+3
-3
Start.scene
assets/Start/Start.scene
+1
-1
No files found.
assets/Bundles/MainGame/MainGame.scene
View file @
a4cdb39c
This diff is collapsed.
Click to expand it.
assets/Bundles/MainGame/png/外部道具.meta
0 → 100644
View file @
a4cdb39c
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "723c169c-3576-43d3-835c-aa0b5fbd954d",
"files": [],
"subMetas": {},
"userData": {}
}
assets/Bundles/MainGame/png/外部道具/加速.png
0 → 100644
View file @
a4cdb39c
6.12 KB
assets/Bundles/MainGame/png/外部道具/加速.png.meta
0 → 100644
View file @
a4cdb39c
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "356c19c0-b5a4-4d3b-8e2e-6e82e0168a03",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "356c19c0-b5a4-4d3b-8e2e-6e82e0168a03@6c48a",
"displayName": "加速",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "356c19c0-b5a4-4d3b-8e2e-6e82e0168a03",
"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": "356c19c0-b5a4-4d3b-8e2e-6e82e0168a03@f9941",
"displayName": "加速",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 98,
"height": 98,
"rawWidth": 98,
"rawHeight": 98,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-49,
-49,
0,
49,
-49,
0,
-49,
49,
0,
49,
49,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
98,
98,
98,
0,
0,
98,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-49,
-49,
0
],
"maxPos": [
49,
49,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "356c19c0-b5a4-4d3b-8e2e-6e82e0168a03@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "356c19c0-b5a4-4d3b-8e2e-6e82e0168a03@6c48a"
}
}
assets/Bundles/MainGame/png/外部道具/加长.png
0 → 100644
View file @
a4cdb39c
5.73 KB
assets/Bundles/MainGame/png/外部道具/加长.png.meta
0 → 100644
View file @
a4cdb39c
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "b0074d7f-3919-4a0f-8f92-c879065d55a2",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "b0074d7f-3919-4a0f-8f92-c879065d55a2@6c48a",
"displayName": "加长",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "b0074d7f-3919-4a0f-8f92-c879065d55a2",
"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": "b0074d7f-3919-4a0f-8f92-c879065d55a2@f9941",
"displayName": "加长",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 98,
"height": 98,
"rawWidth": 98,
"rawHeight": 98,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-49,
-49,
0,
49,
-49,
0,
-49,
49,
0,
49,
49,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
98,
98,
98,
0,
0,
98,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-49,
-49,
0
],
"maxPos": [
49,
49,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "b0074d7f-3919-4a0f-8f92-c879065d55a2@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "b0074d7f-3919-4a0f-8f92-c879065d55a2@6c48a"
}
}
assets/Bundles/MainGame/png/外部道具/双倍经验.png
0 → 100644
View file @
a4cdb39c
5.23 KB
assets/Bundles/MainGame/png/外部道具/双倍经验.png.meta
0 → 100644
View file @
a4cdb39c
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "d707ad26-6f87-4c6e-9833-e1ce3560e851",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "d707ad26-6f87-4c6e-9833-e1ce3560e851@6c48a",
"displayName": "双倍经验",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "d707ad26-6f87-4c6e-9833-e1ce3560e851",
"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": "d707ad26-6f87-4c6e-9833-e1ce3560e851@f9941",
"displayName": "双倍经验",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 98,
"height": 98,
"rawWidth": 98,
"rawHeight": 98,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-49,
-49,
0,
49,
-49,
0,
-49,
49,
0,
49,
49,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
98,
98,
98,
0,
0,
98,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-49,
-49,
0
],
"maxPos": [
49,
49,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "d707ad26-6f87-4c6e-9833-e1ce3560e851@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "d707ad26-6f87-4c6e-9833-e1ce3560e851@6c48a"
}
}
assets/Bundles/MainGame/png/外部道具/护盾.png
0 → 100644
View file @
a4cdb39c
6.35 KB
assets/Bundles/MainGame/png/外部道具/护盾.png.meta
0 → 100644
View file @
a4cdb39c
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "13b1f478-e4ca-4a54-9910-58e6fb4c3fcd",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "13b1f478-e4ca-4a54-9910-58e6fb4c3fcd@6c48a",
"displayName": "护盾",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "13b1f478-e4ca-4a54-9910-58e6fb4c3fcd",
"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": "13b1f478-e4ca-4a54-9910-58e6fb4c3fcd@f9941",
"displayName": "护盾",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 98,
"height": 98,
"rawWidth": 98,
"rawHeight": 98,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-49,
-49,
0,
49,
-49,
0,
-49,
49,
0,
49,
49,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
98,
98,
98,
0,
0,
98,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-49,
-49,
0
],
"maxPos": [
49,
49,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "13b1f478-e4ca-4a54-9910-58e6fb4c3fcd@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "13b1f478-e4ca-4a54-9910-58e6fb4c3fcd@6c48a"
}
}
assets/Scripts/Scenes/MainGame/Components/PropBtn.ts
0 → 100644
View file @
a4cdb39c
import
{
_decorator
,
Component
,
Graphics
,
Label
,
lerp
,
macro
,
misc
,
Node
,
Sprite
,
tween
,
UI
,
UITransform
}
from
"cc"
;
const
{
ccclass
,
property
,
executeInEditMode
}
=
_decorator
;
@
ccclass
(
"PropBtn"
)
@
executeInEditMode
export
class
PropBtn
extends
Component
{
img
:
Sprite
;
nameTxt
:
Label
;
cdMask
:
Graphics
;
cdTxt
:
Label
;
onLoad
()
{
this
.
img
=
this
.
node
.
getChildByName
(
"img"
).
getComponent
(
Sprite
);
this
.
nameTxt
=
this
.
node
.
getChildByName
(
"name"
).
getComponent
(
Label
);
const
cd
=
this
.
node
.
getChildByName
(
"cd"
);
this
.
cdMask
=
cd
.
getChildByName
(
"mask"
).
getComponent
(
Graphics
);
this
.
cdTxt
=
cd
.
getChildByName
(
"num"
).
getComponent
(
Label
);
this
.
startCd
(
5
);
this
.
drawProcess
(
0.4
);
}
drawProcess
(
process
:
number
)
{
process
=
misc
.
clampf
(
process
,
0
,
1
);
const
h
=
lerp
(
0
,
Math
.
PI
,
process
);
this
.
cdMask
.
clear
();
this
.
cdMask
.
arc
(
0
,
0
,
50
,
h
-
Math
.
PI
/
2
,
-
h
-
Math
.
PI
/
2
,
false
);
this
.
cdMask
.
fill
();
// this.cdMask.moveTo(0, )
}
totalCd
=
0
;
cd
=
0
;
startCd
(
cd
=
5
)
{
this
.
cdTxt
.
node
.
active
=
true
;
this
.
cdMask
.
node
.
active
=
true
;
this
.
totalCd
=
cd
;
this
.
cd
=
cd
;
tween
(
this
as
PropBtn
)
.
to
(
cd
,
{
cd
:
0
},
{
onUpdate
:
(
target
:
PropBtn
,
ratio
:
number
)
=>
{
this
.
drawProcess
(
1
-
ratio
);
this
.
cdTxt
.
string
=
`
${
this
.
cd
.
toFixed
(
1
)}
s`
;
},
onComplete
:
()
=>
{
this
.
cdTxt
.
node
.
active
=
false
;
this
.
cdMask
.
node
.
active
=
false
;
}
})
.
start
();
}
start
()
{
}
update
(
deltaTime
:
number
)
{
}
}
assets/Scripts/Scenes/MainGame/Components/PropBtn.ts.meta
0 → 100644
View file @
a4cdb39c
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "532eab71-9a5a-4452-ae6f-c41c40b32568",
"files": [],
"subMetas": {},
"userData": {}
}
assets/Scripts/Scenes/MainGame/MainGame.ts
View file @
a4cdb39c
...
...
@@ -158,8 +158,8 @@ export class MainGame extends Scene {
initAiSnake(nickName?: string, tag?: number) {
const node = aiPool.get() || instantiate(this.animalPrefab);
const x = math.randomRange
Int
(-(Global.MAP_WIDTH / 2 - 50), Global.MAP_WIDTH / 2 - 50);
const y = math.randomRange
Int
(-(Global.MAP_HEIGHT / 2 - 50), Global.MAP_HEIGHT / 2 - 50);
const x = math.randomRange(-(Global.MAP_WIDTH / 2 - 50), Global.MAP_WIDTH / 2 - 50);
const y = math.randomRange(-(Global.MAP_HEIGHT / 2 - 50), Global.MAP_HEIGHT / 2 - 50);
node.getComponent(AISnake)?.init({
nickName: nickName,
tag: tag,
...
...
@@ -167,7 +167,7 @@ export class MainGame extends Scene {
// x: 50,
// y: 50,
// bodyCount: 100,
angle: math.randomRange
Int
(0, 360),
angle: math.randomRange(0, 360),
skinName: "s0",
});
this.animalNode.addChild(node);
...
...
assets/Start/Start.scene
View file @
a4cdb39c
...
...
@@ -181,7 +181,7 @@
"_priority": 65535,
"_fov": 45,
"_fovAxis": 0,
"_orthoHeight":
857.290836653386
5,
"_orthoHeight":
617.807407407407
5,
"_near": 1,
"_far": 2000,
"_color": {
...
...
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