Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
BOY04
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
BOY04
Commits
21e91fae
Commit
21e91fae
authored
Jul 08, 2022
by
yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
baa47a6f
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
2677 additions
and
6 deletions
+2677
-6
BOY04.fire
assets/BOY04/scene/BOY04.fire
+1170
-3
BOY04.ts
assets/BOY04/scene/BOY04.ts
+79
-3
petal.prefab
assets/BOY04/scene/petal.prefab
+1384
-0
petal.prefab.meta
assets/BOY04/scene/petal.prefab.meta
+8
-0
petal.png
assets/BOY04/textures/word/petal.png
+0
-0
petal.png.meta
assets/BOY04/textures/word/petal.png.meta
+36
-0
No files found.
assets/BOY04/scene/BOY04.fire
View file @
21e91fae
This diff is collapsed.
Click to expand it.
assets/BOY04/scene/BOY04.ts
View file @
21e91fae
import
{
asyncDelay
,
onHomeworkFinish
}
from
"
../script/util
"
;
import
{
asyncDelay
,
onHomeworkFinish
,
RandomInt
}
from
"
../script/util
"
;
import
{
MyCocosSceneComponent
}
from
"
../script/MyCocosSceneComponent
"
;
import
Game
from
"
./Game
"
;
import
pg
from
"
./pg
"
;
...
...
@@ -87,7 +87,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
showGame
();
}
private
touchOver
()
{
this
.
playLocalAudio
(
"
finish
"
);
let
data
:
any
=
{};
this
.
playLocalAudio
(
"
finish
"
);
let
data
:
any
=
{};
let
questions
=
this
.
logs
.
concat
();
let
score
=
0
;
questions
.
forEach
(
q
=>
{
...
...
@@ -102,11 +102,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
setTimeout
(()
=>
{
let
btn_check
=
cc
.
find
(
"
btn_check
"
,
this
.
node
);
btn_check
.
getComponent
(
cc
.
Button
).
interactable
=
true
;
// const bg = cc.find('Canvas/group_item', this.node);
this
.
showAllFirework
(
this
.
node
,
cc
.
find
(
'
Canvas/petal
'
).
children
);
// let mouse_end = pg.view.find(this, "mouse_end");
// mouse_end.active = true;
// mouse_end.getComponent("mrbr04_mouse_end").play().then(() => {
//结算
// })
},
1
);
}
...
...
@@ -565,6 +568,79 @@ export default class SceneComponent extends MyCocosSceneComponent {
//撒花 ------------------------------------------
async
showOneFirework
(
pos
,
parentNode
,
nodeList
)
{
for
(
let
i
=
0
;
i
<
3
;
i
++
)
{
this
.
showFirework
(
pos
,
parentNode
,
nodeList
,
200
,
200
,
15
);
await
asyncDelay
(
0.1
);
}
}
async
showAllFirework
(
parentNode
,
nodeList
)
{
for
(
let
i
=
0
;
i
<
6
;
i
++
)
{
this
.
showFirework
(
cc
.
v2
(
0
,
-
parentNode
.
height
/
2
),
parentNode
,
nodeList
,
parentNode
.
width
*
2
/
3
,
parentNode
.
height
*
1.3
);
await
asyncDelay
(
0.1
);
}
}
showFirework
(
pos
,
parentNode
,
nodeList
,
width
=
200
,
height
=
200
,
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
(
1.5
,
{
opacity
:
0
})
.
start
();
}
}
createQuads
(
pos
,
parentNode
,
nodeList
)
{
const
quadBase
=
cc
.
instantiate
(
nodeList
[
RandomInt
(
nodeList
.
length
)]);
quadBase
.
x
=
pos
.
x
;
quadBase
.
y
=
pos
.
y
;
quadBase
.
z
=
pos
.
z
;
quadBase
.
angle
=
RandomInt
(
180
);
// quadBase.parent = parentNode;
parentNode
.
addChild
(
quadBase
,
999
);
const
quad
=
quadBase
.
getChildByName
(
'
quad
'
);
quad
.
x
=
0
;
quad
.
y
=
0
;
quad
.
angle
=
RandomInt
(
180
);
const
paper
=
quad
.
getChildByName
(
'
petal
'
);
paper
.
scaleX
=
Math
.
random
()
*
0.5
+
0.5
;
paper
.
scaleY
=
Math
.
random
()
*
0.5
+
0.5
;
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/BOY04/scene/petal.prefab
0 → 100644
View file @
21e91fae
This diff is collapsed.
Click to expand it.
assets/BOY04/scene/petal.prefab.meta
0 → 100644
View file @
21e91fae
{
"ver": "1.2.9",
"uuid": "83963dc9-a6cd-4968-874c-9f540e527ec5",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
assets/BOY04/textures/word/petal.png
0 → 100644
View file @
21e91fae
146 Bytes
assets/BOY04/textures/word/petal.png.meta
0 → 100644
View file @
21e91fae
{
"ver": "2.3.5",
"uuid": "32efe837-eb1a-4ee9-9e87-465ad5c2bc92",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 29,
"height": 29,
"platformSettings": {},
"subMetas": {
"petal": {
"ver": "1.0.4",
"uuid": "62d10560-333c-410c-8353-c7d27e2b0018",
"rawTextureUuid": "32efe837-eb1a-4ee9-9e87-465ad5c2bc92",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 29,
"height": 29,
"rawWidth": 29,
"rawHeight": 29,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
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