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
66221ebf
Commit
66221ebf
authored
Nov 28, 2024
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
e3d9ec0f
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
1072 additions
and
887 deletions
+1072
-887
MainGame.scene
assets/Bundles/MainGame/MainGame.scene
+1003
-855
无尽模式.png
assets/Bundles/MainGame/png/横幅/无尽模式.png
+0
-0
无尽模式.png.meta
assets/Bundles/MainGame/png/横幅/无尽模式.png.meta
+12
-12
PropBtn.ts
assets/Scripts/Scenes/MainGame/Components/PropBtn.ts
+17
-14
Target.ts
assets/Scripts/Scenes/MainGame/Components/Target.ts
+24
-4
MainGame.ts
assets/Scripts/Scenes/MainGame/MainGame.ts
+5
-0
SpeedPropBtn.ts
assets/Scripts/Scenes/MainGame/PropBtn/SpeedPropBtn.ts
+11
-2
No files found.
assets/Bundles/MainGame/MainGame.scene
View file @
66221ebf
This diff is collapsed.
Click to expand it.
assets/Bundles/MainGame/png/横幅/无尽模式.png
View replaced file @
e3d9ec0f
View file @
66221ebf
31.4 KB
|
W:
|
H:
33.4 KB
|
W:
|
H:
2-up
Swipe
Onion skin
assets/Bundles/MainGame/png/横幅/无尽模式.png.meta
View file @
66221ebf
...
...
@@ -15,8 +15,8 @@
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "
clamp-to-edge
",
"wrapModeT": "
clamp-to-edge
",
"wrapModeS": "
mirrored-repeat
",
"wrapModeT": "
mirrored-repeat
",
"imageUuidOrDatabaseUri": "081e6f77-5816-4ab7-be1e-cc9917759e54",
"isUuid": true,
"visible": false,
...
...
@@ -45,11 +45,11 @@
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY":
0
,
"trimY":
31
,
"width": 1620,
"height": 450,
"rawWidth": 1620,
"rawHeight":
450
,
"rawHeight":
512
,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
...
...
@@ -84,23 +84,23 @@
],
"uv": [
0,
4
50
,
4
81
,
1620,
450,
0,
481,
0,
31,
1620,
0
31
],
"nuv": [
0,
0,
0
.060546875
,
1,
0.060546875,
0,
0,
1,
0.939453125,
1,
1
0.939453125
],
"minPos": [
-810,
...
...
assets/Scripts/Scenes/MainGame/Components/PropBtn.ts
View file @
66221ebf
...
...
@@ -61,22 +61,25 @@ export class PropBtn extends Component {
cd
=
0
;
startCd
(
cd
=
5
)
{
this
.
cdTxt
.
node
.
active
=
true
;
this
.
cdMask
.
node
.
active
=
true
;
this
.
cd
=
this
.
totalCd
=
cd
;
tween
(
this
as
PropBtn
)
.
to
(
cd
,
{
cd
:
0
},
{
onUpdate
:
(
target
:
PropBtn
,
ratio
:
number
)
=>
{
this
.
drawProcess
(
1
-
ratio
);
const
cdStr
=
this
.
cd
<
10
?
this
.
cd
.
toFixed
(
1
)
:
Math
.
ceil
(
this
.
cd
);
this
.
cdTxt
.
string
=
`
${
cdStr
}
s`
;
},
onComplete
:
()
=>
{
return
new
Promise
<
void
>
((
resolve
)
=>
{
this
.
cdTxt
.
node
.
active
=
true
;
this
.
cdMask
.
node
.
active
=
true
;
this
.
cd
=
this
.
totalCd
=
cd
;
tween
(
this
as
PropBtn
)
.
to
(
cd
,
{
cd
:
0
},
{
onUpdate
:
(
target
:
PropBtn
,
ratio
:
number
)
=>
{
this
.
drawProcess
(
1
-
ratio
);
const
cdStr
=
this
.
cd
<
10
?
this
.
cd
.
toFixed
(
1
)
:
Math
.
ceil
(
this
.
cd
);
this
.
cdTxt
.
string
=
`
${
cdStr
}
s`
;
}
})
.
call
(()
=>
{
this
.
cdTxt
.
node
.
active
=
false
;
this
.
cdMask
.
node
.
active
=
false
;
}
})
.
start
();
resolve
();
})
.
start
();
});
}
start
()
{
...
...
assets/Scripts/Scenes/MainGame/Components/Target.ts
View file @
66221ebf
import
{
_decorator
,
Component
,
Graphics
,
Label
,
misc
,
Node
,
tween
}
from
"cc"
;
import
{
_decorator
,
Component
,
easing
,
Graphics
,
Label
,
misc
,
Node
,
tween
,
v3
}
from
"cc"
;
const
{
ccclass
,
property
,
executeInEditMode
}
=
_decorator
;
...
...
@@ -6,7 +6,7 @@ const { ccclass, property, executeInEditMode } = _decorator;
@
executeInEditMode
()
export
class
Target
extends
Component
{
static
_ins
:
Target
=
null
;
private
static
_ins
:
Target
=
null
;
static
get
ins
()
{
return
this
.
_ins
;
}
...
...
@@ -17,7 +17,8 @@ export class Target extends Component {
@
property
(
Label
)
goalTxt
:
Label
=
null
;
@
property
(
Node
)
banner
:
Node
=
null
;
@
property
(
Node
)
mask
:
Node
=
null
;
@
property
(
Node
)
banner3
:
Node
=
null
;
protected
onLoad
()
{
Target
.
_ins
=
this
;
...
...
@@ -28,7 +29,26 @@ export class Target extends Component {
}
start
()
{
this
.
startCd
(
10
);
}
async
showBanner3
()
{
this
.
banner3
.
active
=
true
;
this
.
mask
.
active
=
true
;
await
new
Promise
<
void
>
((
resolve
)
=>
{
tween
(
this
.
banner3
)
.
delay
(
2.666
)
.
to
(
0.666
,
{
position
:
v3
(
0
,
345
,
0
),
scale
:
v3
(
0.15
,
0.15
,
1
)
},
{
easing
:
easing
.
quadInOut
})
.
delay
(
0.1
)
.
call
(()
=>
{
this
.
mask
.
active
=
false
;
this
.
banner3
.
active
=
false
;
resolve
();
})
.
start
();
});
}
totalCd
=
0
;
...
...
assets/Scripts/Scenes/MainGame/MainGame.ts
View file @
66221ebf
...
...
@@ -24,6 +24,7 @@ import { useNick } from "./Common/AINick";
import
{
observer
,
render
}
from
"../../store/decorators"
;
import
gameStore
from
"../../store/gameStore"
;
import
{
PreCd
}
from
"./Components/PreCd"
;
import
{
Target
}
from
"./Components/Target"
;
const
{
ccclass
,
property
}
=
_decorator
;
...
...
@@ -104,7 +105,11 @@ export class MainGame extends Scene {
this
.
initAnimal
(
this
.
maxAnimal
);
// this.initAnimal(1);
PreCd
.
ins
.
node
.
active
=
true
;
await
Target
.
ins
.
showBanner3
();
await
PreCd
.
ins
.
startCd
();
Target
.
ins
.
startCd
(
10
);
// 设置游戏状态
this
.
setGameState
(
GameState
.
PLAY
);
...
...
assets/Scripts/Scenes/MainGame/PropBtn/SpeedPropBtn.ts
View file @
66221ebf
import
{
_decorator
,
Component
,
Node
}
from
'cc'
;
import
{
_decorator
,
Component
,
Node
,
tween
}
from
"cc"
;
import
{
PropBtn
}
from
"../Components/PropBtn"
;
import
{
MainGame
}
from
"../MainGame"
;
const
{
ccclass
,
property
}
=
_decorator
;
@
ccclass
(
'SpeedPropBtn'
)
export
class
SpeedPropBtn
extends
PropBtn
{
start
()
{
}
doUse
()
{
super
.
doUse
();
MainGame
.
ins
.
player
.
moveScale
+=
1
;
tween
(
this
.
node
)
.
delay
(
5
)
.
call
(()
=>
{
MainGame
.
ins
.
player
.
moveScale
-=
1
;
});
this
.
startCd
(
15
);
}
}
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