Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fireballoon
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
fireballoon
Commits
55f976da
Commit
55f976da
authored
May 15, 2022
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
音效增加待最终精细调整
parent
35cbb54d
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
654 additions
and
234 deletions
+654
-234
cocos_generator.fire
assets/cocos_generator/scene/cocos_generator.fire
+639
-219
cocos_generator.ts
assets/cocos_generator/scene/cocos_generator.ts
+15
-15
No files found.
assets/cocos_generator/scene/cocos_generator.fire
View file @
55f976da
This diff is collapsed.
Click to expand it.
assets/cocos_generator/scene/cocos_generator.ts
View file @
55f976da
...
...
@@ -102,7 +102,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
audioId
=
await
pg
.
audio
.
playAudioByUrl
(
Game
.
getIns
().
question
.
audio
);
if
(
this
.
audioId
>
-
1
&&
Game
.
getIns
().
state
==
GAME_STATE
.
RUNNING
)
{
cc
.
audioEngine
.
stopAllEffects
();
//
pg.audio.stopAudio(this.audioId);
pg
.
audio
.
stopAudio
(
this
.
audioId
);
}
}
initEvent
()
{
...
...
@@ -144,7 +144,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
layout_start
.
active
=
false
;
if
(
this
.
audioId
>
-
1
&&
Game
.
getIns
().
state
!=
GAME_STATE
.
WAIT
)
{
cc
.
audioEngine
.
stopAllEffects
();
//
pg.audio.stopAudio(this.audioId);
pg
.
audio
.
stopAudio
(
this
.
audioId
);
}
//开始
...
...
@@ -198,22 +198,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
pg
.
view
.
visible
(
pg
.
view
.
find
(
item
,
'
img_fall
'
),
false
);
pg
.
view
.
visible
(
pg
.
view
.
find
(
item
,
'
light
'
),
false
);
pg
.
view
.
setNodeImg
(
pg
.
view
.
find
(
item
,
'
img_normal
'
),
pg
.
view
.
find
(
res
,
'
img_balloon1_1
'
));
pg
.
view
.
setNodeImg
(
pg
.
view
.
find
(
item
,
'
img_fall
'
),
pg
.
view
.
find
(
res
,
'
img_balloon1_2
'
));
let
i
=
Math
.
ceil
(
Math
.
random
()
*
4
);
pg
.
view
.
setNodeImg
(
pg
.
view
.
find
(
item
,
'
img_normal
'
),
pg
.
view
.
find
(
res
,
`img_balloon
${
i
}
_1`
));
pg
.
view
.
setNodeImg
(
pg
.
view
.
find
(
item
,
'
img_fall
'
),
pg
.
view
.
find
(
res
,
`img_balloon
${
i
}
_2`
));
item
.
parent
=
this
.
layout_balloon
;
item
.
data
=
data
;
data
.
fish
.
node
=
item
;
//渲染部分
// if (data.type == "txt") {
// pg.view.visible(pg.view.find(item, 'layout_text'), true);
// pg.view.visible(pg.view.find(item, 'layout_img'), false);
// pg.view.setString(pg.view.find(item, "layout_text/text"), data.txt);
// } else {
// pg.view.visible(pg.view.find(item, 'layout_text'), false);
// pg.view.visible(pg.view.find(item, 'layout_img'), true);
// pg.view.setNetImg(pg.view.find(item, 'layout_img/img'), data.picUrl, { w: 118, h: 110 })
// }
//x y 起始点 和终点 进行 随机
cc
.
Tween
.
stopAllByTarget
(
item
);
//左往右
...
...
@@ -266,10 +257,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
resolve
(
''
);
break
;
case
GUN_STATE
.
SHUT_LEFT
:
this
.
playLocalAudio
(
"
ball
"
)
break
;
case
GUN_STATE
.
SHUT_RIGHT
:
this
.
playLocalAudio
(
"
ball
"
)
break
;
case
GUN_STATE
.
SHUT_MIDDLE
:
this
.
playLocalAudio
(
"
ball
"
)
gun1
.
active
=
false
;
gun2
.
active
=
true
;
gun3
.
active
=
false
;
...
...
@@ -304,6 +298,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
pg
.
view
.
setNetImg
(
pg
.
view
.
find
(
layout_img
,
'
img
'
),
data
.
picUrl
,
{
w
:
440
,
h
:
286
})
}
//动画效果
this
.
playLocalAudio
(
"
card
"
).
then
(()
=>
{
pg
.
audio
.
playAudioByUrl
(
data
.
audioUrl
);
})
layout
.
active
=
true
;
layout
.
opacity
=
255
;
layout
.
scale
=
0.1
;
...
...
@@ -316,13 +313,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
fishingRight
(
item
,
layout
,
data
:
Option
)
{
return
new
Promise
(
async
(
resolve
,
reject
)
=>
{
//弹弓动画。
this
.
item_gun
;
await
this
.
playGun
(
GUN_STATE
.
SHUT_MIDDLE
);
//爆炸效果
this
.
updateFishState
(
item
,
FISH_STATE
.
BREAK
);
await
pg
.
time
.
delay
(
0.5
);
//气球下落
this
.
updateFishState
(
item
,
FISH_STATE
.
FALL
);
cc
.
tween
(
item
).
repeatForever
(
cc
.
tween
().
by
(
0.2
,
{
x
:
25
}).
by
(
0.4
,
{
x
:
-
50
}).
by
(
0.2
,
{
x
:
25
})).
start
();
cc
.
tween
(
item
).
by
(
2
,
{
y
:
-
1500
},
{
easing
:
cc
.
easing
.
quadIn
}).
call
(
async
()
=>
{
//处理内容
data
.
fish
.
isOut
=
FISH_OUT
.
OUT
;
...
...
@@ -428,12 +425,15 @@ export default class SceneComponent extends MyCocosSceneComponent {
switch
(
state
)
{
case
TIPS_STATE
.
COM
:
img
=
img_co
;
this
.
playLocalAudio
(
"
co
"
);
break
;
case
TIPS_STATE
.
GOOD
:
img
=
img_gj
;
this
.
playLocalAudio
(
"
gj
"
);
break
;
case
TIPS_STATE
.
TRY
:
img
=
img_ta
;
this
.
playLocalAudio
(
"
ta
"
);
break
;
}
img
.
scale
=
0
;
...
...
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