Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
extreme_skiing
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
extreme_skiing
Commits
ae298c79
Commit
ae298c79
authored
Aug 15, 2022
by
yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
撒花
parent
c5999e5c
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1254 additions
and
9 deletions
+1254
-9
extreme_skiing.fire
assets/extreme_skiing/scene/extreme_skiing.fire
+1170
-3
extreme_skiing.ts
assets/extreme_skiing/scene/extreme_skiing.ts
+78
-4
layout_game.ts
assets/extreme_skiing/scene/game/layout_game.ts
+6
-2
No files found.
assets/extreme_skiing/scene/extreme_skiing.fire
View file @
ae298c79
This diff is collapsed.
Click to expand it.
assets/extreme_skiing/scene/extreme_skiing.ts
View file @
ae298c79
import
{
asyncDelay
,
onHomeworkFinish
}
from
"
../script/util
"
;
import
{
asyncDelay
,
onHomeworkFinish
,
RandomInt
}
from
"
../script/util
"
;
import
{
MyCocosSceneComponent
}
from
"
../script/MyCocosSceneComponent
"
;
import
{
MyCocosSceneComponent
}
from
"
../script/MyCocosSceneComponent
"
;
import
Game
,
{
FISH_OUT
,
GAME_STATE
,
Option
}
from
"
./tool/Game
"
;
import
Game
,
{
FISH_OUT
,
GAME_STATE
,
Option
}
from
"
./tool/Game
"
;
import
pg
from
"
./tool/pg
"
;
import
pg
from
"
./tool/pg
"
;
...
@@ -88,9 +88,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -88,9 +88,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
private
layout_start
:
cc
.
Node
;
private
layout_start
:
cc
.
Node
;
private
audioId
:
any
;
private
audioId
:
any
;
private
countDown
:
number
=
999999
;
private
timeCount
:
number
;
private
startCount
=
15
;
async
initView
()
{
async
initView
()
{
cc
.
audioEngine
.
stopAllEffects
();
cc
.
audioEngine
.
stopAllEffects
();
this
.
layout_start
=
pg
.
view
.
find
(
this
,
"
layout_start
"
);
this
.
layout_start
=
pg
.
view
.
find
(
this
,
"
layout_start
"
);
...
@@ -126,6 +123,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -126,6 +123,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
pg
.
event
.
on
(
"
play_laba_audio
"
,
()
=>
{
pg
.
event
.
on
(
"
play_laba_audio
"
,
()
=>
{
this
.
playLaba
();
this
.
playLaba
();
});
});
pg
.
event
.
on
(
"
skiing_show_firework
"
,
()
=>
{
this
.
playLocalAudio
(
"
sahua
"
);
let
endPos
=
cc
.
find
(
"
Canvas/bg/bg_could/endPos
"
);
this
.
showOneFirework
(
endPos
.
getPosition
(),
endPos
.
parent
,
cc
.
find
(
'
paperBase
'
,
this
.
node
).
children
);
});
pg
.
event
.
on
(
"
game_time_over
"
,
()
=>
{
pg
.
event
.
on
(
"
game_time_over
"
,
()
=>
{
// alert("game_time_over")
// alert("game_time_over")
//这里的事件会发送的很早。但是我们需要等待动画执行完了之后再开始后续的内容
//这里的事件会发送的很早。但是我们需要等待动画执行完了之后再开始后续的内容
...
@@ -216,6 +218,78 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -216,6 +218,78 @@ export default class SceneComponent extends MyCocosSceneComponent {
pg
.
audio
.
playAudioByUrl
(
Game
.
getIns
().
getCurrentPage
().
audio
).
then
(()
=>
{
stop
=
true
;
})
pg
.
audio
.
playAudioByUrl
(
Game
.
getIns
().
getCurrentPage
().
audio
).
then
(()
=>
{
stop
=
true
;
})
}
}
async
showOneFirework
(
pos
,
parentNode
,
nodeList
)
{
for
(
let
i
=
0
;
i
<
3
;
i
++
)
{
this
.
showFirework
(
pos
,
parentNode
,
nodeList
,
200
,
200
,
25
);
await
asyncDelay
(
0.1
);
}
}
showFirework
(
pos
,
parentNode
,
nodeList
,
width
=
200
,
height
=
500
,
number
=
30
)
{
for
(
let
i
=
0
;
i
<
number
;
i
++
)
{
const
quad
=
this
.
createQuads
(
pos
,
parentNode
,
nodeList
);
const
targetX
=
RandomInt
(
width
/
2
,
-
width
/
2
);
const
targetY
=
RandomInt
(
height
);
cc
.
tween
(
quad
)
.
by
(
0.5
,
{
x
:
targetX
})
.
by
(
3
,
{
x
:
targetX
*
2
})
.
start
();
cc
.
tween
(
quad
)
.
by
(
0.5
,
{
y
:
targetY
},
{
easing
:
'
quadOut
'
})
.
to
(
4
,
{
y
:
-
parentNode
.
height
*
2
},
{
easing
:
'
quadIn
'
})
.
removeSelf
()
.
start
();
cc
.
tween
(
quad
)
.
delay
(
1
)
.
to
(
0.5
+
1
*
Math
.
random
(),
{
opacity
:
0
})
.
start
();
}
}
createQuads
(
pos
,
parentNode
,
nodeList
)
{
const
quadBase
=
cc
.
instantiate
(
nodeList
[
RandomInt
(
nodeList
.
length
)]);
// console.log('nodeList', nodeList);
// console.log('quadBase', quadBase);
quadBase
.
x
=
pos
.
x
;
quadBase
.
y
=
pos
.
y
+
30
;
quadBase
.
z
=
pos
.
z
;
quadBase
.
angle
=
RandomInt
(
180
);
quadBase
.
parent
=
parentNode
;
const
quad
=
quadBase
.
getChildByName
(
'
quad
'
);
quad
.
x
=
0
;
quad
.
y
=
0
;
quad
.
angle
=
RandomInt
(
180
);
const
paper
=
quad
.
getChildByName
(
'
paper
'
);
paper
.
scaleX
=
Math
.
random
()
*
0.8
+
0.2
;
paper
.
scaleY
=
Math
.
random
()
*
0.8
+
0.2
;
quadBase
.
scaleX
=
Math
.
random
();
cc
.
tween
(
quadBase
)
.
to
((
1
-
quadBase
.
scaleX
)
*
0.3
,
{
scaleX
:
1
})
.
call
(()
=>
{
const
time
=
Math
.
random
()
*
0.2
;
cc
.
tween
(
quadBase
)
.
to
(
0.1
+
time
,
{
scaleX
:
-
1
})
.
to
(
0.1
+
time
,
{
scaleX
:
1
})
.
union
()
.
repeatForever
()
.
start
();
})
.
start
();
return
quadBase
;
}
}
}
assets/extreme_skiing/scene/game/layout_game.ts
View file @
ae298c79
...
@@ -107,7 +107,6 @@ export default class layout_game extends cc.Component {
...
@@ -107,7 +107,6 @@ export default class layout_game extends cc.Component {
this
.
touch
=
true
;
this
.
touch
=
true
;
if
(
data
.
right
)
{
if
(
data
.
right
)
{
data
.
touchRight
=
true
;
data
.
touchRight
=
true
;
//爆炸效果
this
.
rightNum
++
;
this
.
rightNum
++
;
item
.
opacity
=
0
;
item
.
opacity
=
0
;
Game
.
getIns
().
player
.
addRight
();
Game
.
getIns
().
player
.
addRight
();
...
@@ -155,7 +154,12 @@ export default class layout_game extends cc.Component {
...
@@ -155,7 +154,12 @@ export default class layout_game extends cc.Component {
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
img_player
=
cc
.
find
(
"
Canvas/bg/bg_could/img_player
"
);
let
img_player
=
cc
.
find
(
"
Canvas/bg/bg_could/img_player
"
);
let
endPos
=
cc
.
find
(
"
Canvas/bg/bg_could/endPos
"
);
let
endPos
=
cc
.
find
(
"
Canvas/bg/bg_could/endPos
"
);
cc
.
tween
(
img_player
).
to
(
1
,
{
x
:
img_player
.
x
,
y
:
endPos
.
y
,
scale
:
0.16
})
cc
.
tween
(
img_player
)
.
delay
(
0.1
)
.
call
(()
=>
{
this
.
playLocalAudio
(
"
huaxue
"
);
})
.
to
(
1
,
{
x
:
img_player
.
x
,
y
:
endPos
.
y
,
scale
:
0.16
})
.
call
(()
=>
{
pg
.
event
.
emit
(
"
skiing_show_firework
"
)
})
.
delay
(
1
)
.
call
(()
=>
{
return
resolve
(
''
)
})
.
call
(()
=>
{
return
resolve
(
''
)
})
.
start
();
.
start
();
})
})
...
...
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