Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MRBR02
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
MRBR02
Commits
b321010c
Commit
b321010c
authored
Apr 25, 2022
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mrbr02整体修改
parent
7c0a3ba6
Changes
26
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
3424 additions
and
1081 deletions
+3424
-1081
星星.meta
assets/MRBR02/img/common/星星.meta
+13
-0
icon_bigstar.png
assets/MRBR02/img/common/星星/icon_bigstar.png
+0
-0
icon_bigstar.png.meta
assets/MRBR02/img/common/星星/icon_bigstar.png.meta
+37
-0
star.png
assets/MRBR02/img/common/星星/star.png
+0
-0
star.png.meta
assets/MRBR02/img/common/星星/star.png.meta
+37
-0
star_bg.png
assets/MRBR02/img/common/星星/star_bg.png
+0
-0
star_bg.png.meta
assets/MRBR02/img/common/星星/star_bg.png.meta
+37
-0
Img_bt_right.png
assets/MRBR02/img/common/老鼠在说话开始/Img_bt_right.png
+0
-0
Img_bt_right.png.meta
assets/MRBR02/img/common/老鼠在说话开始/Img_bt_right.png.meta
+37
-0
big_star.mp3
assets/MRBR02/img/common/音效/big_star.mp3
+0
-0
big_star.mp3.meta
assets/MRBR02/img/common/音效/big_star.mp3.meta
+8
-0
layout_mouse.ts
assets/MRBR02/mouse/layout_mouse.ts
+0
-56
small.meta
assets/MRBR02/mouse/small.meta
+12
-0
layout_mouse.prefab
assets/MRBR02/mouse/small/layout_mouse.prefab
+503
-0
layout_mouse.prefab.meta
assets/MRBR02/mouse/small/layout_mouse.prefab.meta
+8
-0
layout_mouse.ts
assets/MRBR02/mouse/small/layout_mouse.ts
+168
-0
layout_mouse.ts.meta
assets/MRBR02/mouse/small/layout_mouse.ts.meta
+0
-0
mouse_start.prefab
assets/MRBR02/mouse/start/mouse_start.prefab
+433
-19
mstart.ts
assets/MRBR02/mouse/start/mstart.ts
+89
-25
Game.ts
assets/MRBR02/scene/Game.ts
+5
-1
MRBR02.fire
assets/MRBR02/scene/MRBR02.fire
+1982
-925
MRBR02.ts
assets/MRBR02/scene/MRBR02.ts
+30
-23
defaultData.ts
assets/MRBR02/script/defaultData.ts
+1
-29
creator.d.ts
creator.d.ts
+2
-0
form.component.html
form/src/app/form/form.component.html
+9
-0
form.component.ts
form/src/app/form/form.component.ts
+13
-3
No files found.
assets/MRBR02/img/common/星星.meta
0 → 100644
View file @
b321010c
{
"ver": "1.1.2",
"uuid": "b027ddf6-6657-4490-9416-0c8b01ecad96",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
assets/MRBR02/img/common/星星/icon_bigstar.png
0 → 100644
View file @
b321010c
14.5 KB
assets/MRBR02/img/common/星星/icon_bigstar.png.meta
0 → 100644
View file @
b321010c
{
"ver": "2.3.5",
"uuid": "329181ef-e920-4e0d-8f97-8ef4149b7743",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 278,
"height": 275,
"platformSettings": {},
"subMetas": {
"icon_bigstar": {
"ver": "1.0.4",
"uuid": "1f039de2-0395-4240-a2d6-77c5918ad985",
"rawTextureUuid": "329181ef-e920-4e0d-8f97-8ef4149b7743",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 278,
"height": 275,
"rawWidth": 278,
"rawHeight": 275,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/MRBR02/img/common/星星/star.png
0 → 100644
View file @
b321010c
3.61 KB
assets/MRBR02/img/common/星星/star.png.meta
0 → 100644
View file @
b321010c
{
"ver": "2.3.5",
"uuid": "230a73ce-15c3-43cb-8ebf-9df5248d4991",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 62,
"height": 69,
"platformSettings": {},
"subMetas": {
"star": {
"ver": "1.0.4",
"uuid": "19c56e55-a25a-4590-8c3b-d56f0254b442",
"rawTextureUuid": "230a73ce-15c3-43cb-8ebf-9df5248d4991",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 62,
"height": 69,
"rawWidth": 62,
"rawHeight": 69,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/MRBR02/img/common/星星/star_bg.png
0 → 100644
View file @
b321010c
3.28 KB
assets/MRBR02/img/common/星星/star_bg.png.meta
0 → 100644
View file @
b321010c
{
"ver": "2.3.5",
"uuid": "29239e52-a730-4c67-9782-10ea26230b45",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 62,
"height": 69,
"platformSettings": {},
"subMetas": {
"star_bg": {
"ver": "1.0.4",
"uuid": "639a6d2e-30bb-42c0-9c54-9f827295e90d",
"rawTextureUuid": "29239e52-a730-4c67-9782-10ea26230b45",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 1.5,
"trimX": 0,
"trimY": 0,
"width": 62,
"height": 66,
"rawWidth": 62,
"rawHeight": 69,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/MRBR02/img/common/老鼠在说话开始/Img_bt_right.png
0 → 100644
View file @
b321010c
3 KB
assets/MRBR02/img/common/老鼠在说话开始/Img_bt_right.png.meta
0 → 100644
View file @
b321010c
{
"ver": "2.3.5",
"uuid": "e50816e7-a843-4920-8269-53555103beac",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 282,
"height": 118,
"platformSettings": {},
"subMetas": {
"Img_bt_right": {
"ver": "1.0.4",
"uuid": "6049e9b1-b6da-4323-8d37-33a677eccd56",
"rawTextureUuid": "e50816e7-a843-4920-8269-53555103beac",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 282,
"height": 118,
"rawWidth": 282,
"rawHeight": 118,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/MRBR02/img/common/音效/big_star.mp3
0 → 100644
View file @
b321010c
File added
assets/MRBR02/img/common/音效/big_star.mp3.meta
0 → 100644
View file @
b321010c
{
"ver": "2.0.1",
"uuid": "0c8d6a87-d127-478d-8bf0-656b9a4b95a9",
"downloadMode": 0,
"duration": 1.776327,
"subMetas": {}
}
\ No newline at end of file
assets/MRBR02/mouse/layout_mouse.ts
deleted
100644 → 0
View file @
7c0a3ba6
// Learn TypeScript:
// - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
import
pg
from
"
../scene/pg
"
;
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
@
ccclass
export
default
class
NewClass
extends
cc
.
Component
{
@
property
(
cc
.
Node
)
item
:
cc
.
Node
=
null
;
// LIFE-CYCLE CALLBACKS:
private
mouseList
=
[];
private
mouseNum
=
0
;
onLoad
()
{
pg
.
event
.
on
(
"
mouse_add
"
,
()
=>
{
this
.
reviceMouse
();
})
let
max
=
3
;
for
(
let
i
=
0
;
i
<
max
;
i
++
)
{
this
.
addMouse
();
}
}
reviceMouse
()
{
this
.
mouseNum
++
;
this
.
updateMouse
();
}
start
()
{
}
addMouse
()
{
let
item
=
cc
.
instantiate
(
this
.
item
);
item
.
active
=
true
;
item
.
getChildByName
(
"
light
"
).
active
=
false
;
this
.
node
.
addChild
(
item
);
this
.
mouseList
.
push
(
item
)
}
updateMouse
()
{
for
(
let
i
=
0
;
i
<
this
.
mouseList
.
length
;
i
++
)
{
let
item
=
this
.
mouseList
[
i
];
item
.
getChildByName
(
"
light
"
).
active
=
i
<
this
.
mouseNum
;
}
}
// update (dt) {}
}
assets/MRBR02/mouse/small.meta
0 → 100644
View file @
b321010c
{
"ver": "1.1.2",
"uuid": "828d76bc-8d6c-456d-a0df-6af33caf2179",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
assets/MRBR02/mouse/small/layout_mouse.prefab
0 → 100644
View file @
b321010c
[
{
"__type__": "cc.Prefab",
"_name": "",
"_objFlags": 0,
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"asyncLoadAssets": false,
"readonly": false
},
{
"__type__": "cc.Node",
"_name": "layout_mouse",
"_objFlags": 0,
"_parent": null,
"_children": [
{
"__id__": 2
}
],
"_active": true,
"_components": [
{
"__id__": 13
}
],
"_prefab": {
"__id__": 14
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 1,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "img",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 3
},
{
"__id__": 6
},
{
"__id__": 9
}
],
"_active": false,
"_components": [],
"_prefab": {
"__id__": 12
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "star_bg",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 4
}
],
"_prefab": {
"__id__": 5
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 59,
"height": 42
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "54beeaf0-8640-4d6d-bdb2-40be6c49f378"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "564dd930-80a8-4d89-bf96-f0f5be1e92cb"
},
"fileId": "1a6bNni9hAzZuAOicd4es+",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "star",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 7
}
],
"_prefab": {
"__id__": 8
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 59,
"height": 42
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 6
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "047bdd7d-6c4f-47dc-944a-12cf7a461f93"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "564dd930-80a8-4d89-bf96-f0f5be1e92cb"
},
"fileId": "0dcJdIc9BNfbQiPTRx9GVW",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "icon_bigstar",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 10
}
],
"_prefab": {
"__id__": 11
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 59,
"height": 42
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 9
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "047bdd7d-6c4f-47dc-944a-12cf7a461f93"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "564dd930-80a8-4d89-bf96-f0f5be1e92cb"
},
"fileId": "e8QBmuw8VOBYptnR5JD386",
"sync": false
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "564dd930-80a8-4d89-bf96-f0f5be1e92cb"
},
"fileId": "9eIg5jomZOV5E+Yzh+2uPU",
"sync": false
},
{
"__type__": "aa1f1smbntECpwesqp/Tg0F",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "564dd930-80a8-4d89-bf96-f0f5be1e92cb"
},
"fileId": "",
"sync": false
}
]
\ No newline at end of file
assets/MRBR02/mouse/small/layout_mouse.prefab.meta
0 → 100644
View file @
b321010c
{
"ver": "1.2.9",
"uuid": "564dd930-80a8-4d89-bf96-f0f5be1e92cb",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
assets/MRBR02/mouse/small/layout_mouse.ts
0 → 100644
View file @
b321010c
// Learn TypeScript:
// - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
import
Game
from
"
../../scene/Game
"
;
import
pg
from
"
../../scene/pg
"
;
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
@
ccclass
export
default
class
NewClass
extends
cc
.
Component
{
// LIFE-CYCLE CALLBACKS:
onLoad
()
{
pg
.
event
.
on
(
"
mouse_add
"
,
()
=>
{
this
.
showBigStar
();
})
pg
.
event
.
on
(
"
mouse_num
"
,
(
max
:
number
)
=>
{
this
.
initStar
();
})
}
init
(
max
)
{
}
reviceMouse
()
{
}
start
()
{
}
//-----------------------STAR-----------------------------
bigStarArr
:
cc
.
Node
[];
canvas
:
cc
.
Node
;
curGroupIndex
:
number
@
property
(
cc
.
Vec2
)
position
:
cc
.
Vec2
;
@
property
(
cc
.
AudioClip
)
bigStarClip
:
cc
.
AudioClip
;
@
property
(
cc
.
AudioClip
)
starCountClip
:
cc
.
AudioClip
;
//搭配res中的star_bg star等使用
initStar
()
{
this
.
curGroupIndex
=
0
;
this
.
canvas
=
cc
.
find
(
'
Canvas
'
);
const
gArr
=
Game
.
getIns
().
lists
;
if
(
gArr
.
length
<=
1
)
{
return
;
}
this
.
cleanStar
();
this
.
bigStarArr
=
[];
let
baseX
=
this
.
position
.
x
;
let
baseY
=
this
.
position
.
y
;
let
disW
=
80
;
// * this._mapScaleMin
// let disH = 80 * this._mapScaleMin;
let
disScale
=
1
;
if
(
gArr
.
length
>
5
)
{
// disH = (400 / gArr.length) * this._mapScaleMin;
disScale
=
5
/
gArr
.
length
;
}
for
(
let
i
=
0
;
i
<
gArr
.
length
;
i
++
)
{
const
starBg
=
this
.
getSprNode
(
'
star_bg
'
);
this
.
canvas
.
addChild
(
starBg
,
10
);
// starBg.x = baseX;
// starBg.y = baseY - i * disH;
starBg
.
x
=
baseX
-
i
*
disW
;
starBg
.
y
=
baseY
starBg
.
scale
=
disScale
;
const
starTop
=
this
.
getSprNode
(
'
star
'
);
starBg
.
addChild
(
starTop
);
starTop
.
active
=
false
;
starBg
.
star
=
starTop
;
const
starBig
=
this
.
getSprNode
(
'
icon_bigstar
'
);
starTop
.
addChild
(
starBig
);
starBig
.
angle
=
-
90
;
starBg
.
starBig
=
starBig
;
this
.
bigStarArr
.
push
(
starBg
);
}
console
.
log
(
"
bigStarArr:
"
,
this
.
bigStarArr
);
}
cleanStar
()
{
if
(
this
.
bigStarArr
&&
this
.
bigStarArr
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
this
.
bigStarArr
.
length
;
i
++
)
{
this
.
bigStarArr
[
i
].
removeFromParent
();
}
}
}
showBigStar
()
{
if
(
!
this
.
bigStarArr
||
this
.
bigStarArr
.
length
<=
0
)
{
// this.checkGameEnd();
return
;
}
const
bigStarBg
=
this
.
bigStarArr
[
this
.
curGroupIndex
++
];
const
starBig
=
bigStarBg
.
starBig
;
starBig
.
scale
=
1
;
const
star
=
bigStarBg
.
star
;
star
.
active
=
true
;
star
.
scaleX
=
0.7
/
bigStarBg
.
scale
;
star
.
scaleY
=
1
/
bigStarBg
.
scale
;
star
.
angle
=
90
;
const
canvas
=
cc
.
find
(
'
Canvas
'
);
const
startPos
=
this
.
exchangeNodePos
(
star
.
parent
,
canvas
);
const
middlePos
=
this
.
exchangeNodePos
(
star
.
parent
,
canvas
);
star
.
x
=
startPos
.
x
;
star
.
y
=
startPos
.
y
-
starBig
.
height
;
console
.
log
(
'
middlePos =
'
+
JSON
.
stringify
(
middlePos
));
const
time
=
1
;
cc
.
tween
(
star
)
.
to
(
0.3
,
{
y
:
middlePos
.
y
+
80
},
{
easing
:
'
quadOut
'
})
.
to
(
0.1
,
{
y
:
middlePos
.
y
+
40
,
scaleX
:
1.2
/
bigStarBg
.
scale
,
scaleY
:
0.8
/
bigStarBg
.
scale
},
{
easing
:
'
quadOut
'
})
.
to
(
0.1
,
{
y
:
middlePos
.
y
,
scaleX
:
1
/
bigStarBg
.
scale
,
scaleY
:
1
/
bigStarBg
.
scale
},
{
easing
:
'
quadOut
'
})
.
delay
(
0.1
)
.
to
(
0.8
,
{
angle
:
-
720
,
scale
:
1
})
.
start
();
cc
.
tween
(
star
)
.
delay
(
0.6
)
.
to
(
0.8
,
{
x
:
0
},
{
easing
:
'
quadIn
'
})
.
start
();
cc
.
tween
(
star
)
.
delay
(
0.6
)
.
to
(
0.8
,
{
y
:
0
},
{
easing
:
'
quadOut
'
})
.
start
();
cc
.
tween
(
starBig
)
.
delay
(
0.6
)
.
to
(
0.8
,
{
scale
:
0
},
{
easing
:
'
quadOut
'
})
.
call
(()
=>
{
pg
.
event
.
emit
(
"
mouse_num_game_end
"
)
this
.
playAudio
(
this
.
starCountClip
);
})
.
start
();
this
.
playAudio
(
this
.
bigStarClip
);
}
//-----------------------STAR-----------------------------
getSprNode
(
resName
)
{
const
sf
=
pg
.
view
.
find
(
this
,
`img/
${
resName
}
`
).
getComponent
(
cc
.
Sprite
).
spriteFrame
;
const
node
=
new
cc
.
Node
();
node
.
addComponent
(
cc
.
Sprite
).
spriteFrame
=
sf
;
return
node
;
}
exchangeNodePos
(
baseNode
,
targetNode
)
{
return
baseNode
.
convertToNodeSpaceAR
(
targetNode
.
_parent
.
convertToWorldSpaceAR
(
cc
.
v2
(
targetNode
.
x
,
targetNode
.
y
)));
}
playAudio
(
audioClip
,
cb
=
null
)
{
if
(
audioClip
)
{
const
audioId
=
cc
.
audioEngine
.
playEffect
(
audioClip
,
false
);
if
(
cb
)
{
cc
.
audioEngine
.
setFinishCallback
(
audioId
,
()
=>
{
cb
();
});
}
}
}
// update (dt) {}
}
assets/MRBR02/mouse/layout_mouse.ts.meta
→
assets/MRBR02/mouse/
small/
layout_mouse.ts.meta
View file @
b321010c
File moved
assets/MRBR02/mouse/start/mouse_start.prefab
View file @
b321010c
...
@@ -22,16 +22,22 @@
...
@@ -22,16 +22,22 @@
},
},
{
{
"__id__": 5
"__id__": 5
},
{
"__id__": 8
},
{
"__id__": 12
}
}
],
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__":
8
"__id__":
20
}
}
],
],
"_prefab": {
"_prefab": {
"__id__":
9
"__id__":
21
},
},
"_opacity": 255,
"_opacity": 255,
"_color": {
"_color": {
...
@@ -62,8 +68,8 @@
...
@@ -62,8 +68,8 @@
0,
0,
0,
0,
1,
1,
0.
11
,
0.
2
,
0.
11
,
0.
2
,
1
1
]
]
},
},
...
@@ -82,7 +88,7 @@
...
@@ -82,7 +88,7 @@
},
},
{
{
"__type__": "cc.Node",
"__type__": "cc.Node",
"_name": "s
ke
",
"_name": "s
hadow
",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 1
"__id__": 1
...
@@ -105,6 +111,113 @@
...
@@ -105,6 +111,113 @@
"b": 255,
"b": 255,
"a": 255
"a": 255
},
},
"_contentSize": {
"__type__": "cc.Size",
"width": 282,
"height": 118
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
5272.015,
-3197.113,
0,
0,
0,
0,
1,
5,
5,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "6049e9b1-b6da-4323-8d37-33a677eccd56"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "57753175-db68-4aab-a973-8abce1f1664a"
},
"fileId": "ecpREk57VFhaAUZMWKAQ4x",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "ske",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 6
}
],
"_prefab": {
"__id__": 7
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
"width": 1559,
"width": 1559,
...
@@ -119,8 +232,8 @@
...
@@ -119,8 +232,8 @@
"__type__": "TypedArray",
"__type__": "TypedArray",
"ctor": "Float64Array",
"ctor": "Float64Array",
"array": [
"array": [
4825.941
,
5454.443
,
-2
215.831
,
-2
366.485
,
0,
0,
0,
0,
0,
0,
...
@@ -149,7 +262,7 @@
...
@@ -149,7 +262,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
2
"__id__":
5
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -177,7 +290,7 @@
...
@@ -177,7 +290,7 @@
"__uuid__": "04a8dfaa-9baf-4407-af0a-2d3a9e89dbd8"
"__uuid__": "04a8dfaa-9baf-4407-af0a-2d3a9e89dbd8"
},
},
"_N$_defaultArmatureIndex": 0,
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex":
1
,
"_N$_animationIndex":
0
,
"_N$_defaultCacheMode": 0,
"_N$_defaultCacheMode": 0,
"_N$timeScale": 1,
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$debugBones": false,
...
@@ -198,7 +311,7 @@
...
@@ -198,7 +311,7 @@
{
{
"__type__": "cc.Node",
"__type__": "cc.Node",
"_name": "block",
"_name": "block",
"_objFlags":
0
,
"_objFlags":
512
,
"_parent": {
"_parent": {
"__id__": 1
"__id__": 1
},
},
...
@@ -206,13 +319,16 @@
...
@@ -206,13 +319,16 @@
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 6
"__id__": 9
},
{
"__id__": 10
}
}
],
],
"_prefab": {
"_prefab": {
"__id__":
7
"__id__":
11
},
},
"_opacity":
255
,
"_opacity":
100
,
"_color": {
"_color": {
"__type__": "cc.Color",
"__type__": "cc.Color",
"r": 255,
"r": 255,
...
@@ -264,11 +380,43 @@
...
@@ -264,11 +380,43 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
5
"__id__":
8
},
},
"_enabled": true,
"_enabled": true,
"_id": ""
"_id": ""
},
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
},
"_enabled": false,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
{
"__type__": "cc.PrefabInfo",
"__type__": "cc.PrefabInfo",
"root": {
"root": {
...
@@ -280,6 +428,272 @@
...
@@ -280,6 +428,272 @@
"fileId": "efp877hUFLz4dHY4gxxXKw",
"fileId": "efp877hUFLz4dHY4gxxXKw",
"sync": false
"sync": false
},
},
{
"__type__": "cc.Node",
"_name": "audio",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 13
},
{
"__id__": 16
}
],
"_active": true,
"_components": [],
"_prefab": {
"__id__": 19
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "enter",
"_objFlags": 0,
"_parent": {
"__id__": 12
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 14
}
],
"_prefab": {
"__id__": 15
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.AudioSource",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
},
"_enabled": true,
"_clip": {
"__uuid__": "bce3261e-7314-4067-9337-459533b97896"
},
"_volume": 1,
"_mute": false,
"_loop": false,
"_firstlyEnabled": true,
"playOnLoad": false,
"preload": false,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "57753175-db68-4aab-a973-8abce1f1664a"
},
"fileId": "6dXSctH45Kj5MbzEKNyUGl",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "leave",
"_objFlags": 0,
"_parent": {
"__id__": 12
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 17
}
],
"_prefab": {
"__id__": 18
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.AudioSource",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 16
},
"_enabled": true,
"_clip": {
"__uuid__": "3fa7aab4-b81d-40e6-9691-73935a1d92da"
},
"_volume": 1,
"_mute": false,
"_loop": false,
"_firstlyEnabled": true,
"playOnLoad": false,
"preload": false,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "57753175-db68-4aab-a973-8abce1f1664a"
},
"fileId": "3dER2Qz/ZEyI6vLH55eksI",
"sync": false
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "57753175-db68-4aab-a973-8abce1f1664a"
},
"fileId": "04Mh2bmZRDIaNa8D8xWN8l",
"sync": false
},
{
{
"__type__": "219b1yegNJPW4jalMImtj4z",
"__type__": "219b1yegNJPW4jalMImtj4z",
"_name": "",
"_name": "",
...
@@ -290,15 +704,15 @@
...
@@ -290,15 +704,15 @@
"_enabled": true,
"_enabled": true,
"startPosition": {
"startPosition": {
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x":
1400
0,
"x": 0,
"y":
-2215
"y":
0
},
},
"targetPosition": {
"targetPosition": {
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
"x":
4825.941
,
"x":
0
,
"y":
-2215
"y":
0
},
},
"moveInTime":
2
,
"moveInTime":
1
,
"_id": ""
"_id": ""
},
},
{
{
...
...
assets/MRBR02/mouse/start/mstart.ts
View file @
b321010c
...
@@ -21,45 +21,109 @@ export default class MouseStart extends cc.Component {
...
@@ -21,45 +21,109 @@ export default class MouseStart extends cc.Component {
private
ske
:
cc
.
Node
;
private
ske
:
cc
.
Node
;
private
block
:
cc
.
Node
;
private
block
:
cc
.
Node
;
private
shadow
:
cc
.
Node
;
onLoad
()
{
onLoad
()
{
//修改ske的信息
//修改ske的信息
this
.
ske
=
this
.
node
.
getChildByName
(
"
ske
"
);
this
.
ske
=
this
.
node
.
getChildByName
(
"
ske
"
);
this
.
block
=
this
.
node
.
getChildByName
(
"
block
"
);
this
.
block
=
this
.
node
.
getChildByName
(
"
block
"
);
this
.
shadow
=
this
.
node
.
getChildByName
(
"
shadow
"
);
this
.
ske
.
x
=
this
.
startPosition
.
x
;
this
.
ske
.
x
=
this
.
startPosition
.
x
;
this
.
ske
.
y
=
this
.
startPosition
.
y
;
this
.
ske
.
y
=
this
.
startPosition
.
y
;
pg
.
event
.
on
(
"
mouse_start_play
"
,
(
data
)
=>
{
this
.
play
(
data
).
then
(()
=>
{
pg
.
event
.
emit
(
"
mouse_start_play_success
"
);
})
})
}
}
play
(
audioUrl
?:
string
)
{
play
({
voice
,
time
}:
any
)
{
this
.
moveInTime
=
Game
.
getIns
().
aniEnter
.
time
||
5
;
return
new
Promise
((
resolve
,
reject
)
=>
{
let
isPlaying
=
true
;
this
.
ske
.
x
=
this
.
startPosition
.
x
;
this
.
ske
.
y
=
this
.
startPosition
.
y
;
this
.
ske
.
active
=
true
;
this
.
node
.
active
=
true
;
this
.
node
.
active
=
true
;
this
.
block
.
active
=
true
;
this
.
block
.
active
=
true
;
this
.
ske
.
active
=
true
;
this
.
ske
.
x
=
this
.
startPosition
.
x
;
this
.
ske
.
y
=
this
.
startPosition
.
y
;
this
.
moveInTime
=
time
||
5
;
return
new
Promise
((
resolve
,
reject
)
=>
{
let
isPlaying
=
true
;
let
load
=
false
;
pg
.
load
.
loadDB
(
this
.
ske
,
{
ske
:
Game
.
getIns
().
aniEnter
.
skeJsonData
.
url
,
tex
:
Game
.
getIns
().
aniEnter
.
texJsonData
.
url
,
png
:
Game
.
getIns
().
aniEnter
.
texPngData
.
url
}).
then
((
animationName
)
=>
{
pg
.
load
.
loadDB
(
this
.
ske
,
{
ske
:
Game
.
getIns
().
aniEnter
.
skeJsonData
.
url
,
tex
:
Game
.
getIns
().
aniEnter
.
texJsonData
.
url
,
png
:
Game
.
getIns
().
aniEnter
.
texPngData
.
url
}).
then
((
animationName
)
=>
{
cc
.
tween
(
this
.
ske
).
to
(
1.3
,
{
x
:
this
.
targetPosition
.
x
,
y
:
this
.
targetPosition
.
y
}).
call
(()
=>
{
if
(
load
)
return
;
audioUrl
=
audioUrl
?
audioUrl
:
Game
.
getIns
().
aniEnter
.
audioUrl
;
load
=
true
;
if
(
audioUrl
)
{
cc
.
Tween
.
stopAllByTarget
(
this
.
ske
);
pg
.
audio
.
playAudioByUrl
(
audioUrl
).
then
(()
=>
{
this
.
playLocalAudio
(
'
enter
'
).
then
(()
=>
{
isPlaying
=
false
;
this
.
playAudioByUrl
(
voice
)
resolve
(
''
);
})
})
}
cc
.
tween
(
this
.
ske
).
to
(
0.5
,
{
x
:
this
.
targetPosition
.
x
,
y
:
this
.
targetPosition
.
y
}).
delay
(
0.9
).
call
(()
=>
{
let
db
=
this
.
ske
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
let
db
=
this
.
ske
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
db
.
playAnimation
(
'
normal
'
,
1111111
);
db
.
playAnimation
(
'
normal
'
,
0
);
db
.
addEventListener
(
"
loopComplete
"
,
()
=>
{
if
(
!
isPlaying
)
{
this
.
block
.
active
=
false
;
resolve
(
''
);
}
})
}).
delay
(
this
.
moveInTime
).
call
(()
=>
{
}).
delay
(
this
.
moveInTime
).
call
(()
=>
{
this
.
playLocalAudio
(
'
leave
'
)
cc
.
tween
(
this
.
ske
).
by
(
0.1
,
{
y
:
200
}).
by
(
1
,
{
y
:
-
10000
}).
call
(()
=>
{
this
.
ske
.
active
=
false
;
this
.
ske
.
active
=
false
;
this
.
node
.
active
=
false
;
this
.
node
.
active
=
false
;
this
.
block
.
active
=
false
;
this
.
block
.
active
=
false
;
resolve
(
''
);
}).
start
();
}).
start
();
}).
start
();
})
})
});
});
// this.moveInTime = Game.getIns().aniEnter.time || 5;
// return new Promise((resolve, reject) => {
// let isPlaying = true;
// this.ske.x = this.startPosition.x;
// this.ske.y = this.startPosition.y;
// this.ske.active = true;
// this.node.active = true;
// this.block.active = true;
// pg.load.loadDB(this.ske, { ske: Game.getIns().aniEnter.skeJsonData.url, tex: Game.getIns().aniEnter.texJsonData.url, png: Game.getIns().aniEnter.texPngData.url }).then((animationName) => {
// cc.tween(this.ske).to(1.3, { x: this.targetPosition.x, y: this.targetPosition.y }).call(() => {
// audioUrl = audioUrl ? audioUrl : Game.getIns().aniEnter.audioUrl;
// if (audioUrl) {
// pg.audio.playAudioByUrl(audioUrl).then(() => {
// isPlaying = false;
// resolve('');
// })
// }
// let db = this.ske.getComponent(dragonBones.ArmatureDisplay);
// db.playAnimation('normal', 1111111);
// db.addEventListener("loopComplete", () => {
// if (!isPlaying) {
// this.block.active = false;
// resolve('');
// }
// })
// }).delay(this.moveInTime).call(() => {
// this.ske.active = false;
// this.node.active = false;
// this.block.active = false;
// }).start();
// })
// });
}
playAudioByUrl
(
audio_url
,
cb
=
null
)
{
if
(
audio_url
)
{
cc
.
assetManager
.
loadRemote
(
audio_url
,
(
err
,
audioClip
:
any
)
=>
{
const
audioId
=
cc
.
audioEngine
.
play
(
audioClip
,
false
,
0.8
);
if
(
cb
)
{
cc
.
audioEngine
.
setFinishCallback
(
audioId
,
()
=>
{
cb
();
});
}
}
});
}
else
{
cb
&&
cb
();
}
}
playLocalAudio
(
audioName
)
{
const
audio
=
this
.
node
.
getChildByName
(
"
audio
"
).
getChildByName
(
audioName
).
getComponent
(
cc
.
AudioSource
);
return
new
Promise
((
resolve
,
reject
)
=>
{
const
id
=
cc
.
audioEngine
.
playEffect
(
audio
.
clip
,
false
);
cc
.
audioEngine
.
setFinishCallback
(
id
,
()
=>
{
resolve
(
id
);
});
})
}
}
}
assets/MRBR02/scene/Game.ts
View file @
b321010c
...
@@ -20,9 +20,13 @@ export class Item {
...
@@ -20,9 +20,13 @@ export class Item {
public
audio
;
public
audio
;
public
image
;
public
image
;
public
optionList
;
public
optionList
;
public
voice
;
public
time
;
constructor
(
data
,
page
)
{
constructor
(
data
,
page
)
{
this
.
audio
=
data
.
audio
;
this
.
audio
=
data
.
audio
;
this
.
image
=
data
.
image
;
this
.
image
=
data
.
image
;
this
.
voice
=
data
.
voice
;
this
.
time
=
data
.
time
;
let
id
=
0
;
let
id
=
0
;
this
.
optionList
=
data
.
optionList
.
map
(
o
=>
{
this
.
optionList
=
data
.
optionList
.
map
(
o
=>
{
...
@@ -46,7 +50,7 @@ export default class Game {
...
@@ -46,7 +50,7 @@ export default class Game {
return
Game
.
ins
;
return
Game
.
ins
;
}
}
private
data
:
any
;
private
data
:
any
;
p
rivate
lists
:
Array
<
Item
>
p
ublic
lists
:
Array
<
Item
>
constructor
()
{
constructor
()
{
//
//
this
.
start
=
false
;
this
.
start
=
false
;
...
...
assets/MRBR02/scene/MRBR02.fire
View file @
b321010c
This diff is collapsed.
Click to expand it.
assets/MRBR02/scene/MRBR02.ts
View file @
b321010c
import
{
asyncDelay
,
onHomeworkFinish
}
from
"
../script/util
"
;
import
{
asyncDelay
,
exchangeNodePos
,
getSprNode
,
onHomeworkFinish
,
playAudio
}
from
"
../script/util
"
;
import
{
MyCocosSceneComponent
}
from
"
../script/MyCocosSceneComponent
"
;
import
{
MyCocosSceneComponent
}
from
"
../script/MyCocosSceneComponent
"
;
import
Game
,
{
Item
,
Option
}
from
"
./Game
"
;
import
Game
,
{
Item
,
Option
}
from
"
./Game
"
;
import
pg
from
"
./pg
"
;
import
pg
from
"
./pg
"
;
...
@@ -51,7 +51,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -51,7 +51,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
Game
.
getIns
().
init
(
this
.
data
);
Game
.
getIns
().
init
(
this
.
data
);
}
}
initView
()
{
initView
()
{
pg
.
view
.
find
(
this
,
"
mouse_start
"
).
getComponent
(
"
mstart
"
).
play
(
);
pg
.
event
.
emit
(
"
mouse_start_play
"
,
{
voice
:
Game
.
getIns
().
aniEnter
.
audioUrl
,
time
:
Game
.
getIns
().
aniEnter
.
time
}
);
}
}
initEvent
()
{
initEvent
()
{
pg
.
view
.
touchOn
(
pg
.
view
.
find
(
this
,
'
bg/bg_card/btn_check
'
),
this
.
onTouchCheck
,
this
);
pg
.
view
.
touchOn
(
pg
.
view
.
find
(
this
,
'
bg/bg_card/btn_check
'
),
this
.
onTouchCheck
,
this
);
...
@@ -61,10 +61,15 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -61,10 +61,15 @@ export default class SceneComponent extends MyCocosSceneComponent {
pg
.
event
.
on
(
"
gameOver
"
,
()
=>
{
this
.
gameOver
()
})
pg
.
event
.
on
(
"
gameOver
"
,
()
=>
{
this
.
gameOver
()
})
}
}
private
currentCards
:
cc
.
Node
[];
private
currentCards
:
cc
.
Node
[];
//开始游戏
//开始游戏
startGame
()
{
startGame
()
{
Game
.
getIns
().
reset
();
Game
.
getIns
().
reset
();
pg
.
event
.
emit
(
"
mouse_num
"
,
Game
.
getIns
().
getTotalPageNum
());
this
.
nextPage
();
this
.
nextPage
();
}
}
nextPage
()
{
nextPage
()
{
...
@@ -211,6 +216,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -211,6 +216,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
})
})
if
(
!
itemBg
||
this
.
currentCards
[
itemBg
.
data
.
count
])
{
if
(
!
itemBg
||
this
.
currentCards
[
itemBg
.
data
.
count
])
{
//回退
//回退
this
.
playLocalAudio
(
"
error
"
);
target
.
setPosition
(
this
.
getPostionById
(
data
.
count
))
target
.
setPosition
(
this
.
getPostionById
(
data
.
count
))
for
(
let
i
=
0
;
i
<
this
.
currentCards
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
this
.
currentCards
.
length
;
i
++
)
{
let
cd
=
this
.
currentCards
[
i
];
let
cd
=
this
.
currentCards
[
i
];
...
@@ -226,6 +232,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -226,6 +232,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
target
.
setPosition
(
pos
);
target
.
setPosition
(
pos
);
this
.
currentCards
[
itemBg
.
data
.
count
]
=
target
;
this
.
currentCards
[
itemBg
.
data
.
count
]
=
target
;
this
.
playLocalAudio
(
"
right
"
);
let
ani_flower
=
cc
.
instantiate
(
this
.
ani_flower
);
let
ani_flower
=
cc
.
instantiate
(
this
.
ani_flower
);
ani_flower
.
active
=
true
;
ani_flower
.
active
=
true
;
target
.
addChild
(
ani_flower
);
target
.
addChild
(
ani_flower
);
...
@@ -251,6 +258,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -251,6 +258,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
if
(
this
.
onTouchCheckCantouch
)
return
;
if
(
this
.
onTouchCheckCantouch
)
return
;
let
isSuccess
=
Game
.
getIns
().
checkSuccess
(
this
.
currentCards
.
map
(
cd
=>
cd
.
data
));
let
isSuccess
=
Game
.
getIns
().
checkSuccess
(
this
.
currentCards
.
map
(
cd
=>
cd
.
data
));
if
(
!
isSuccess
)
{
if
(
!
isSuccess
)
{
this
.
playLocalAudio
(
"
error
"
);
this
.
currentCards
.
forEach
(
card
=>
{
this
.
currentCards
.
forEach
(
card
=>
{
cc
.
tween
(
card
).
to
(
0.3
,
{
x
:
this
.
getPostionById
(
card
.
data
.
count
).
x
,
y
:
this
.
getPostionById
(
card
.
data
.
count
).
y
}).
start
();
cc
.
tween
(
card
).
to
(
0.3
,
{
x
:
this
.
getPostionById
(
card
.
data
.
count
).
x
,
y
:
this
.
getPostionById
(
card
.
data
.
count
).
y
}).
start
();
})
})
...
@@ -259,7 +267,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -259,7 +267,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
}
this
.
onTouchCheckCantouch
=
true
;
this
.
onTouchCheckCantouch
=
true
;
pg
.
event
.
emit
(
"
mouse_add
"
);
pg
.
event
.
emit
(
"
mouse_add
"
);
this
.
updateCardResult
().
then
(
this
.
updateLollipop
.
bind
(
this
)).
then
(()
=>
{
setTimeout
(()
=>
{
this
.
updateCardResult
();
this
.
updateLollipop
().
then
(()
=>
{
Game
.
getIns
().
addPage
();
Game
.
getIns
().
addPage
();
if
(
Game
.
getIns
().
isOver
)
{
if
(
Game
.
getIns
().
isOver
)
{
pg
.
event
.
emit
(
"
gameOver
"
)
pg
.
event
.
emit
(
"
gameOver
"
)
...
@@ -268,21 +278,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -268,21 +278,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
}
this
.
onTouchCheckCantouch
=
false
;
this
.
onTouchCheckCantouch
=
false
;
})
})
},
500
);
}
}
updateCardResult
()
{
updateCardResult
()
{
return
new
Promise
((
res
,
rej
)
=>
{
return
new
Promise
((
res
,
rej
)
=>
{
let
page
=
Game
.
getIns
().
getCurrentPage
();
let
page
=
Game
.
getIns
().
getCurrentPage
();
//显示小老鼠
if
(
page
.
audio
)
{
pg
.
view
.
find
(
this
,
"
mouse_start
"
).
getComponent
(
"
mstart
"
).
play
(
page
.
audio
).
then
(()
=>
{
res
(
true
);
});
}
else
{
setTimeout
(()
=>
{
res
(
true
);
},
1000
);
}
if
(
!!
page
.
image
)
{
if
(
!!
page
.
image
)
{
this
.
layout_card
.
active
=
false
;
this
.
layout_card
.
active
=
false
;
this
.
layout_card_result
.
active
=
true
;
this
.
layout_card_result
.
active
=
true
;
...
@@ -290,6 +290,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -290,6 +290,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
let
img
=
pg
.
view
.
find
(
this
.
layout_card_result
,
"
img
"
);
let
img
=
pg
.
view
.
find
(
this
.
layout_card_result
,
"
img
"
);
pg
.
view
.
setNetImg
(
img
,
page
.
image
,
{
w
:
340
,
h
:
150
})
pg
.
view
.
setNetImg
(
img
,
page
.
image
,
{
w
:
340
,
h
:
150
})
}
}
//显示小老鼠
if
(
page
.
voice
)
{
pg
.
event
.
on
(
"
mouse_start_play_success
"
,
()
=>
{
res
(
true
);
})
pg
.
event
.
emit
(
"
mouse_start_play
"
,
{
voice
:
page
.
voice
,
time
:
page
.
time
});
//
}
else
{
setTimeout
(()
=>
{
res
(
true
);
},
1000
);
}
})
})
}
}
updateLollipop
()
{
updateLollipop
()
{
...
@@ -328,7 +335,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -328,7 +335,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
let
sprite
=
progressbar_red
.
getComponent
(
cc
.
Sprite
);
let
sprite
=
progressbar_red
.
getComponent
(
cc
.
Sprite
);
sprite
.
fillRange
=
1
;
sprite
.
fillRange
=
1
;
let
i2
=
setInterval
(()
=>
{
let
i2
=
setInterval
(()
=>
{
sprite
.
fillRange
-=
0.00
5
;
sprite
.
fillRange
-=
0.00
9
;
},
30
)
},
30
)
setTimeout
(()
=>
{
setTimeout
(()
=>
{
...
...
assets/MRBR02/script/defaultData.ts
View file @
b321010c
export
const
defaultData
=
{
export
const
defaultData
=
{
"
aniEnter
"
:
{
"
skeJsonData
"
:
{},
"
texJsonData
"
:
{},
"
texPngData
"
:
{},
"
audioUrl
"
:
"
http://staging-teach.cdn.ireadabc.com/fe2520ea0b12ad8c482595f6dddf8019.mp3
"
,
"
time
"
:
"
2
"
},
"
item
"
:
{
"
questionList
"
:
[{
"
audio
"
:
""
,
"
image
"
:
""
,
"
optionList
"
:
[{
"
type
"
:
"
text
"
,
"
text
"
:
"
a
"
,
"
image
"
:
""
,
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/116fb7accb5428361836fbc46287f769.mp3
"
},
{
"
type
"
:
"
text
"
,
"
text
"
:
"
b
"
,
"
image
"
:
""
,
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/526624b47ba5e46f698add9e152a4b4e.mp3
"
},
{
"
type
"
:
"
text
"
,
"
text
"
:
""
,
"
image
"
:
""
,
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/fe2520ea0b12ad8c482595f6dddf8019.mp3
"
}],
"
voice
"
:
"
http://staging-teach.cdn.ireadabc.com/7fe846cbce9c853eb000e567eee5e4f6.mp3
"
,
"
time
"
:
"
2
"
},
{
"
audio
"
:
""
,
"
image
"
:
"
http://staging-teach.cdn.ireadabc.com/a5b6943a004bc48b07220f832853bd46.png
"
,
"
optionList
"
:
[{
"
type
"
:
"
picText
"
,
"
text
"
:
"
as
"
,
"
image
"
:
"
http://staging-teach.cdn.ireadabc.com/418486dc95e98b7d3f88f652c4716bbc.png
"
,
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/116fb7accb5428361836fbc46287f769.mp3
"
},
{
"
type
"
:
"
picText
"
,
"
text
"
:
"
bs
"
,
"
image
"
:
"
http://staging-teach.cdn.ireadabc.com/476305ab6763e6821b34f66f1b6a59ed.png
"
,
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/f7fb9f71ab7d460ac2f78c85efba7610.mp3
"
},
{
"
type
"
:
"
picText
"
,
"
text
"
:
"
cd
"
,
"
image
"
:
"
http://staging-teach.cdn.ireadabc.com/cda87159d3d022b6469b186e325c2bb6.png
"
,
"
optionAudio
"
:
""
},
{
"
type
"
:
"
picText
"
,
"
text
"
:
"
dd
"
,
"
image
"
:
"
http://staging-teach.cdn.ireadabc.com/bb4244d166b6d077617ff089f7fd46c4.png
"
,
"
optionAudio
"
:
""
},
{
"
type
"
:
"
picText
"
,
"
text
"
:
"
ed
"
,
"
image
"
:
"
http://staging-teach.cdn.ireadabc.com/be64edcdfed05f4a61690207570f39d7.png
"
,
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/9df3f14bc88bcffc49b6717c40428ed8.mp3
"
}],
"
voice
"
:
"
http://staging-teach.cdn.ireadabc.com/9df3f14bc88bcffc49b6717c40428ed8.mp3
"
,
"
time
"
:
"
5
"
}]
}
}
"
aniEnter
"
:
{
\ No newline at end of file
"
skeJsonData
"
:
{},
"
texJsonData
"
:
{},
"
texPngData
"
:
{},
"
audioUrl
"
:
"
http://staging-teach.cdn.ireadabc.com/7fe846cbce9c853eb000e567eee5e4f6.mp3
"
,
"
time
"
:
"
2
"
},
"
item
"
:
{
"
questionList
"
:
[
{
"
audio
"
:
"
http://staging-teach.cdn.ireadabc.com/116fb7accb5428361836fbc46287f769.mp3
"
,
"
image
"
:
"
http://staging-teach.cdn.ireadabc.com/a5b6943a004bc48b07220f832853bd46.png
"
,
"
optionList
"
:
[
{
"
type
"
:
"
picText
"
,
"
text
"
:
"
as
"
,
"
image
"
:
"
http://staging-teach.cdn.ireadabc.com/418486dc95e98b7d3f88f652c4716bbc.png
"
,
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/116fb7accb5428361836fbc46287f769.mp3
"
},
{
"
type
"
:
"
picText
"
,
"
text
"
:
"
bs
"
,
"
image
"
:
"
http://staging-teach.cdn.ireadabc.com/476305ab6763e6821b34f66f1b6a59ed.png
"
,
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/f7fb9f71ab7d460ac2f78c85efba7610.mp3
"
},
]
},
{
"
audio
"
:
""
,
"
image
"
:
""
,
"
optionList
"
:
[{
"
type
"
:
"
text
"
,
"
text
"
:
"
a
"
,
"
image
"
:
""
,
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/116fb7accb5428361836fbc46287f769.mp3
"
},
{
"
type
"
:
"
text
"
,
"
text
"
:
"
b
"
,
"
image
"
:
""
,
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/526624b47ba5e46f698add9e152a4b4e.mp3
"
},
{
"
type
"
:
"
text
"
,
"
text
"
:
""
,
"
image
"
:
""
,
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/fe2520ea0b12ad8c482595f6dddf8019.mp3
"
}]
}
]
}
}
\ No newline at end of file
creator.d.ts
View file @
b321010c
...
@@ -3571,6 +3571,8 @@ declare namespace cc {
...
@@ -3571,6 +3571,8 @@ declare namespace cc {
!#zh 获取节点正前方(z 轴)面对的方向,返回值为世界坐标系下的归一化向量 */
!#zh 获取节点正前方(z 轴)面对的方向,返回值为世界坐标系下的归一化向量 */
forward
:
Vec3
;
forward
:
Vec3
;
data
:
any
;
data
:
any
;
star
:
Node
;
starBig
:
Node
;
/**
/**
@param name name
@param name name
form/src/app/form/form.component.html
View file @
b321010c
...
@@ -43,6 +43,15 @@
...
@@ -43,6 +43,15 @@
<div
*
ngFor=
"let question of item.questionList; let i = index"
class=
"card-item clearfix"
<div
*
ngFor=
"let question of item.questionList; let i = index"
class=
"card-item clearfix"
style=
"padding: 0.5vw; width: 100%; "
>
style=
"padding: 0.5vw; width: 100%; "
>
<div
class=
"card-item-content border"
>
<div
class=
"card-item-content border"
>
<div>
<div
style=
"height: 30px; font-size: 18px;"
>
动画提示音频:
</div>
<app-audio-recorder
[
audioUrl
]="
question
.
voice
"
(
audioUploaded
)="
onVioceUploadSuccess
($
event
,
i
)"
>
</app-audio-recorder>
</div>
<div>
动画停留时间:
<input
type=
"text"
nz-input
[(
ngModel
)]="
question
.
time
"
(
ngModelChange
)="
this
.
onTxtChangeAniEnter
($
event
,
i
)"
>
</div>
<div>
<div>
<span
style=
"height: 30px; font-size: 18px;"
>
完整单词:
</span>
<span
style=
"height: 30px; font-size: 18px;"
>
完整单词:
</span>
<span
style=
"height: 30px; font-size: 18px;"
>
{{getQuestionText(question)}}
</span>
<span
style=
"height: 30px; font-size: 18px;"
>
{{getQuestionText(question)}}
</span>
...
...
form/src/app/form/form.component.ts
View file @
b321010c
...
@@ -35,7 +35,9 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -35,7 +35,9 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
"
type
"
:
0
,
"
type
"
:
0
,
"
text
"
:
""
,
"
text
"
:
""
,
"
image
"
:
""
,
"
image
"
:
""
,
"
optionAudio
"
:
""
"
optionAudio
"
:
""
,
"
time
"
:
''
,
'
voice
'
:
''
,
}]
}]
}
}
);
);
...
@@ -58,7 +60,9 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -58,7 +60,9 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
"
type
"
:
0
,
"
type
"
:
0
,
"
text
"
:
""
,
"
text
"
:
""
,
"
image
"
:
""
,
"
image
"
:
""
,
"
optionAudio
"
:
""
"
optionAudio
"
:
""
,
"
time
"
:
''
,
'
voice
'
:
''
,
});
});
this
.
save
();
this
.
save
();
}
}
...
@@ -85,7 +89,9 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -85,7 +89,9 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
"
type
"
:
0
,
"
type
"
:
0
,
"
text
"
:
""
,
"
text
"
:
""
,
"
image
"
:
""
,
"
image
"
:
""
,
"
optionAudio
"
:
""
"
optionAudio
"
:
""
,
"
time
"
:
''
,
'
voice
'
:
''
,
}]
}]
}]
}]
};
};
...
@@ -119,6 +125,10 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -119,6 +125,10 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
init
()
{
init
()
{
}
onVioceUploadSuccess
(
e
,
questionIdx
)
{
this
.
item
.
questionList
[
questionIdx
].
voice
=
e
.
url
;
this
.
save
();
}
}
onAudioUploadSuccess
(
e
,
questionIdx
)
{
onAudioUploadSuccess
(
e
,
questionIdx
)
{
this
.
item
.
questionList
[
questionIdx
].
audio
=
e
.
url
;
this
.
item
.
questionList
[
questionIdx
].
audio
=
e
.
url
;
...
...
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