Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sn16_parkour
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
sn16_parkour
Commits
c903ac49
Commit
c903ac49
authored
Oct 09, 2023
by
yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
bc05c104
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1140 additions
and
298 deletions
+1140
-298
sn16_parkour.fire
assets/sn16_parkour/scene/sn16_parkour.fire
+1044
-237
sn16_parkour.ts
assets/sn16_parkour/scene/sn16_parkour.ts
+47
-13
Game_sn16_parkour.ts
assets/sn16_parkour/scene/tool/Game_sn16_parkour.ts
+1
-1
defaultData_sn16_parkour.ts
assets/sn16_parkour/script/defaultData_sn16_parkour.ts
+48
-47
No files found.
assets/sn16_parkour/scene/sn16_parkour.fire
View file @
c903ac49
This diff is collapsed.
Click to expand it.
assets/sn16_parkour/scene/sn16_parkour.ts
View file @
c903ac49
...
...
@@ -155,7 +155,28 @@ export default class SceneComponent extends MyCocosSceneComponent {
cc
.
find
(
"
layout_bot
"
,
this
.
layout_game
).
on
(
cc
.
Node
.
EventType
.
TOUCH_END
,
()
=>
{
this
.
updateShipPos
(
-
340
);
},
this
);
cc
.
find
(
"
top/btn
"
,
this
.
node
).
on
(
cc
.
Node
.
EventType
.
TOUCH_END
,
()
=>
{
cc
.
tween
(
this
.
ship
).
to
(
0.1
,
{
y
:
360
}).
call
(()
=>
{
cc
.
find
(
"
mid
"
,
this
.
node
).
active
=
true
;
cc
.
find
(
"
top
"
,
this
.
node
).
active
=
false
;
cc
.
find
(
"
bot
"
,
this
.
node
).
active
=
false
;
}).
start
();
});
cc
.
find
(
"
mid/btn
"
,
this
.
node
).
on
(
cc
.
Node
.
EventType
.
TOUCH_END
,
()
=>
{
cc
.
tween
(
this
.
ship
).
to
(
0.1
,
{
y
:
0
}).
call
(()
=>
{
cc
.
find
(
"
bot
"
,
this
.
node
).
active
=
true
;
cc
.
find
(
"
mid
"
,
this
.
node
).
active
=
false
;
cc
.
find
(
"
top
"
,
this
.
node
).
active
=
false
;
}).
start
();
});
cc
.
find
(
"
bot/btn
"
,
this
.
node
).
on
(
cc
.
Node
.
EventType
.
TOUCH_END
,
()
=>
{
cc
.
tween
(
this
.
ship
).
to
(
0.1
,
{
y
:
-
340
}).
call
(()
=>
{
cc
.
find
(
"
bot
"
,
this
.
node
).
active
=
false
;
cc
.
find
(
"
top
"
,
this
.
node
).
active
=
false
;
cc
.
find
(
"
mid
"
,
this
.
node
).
active
=
false
;
this
.
isGuide
=
true
;
}).
start
();
});
pg
.
event
.
on
(
"
game_time_over
"
,
()
=>
{
...
...
@@ -176,8 +197,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
private
updateShipPos
(
y
=
0
)
{
if
(
this
.
isDeath
)
return
;
if
(
Game
.
getIns
().
state
==
GAME_STATE
.
OVER
)
return
;
Game
.
getIns
().
state
=
GAME_STATE
.
RUNNING
;
cc
.
find
(
"
hand_ske
"
,
this
.
layout_game
).
active
=
false
;
//
Game.getIns().state = GAME_STATE.RUNNING;
//
cc.find("hand_ske", this.layout_game).active = false;
cc
.
tween
(
this
.
ship
).
to
(
0.1
,
{
y
:
y
}).
start
();
}
private
onAudioOn
()
{
...
...
@@ -199,12 +220,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
private
stopBgAudio
()
{
cc
.
audioEngine
.
pauseMusic
();
}
// onTouchStart() {
// pg.audio.playLocalAudio(cc.find(`Canvas/res/audio/btn`));
// pg.audio.playBgAudioByUrl(Game.getIns().bgAudio);
// this.showBgLightAction();
// pg.event.emit("game_start");
// }
private
sendData
(
score
)
{
return
new
Promise
(
res
=>
{
let
upData
:
any
=
{
...
...
@@ -252,10 +268,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
isDeath
=
false
;
this
.
layout_card
.
removeAllChildren
();
this
.
ship
.
setPosition
(
-
this
.
endX2
,
0
);
cc
.
tween
(
this
.
ship
).
to
(
0.5
,
{
x
:
-
670
}).
start
();
cc
.
tween
(
this
.
ship
).
to
(
0.5
,
{
x
:
-
670
}).
call
(()
=>
{
Game
.
getIns
().
state
=
GAME_STATE
.
RUNNING
;
}).
start
();
this
.
showQuestions
();
this
.
playLaba
();
}
...
...
@@ -316,13 +334,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
item
.
parent
=
this
.
layout_card
;
item
.
data
=
data
;
data
.
fish
.
node
=
item
;
//
data.fish.node = item;
//x y 起始点 和终点 进行 随机
cc
.
Tween
.
stopAllByTarget
(
item
);
//左往右
item
.
y
=
pos
[
id
];
// -1300 / 2 + Math.random() * 1300;
item
.
x
=
1400
;
//
cc
.
tween
(
item
).
to
(
6
,
{
x
:
-
1400
}).
call
(()
=>
{
cc
.
tween
(
item
).
to
(
this
.
isSpeedUp
?
4
:
6
,
{
x
:
-
1400
}).
call
(()
=>
{
data
.
fish
.
isOut
=
FISH_OUT
.
OUT
;
this
.
viewFishs
=
this
.
viewFishs
.
filter
(
v
=>
v
.
id
!=
data
.
id
);
}).
start
();
...
...
@@ -353,8 +371,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
return
dis
;
}
private
updateTime
=
2
;
private
isGuide
=
false
update
(
dt
)
{
if
(
Game
.
getIns
().
state
!=
GAME_STATE
.
RUNNING
)
return
;
if
(
!
this
.
isGuide
)
return
;
this
.
isHitBalloon
();
this
.
updateTime
+=
dt
;
if
(
this
.
updateTime
<
2.3
)
return
;
...
...
@@ -443,8 +463,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
fire_ske
.
active
=
true
;
this
.
playLocalAudio
(
"
huoyan
"
).
then
(()
=>
{
fire_ske
.
active
=
false
;
this
.
isSpeedUp
=
false
;
});
this
.
showBgLightAction
(
true
);
this
.
showQuickAction
();
fire_ske
.
getComponent
(
dragonBones
.
ArmatureDisplay
).
playAnimation
(
"
newAnimation
"
,
5
);
this
.
schedule
(()
=>
{
item
.
active
=
false
;
...
...
@@ -454,7 +476,19 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
});
}
private
isSpeedUp
=
false
;
private
showQuickAction
()
{
this
.
isSpeedUp
=
true
;
this
.
fishs
.
forEach
((
item
)
=>
{
cc
.
Tween
.
stopAllByTarget
(
item
);
let
data
=
item
.
data
;
cc
.
tween
(
item
).
to
(
item
.
x
<
0
?
1.5
:
3
,
{
x
:
-
1400
}).
call
(()
=>
{
data
.
fish
.
isOut
=
FISH_OUT
.
OUT
;
this
.
viewFishs
=
this
.
viewFishs
.
filter
(
v
=>
v
.
id
!=
data
.
id
);
}).
start
();
})
}
private
onTouchItem
(
e
)
{
if
(
Game
.
getIns
().
state
==
GAME_STATE
.
OVER
)
return
;
...
...
assets/sn16_parkour/scene/tool/Game_sn16_parkour.ts
View file @
c903ac49
...
...
@@ -61,7 +61,7 @@ export class Item {
this
.
optionList
.
sort
(
function
()
{
return
(
0.5
-
Math
.
random
());
});
this
.
optionList
.
push
(
new
Option
({
type
:
"
jl
"
,
right
:
tru
e
,
image
:
""
,
text
:
""
},
456
));
this
.
optionList
.
push
(
new
Option
({
type
:
"
jl
"
,
right
:
fals
e
,
image
:
""
,
text
:
""
},
456
));
this
.
rNum
=
0
;
for
(
let
i
=
0
;
i
<
this
.
optionList
.
length
;
i
++
)
{
if
(
this
.
optionList
[
i
].
right
)
this
.
rNum
++
;
...
...
assets/sn16_parkour/script/defaultData_sn16_parkour.ts
View file @
c903ac49
...
...
@@ -32,52 +32,53 @@ export const defaultData = {
"
text
"
:
"
one
"
,
"
time
"
:
""
,
"
right
"
:
false
},
{
"
type
"
:
"
txt
"
,
"
image
"
:
""
,
"
audio
"
:
""
,
"
text
"
:
"
seven
"
,
"
time
"
:
""
,
"
right
"
:
false
},
{
"
type
"
:
"
txt
"
,
"
image
"
:
""
,
"
audio
"
:
""
,
"
text
"
:
"
kill
"
,
"
time
"
:
""
,
"
right
"
:
true
},
{
"
type
"
:
"
txt
"
,
"
image
"
:
""
,
"
audio
"
:
"
http://staging-teach.cdn.ireadabc.com/3656883821fc547da4af0253476ab9be_l.mp3
"
,
"
text
"
:
"
ameameameameame
"
,
"
time
"
:
""
,
"
right
"
:
true
,
"
audioName
"
:
"
right.mp3
"
},
{
"
type
"
:
"
img
"
,
"
image
"
:
"
http://staging-teach.cdn.ireadabc.com/237e6cf60d500061c5c7ec69c5110414.png
"
,
"
audio
"
:
"
http://staging-teach.cdn.ireadabc.com/7f1fba5bc7fa3ac27737730bcd2d86e0_l.mp3
"
,
"
text
"
:
""
,
"
time
"
:
""
,
"
right
"
:
true
,
"
audioName
"
:
"
again.mp3
"
},
{
"
type
"
:
"
txt
"
,
"
image
"
:
""
,
"
audio
"
:
""
,
"
text
"
:
"
five
"
,
"
time
"
:
""
,
"
right
"
:
false
},
{
"
type
"
:
"
txt
"
,
"
image
"
:
""
,
"
audio
"
:
"
http://staging-teach.cdn.ireadabc.com/3656883821fc547da4af0253476ab9be_l.mp3
"
,
"
text
"
:
"
right
"
,
"
time
"
:
""
,
"
right
"
:
true
,
"
audioName
"
:
"
right.mp3
"
}
},
// {
// "type": "txt",
// "image": "",
// "audio": "",
// "text": "seven",
// "time": "",
// "right": false
// }, {
// "type": "txt",
// "image": "",
// "audio": "",
// "text": "kill",
// "time": "",
// "right": true
// }, {
// "type": "txt",
// "image": "",
// "audio": "http://staging-teach.cdn.ireadabc.com/3656883821fc547da4af0253476ab9be_l.mp3",
// "text": "ameameameameame",
// "time": "",
// "right": true,
// "audioName": "right.mp3"
// }, {
// "type": "img",
// "image": "http://staging-teach.cdn.ireadabc.com/237e6cf60d500061c5c7ec69c5110414.png",
// "audio": "http://staging-teach.cdn.ireadabc.com/7f1fba5bc7fa3ac27737730bcd2d86e0_l.mp3",
// "text": "",
// "time": "",
// "right": true,
// "audioName": "again.mp3"
// }, {
// "type": "txt",
// "image": "",
// "audio": "",
// "text": "five",
// "time": "",
// "right": false
// }, {
// "type": "txt",
// "image": "",
// "audio": "http://staging-teach.cdn.ireadabc.com/3656883821fc547da4af0253476ab9be_l.mp3",
// "text": "right",
// "time": "",
// "right": true,
// "audioName": "right.mp3"
// }
],
"
type
"
:
"
txt
"
,
"
audioUrl
"
:
"
http://staging-teach.cdn.ireadabc.com/3656883821fc547da4af0253476ab9be_l.mp3
"
,
...
...
@@ -159,7 +160,7 @@ export const defaultData = {
}
],
"
type
"
:
"
txt
"
,
"
audioUrl
"
:
""
,
"
audioUrl
"
:
"
http://staging-teach.cdn.ireadabc.com/3656883821fc547da4af0253476ab9be_l.mp3
"
,
"
audioName
"
:
""
,
"
text
"
:
""
}
...
...
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