Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dfzx_cocos_dqq
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
dfzx_cocos_dqq
Commits
ba5dcce4
Commit
ba5dcce4
authored
Mar 16, 2021
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 项目初始化
parent
3f6c5725
Changes
38
Show whitespace changes
Inline
Side-by-side
Showing
38 changed files
with
1525 additions
and
1729 deletions
+1525
-1729
scene.meta
play/assets/scene.meta
+1
-1
audios.meta
play/assets/scene/audios.meta
+1
-1
.keep
play/assets/scene/audios/.keep
+0
-0
dragonBones.meta
play/assets/scene/dragonBones.meta
+1
-1
.keep
play/assets/scene/dragonBones/.keep
+0
-0
fonts.meta
play/assets/scene/fonts.meta
+1
-1
.keep
play/assets/scene/fonts/.keep
+0
-0
scene.meta
play/assets/scene/scene.meta
+12
-0
scene.fire
play/assets/scene/scene/scene.fire
+412
-0
scene.fire.meta
play/assets/scene/scene/scene.fire.meta
+2
-2
scene.js
play/assets/scene/scene/scene.js
+4
-9
scene.js.meta
play/assets/scene/scene/scene.js.meta
+1
-1
script.meta
play/assets/scene/script.meta
+1
-1
runtime.js
play/assets/scene/script/runtime.js
+727
-0
runtime.js.meta
play/assets/scene/script/runtime.js.meta
+2
-2
util.js
play/assets/scene/script/util.js
+353
-0
util.js.meta
play/assets/scene/script/util.js.meta
+1
-1
textures.meta
play/assets/scene/textures.meta
+1
-1
.keep
play/assets/scene/textures/.keep
+0
-0
tmpGame.meta
play/assets/tmpGame.meta
+0
-12
btn.mp3
play/assets/tmpGame/audios/btn.mp3
+0
-0
btn.mp3.meta
play/assets/tmpGame/audios/btn.mp3.meta
+0
-7
BRLNSDB.TTF
play/assets/tmpGame/fonts/BRLNSDB.TTF
+0
-0
BRLNSDB.TTF.meta
play/assets/tmpGame/fonts/BRLNSDB.TTF.meta
+0
-5
Scene.fire
play/assets/tmpGame/scene/Scene.fire
+0
-1303
utils.js
play/assets/tmpGame/script/utils.js
+0
-199
1orange.png
play/assets/tmpGame/textures/1orange.png
+0
-0
1orange.png.meta
play/assets/tmpGame/textures/1orange.png.meta
+0
-36
bg.jpg
play/assets/tmpGame/textures/bg.jpg
+0
-0
bg.jpg.meta
play/assets/tmpGame/textures/bg.jpg.meta
+0
-36
btn_left.png
play/assets/tmpGame/textures/btn_left.png
+0
-0
btn_left.png.meta
play/assets/tmpGame/textures/btn_left.png.meta
+0
-36
btn_right.png
play/assets/tmpGame/textures/btn_right.png
+0
-0
btn_right.png.meta
play/assets/tmpGame/textures/btn_right.png.meta
+0
-36
icon.png
play/assets/tmpGame/textures/icon.png
+0
-0
icon.png.meta
play/assets/tmpGame/textures/icon.png.meta
+0
-36
project.json
play/project.json
+1
-1
project.json
play/settings/project.json
+4
-1
No files found.
play/assets/
tmpGame/
scene.meta
→
play/assets/scene.meta
View file @
ba5dcce4
{
"ver": "1.1.2",
"uuid": "
e8bd16b0-3804-45a9-a8ca-f52c02224f55
",
"uuid": "
a7dbdad0-bc79-4d00-b2c0-2f8f839a0bf8
",
"isBundle": false,
"bundleName": "",
"priority": 1,
...
...
play/assets/
tmpGam
e/audios.meta
→
play/assets/
scen
e/audios.meta
View file @
ba5dcce4
{
"ver": "1.1.2",
"uuid": "
cb9fa4ea-66ca-45af-ad31-e445c7b0ef32
",
"uuid": "
dcdd29cc-cf8a-44d0-a649-9fc6fed9b5cd
",
"isBundle": false,
"bundleName": "",
"priority": 1,
...
...
play/assets/
tmpGam
e/audios/.keep
→
play/assets/
scen
e/audios/.keep
View file @
ba5dcce4
File moved
play/assets/
tmpGam
e/dragonBones.meta
→
play/assets/
scen
e/dragonBones.meta
View file @
ba5dcce4
{
"ver": "1.1.2",
"uuid": "
0853721c-3f55-4eb2-873d-e3081cfadd4b
",
"uuid": "
40c8d2a5-e0e9-4200-8c83-1d51ef8cb2e0
",
"isBundle": false,
"bundleName": "",
"priority": 1,
...
...
play/assets/
tmpGam
e/dragonBones/.keep
→
play/assets/
scen
e/dragonBones/.keep
View file @
ba5dcce4
File moved
play/assets/
tmpGam
e/fonts.meta
→
play/assets/
scen
e/fonts.meta
View file @
ba5dcce4
{
"ver": "1.1.2",
"uuid": "
20185448-a1ca-4de2-8b37-7bf6cdfccbae
",
"uuid": "
1ffd43c5-1545-473c-8dc5-cc0e8f8fb935
",
"isBundle": false,
"bundleName": "",
"priority": 1,
...
...
play/assets/
tmpGam
e/fonts/.keep
→
play/assets/
scen
e/fonts/.keep
View file @
ba5dcce4
File moved
play/assets/scene/scene.meta
0 → 100644
View file @
ba5dcce4
{
"ver": "1.1.2",
"uuid": "2f84b813-8106-4fb7-8526-1e0e3d5cc343",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
play/assets/scene/scene/scene.fire
0 → 100644
View file @
ba5dcce4
[
{
"__type__": "cc.SceneAsset",
"_name": "",
"_objFlags": 0,
"_native": "",
"scene": {
"__id__": 1
}
},
{
"__type__": "cc.Scene",
"_objFlags": 0,
"_parent": null,
"_children": [
{
"__id__": 2
}
],
"_active": false,
"_components": [],
"_prefab": null,
"_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,
"y": 0
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_is3DNode": true,
"_groupIndex": 0,
"groupIndex": 0,
"autoReleaseAssets": true,
"_id": "7d7fd49c-0439-4279-aa39-173d3404efdb"
},
{
"__type__": "cc.Node",
"_name": "Canvas",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 3
},
{
"__id__": 5
}
],
"_active": true,
"_components": [
{
"__id__": 8
},
{
"__id__": 9
},
{
"__id__": 10
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
640,
360,
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": "a5esZu+45LA5mBpvttspPD"
},
{
"__type__": "cc.Node",
"_name": "Main Camera",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 4
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
362.85545494732423,
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": "e1WoFrQ79G7r4ZuQE3HlNb"
},
{
"__type__": "cc.Camera",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
},
"_enabled": true,
"_cullingMask": 4294967295,
"_clearFlags": 7,
"_backgroundColor": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_depth": -1,
"_zoomRatio": 1,
"_targetTexture": null,
"_fov": 60,
"_orthoSize": 10,
"_nearClip": 1,
"_farClip": 4096,
"_ortho": true,
"_rect": {
"__type__": "cc.Rect",
"x": 0,
"y": 0,
"width": 1,
"height": 1
},
"_renderStages": 1,
"_alignWithScreen": true,
"_id": "81GN3uXINKVLeW4+iKSlim"
},
{
"__type__": "cc.Node",
"_name": "bg",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 6
},
{
"__id__": 7
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
},
"_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": "32MJMZ2HRGF4BOf533Avyi"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": null,
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "97/S6HDq9MeqgmV1Zwnhbb"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 1280,
"_originalHeight": 720,
"_id": "17A0y7MFRMZa6h7EBnzO0u"
},
{
"__type__": "cc.Canvas",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_designResolution": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
},
"_fitWidth": true,
"_fitHeight": false,
"_id": "59Cd0ovbdF4byw5sbjJDx7"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "29zXboiXFBKoIV4PQ2liTe"
},
{
"__type__": "4225eAWlg9IRYwHAtS39NnE",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_id": "1efsg28gpO0Izi6VsKWew7"
}
]
\ No newline at end of file
play/assets/
tmpGame/scene/S
cene.fire.meta
→
play/assets/
scene/scene/s
cene.fire.meta
View file @
ba5dcce4
{
"ver": "1.2.
7
",
"uuid": "
57ea7c61-9b8b-498a-b024-c98ee9124be
b",
"ver": "1.2.
9
",
"uuid": "
7d7fd49c-0439-4279-aa39-173d3404efd
b",
"asyncLoadAssets": false,
"autoReleaseAssets": true,
"subMetas": {}
...
...
play/assets/
tmpGame/script/S
cene.js
→
play/assets/
scene/scene/s
cene.js
View file @
ba5dcce4
// Learn cc.Class:
// - https://docs.cocos.com/creator/manual/en/scripting/class.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
{
onHomeworkFinish
}
from
"
./util
"
;
cc
.
Class
({
...
...
@@ -35,7 +28,6 @@ cc.Class({
_mapScaleMax
:
null
,
// 场景中常用缩放(取小值)
_cocosScale
:
null
,
// cocos 自缩放 (较少用到)
initSize
()
{
// 注意cc.winSize只有在适配后(修改fitHeight/fitWidth后)才能获取到正确的值,因此使用cc.getFrameSize()来获取初始的屏幕大小
let
screen_size
=
cc
.
view
.
getFrameSize
().
width
/
cc
.
view
.
getFrameSize
().
height
let
design_size
=
cc
.
Canvas
.
instance
.
designResolution
.
width
/
cc
.
Canvas
.
instance
.
designResolution
.
height
...
...
@@ -240,6 +232,9 @@ cc.Class({
this
.
curPage
=
0
this
.
leftMove
();
// 游戏结束时需要调用这个方法通知系统作业完成
onHomeworkFinish
();
cc
.
audioEngine
.
play
(
this
.
audioBtn
.
clip
,
false
,
0.8
)
})
...
...
play/assets/
tmpGame/script/utils
.js.meta
→
play/assets/
scene/scene/scene
.js.meta
View file @
ba5dcce4
{
"ver": "1.0.8",
"uuid": "
d545f402-231b-417e-99e6-3269412a5a2c
",
"uuid": "
4225e016-960f-4845-8c07-02d4b7f4d9c4
",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
...
...
play/assets/
tmpGam
e/script.meta
→
play/assets/
scen
e/script.meta
View file @
ba5dcce4
{
"ver": "1.1.2",
"uuid": "
b0c008bc-cf92-463b-8360-0984e13c2e4d
",
"uuid": "
6053a808-56fe-49ba-a794-df945959e686
",
"isBundle": false,
"bundleName": "",
"priority": 1,
...
...
play/assets/scene/script/runtime.js
0 → 100644
View file @
ba5dcce4
/**
* Copyright (c) 2014-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
!
(
function
(
global
)
{
"
use strict
"
;
var
Op
=
Object
.
prototype
;
var
hasOwn
=
Op
.
hasOwnProperty
;
var
undefined
;
// More compressible than void 0.
var
$Symbol
=
typeof
Symbol
===
"
function
"
?
Symbol
:
{};
var
iteratorSymbol
=
$Symbol
.
iterator
||
"
@@iterator
"
;
var
asyncIteratorSymbol
=
$Symbol
.
asyncIterator
||
"
@@asyncIterator
"
;
var
toStringTagSymbol
=
$Symbol
.
toStringTag
||
"
@@toStringTag
"
;
var
inModule
=
typeof
module
===
"
object
"
;
var
runtime
=
global
.
regeneratorRuntime
;
if
(
runtime
)
{
if
(
inModule
)
{
// If regeneratorRuntime is defined globally and we're in a module,
// make the exports object identical to regeneratorRuntime.
module
.
exports
=
runtime
;
}
// Don't bother evaluating the rest of this file if the runtime was
// already defined globally.
return
;
}
// Define the runtime globally (as expected by generated code) as either
// module.exports (if we're in a module) or a new, empty object.
runtime
=
global
.
regeneratorRuntime
=
inModule
?
module
.
exports
:
{};
function
wrap
(
innerFn
,
outerFn
,
self
,
tryLocsList
)
{
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
var
protoGenerator
=
outerFn
&&
outerFn
.
prototype
instanceof
Generator
?
outerFn
:
Generator
;
var
generator
=
Object
.
create
(
protoGenerator
.
prototype
);
var
context
=
new
Context
(
tryLocsList
||
[]);
// The ._invoke method unifies the implementations of the .next,
// .throw, and .return methods.
generator
.
_invoke
=
makeInvokeMethod
(
innerFn
,
self
,
context
);
return
generator
;
}
runtime
.
wrap
=
wrap
;
// Try/catch helper to minimize deoptimizations. Returns a completion
// record like context.tryEntries[i].completion. This interface could
// have been (and was previously) designed to take a closure to be
// invoked without arguments, but in all the cases we care about we
// already have an existing method we want to call, so there's no need
// to create a new function object. We can even get away with assuming
// the method takes exactly one argument, since that happens to be true
// in every case, so we don't have to touch the arguments object. The
// only additional allocation required is the completion record, which
// has a stable shape and so hopefully should be cheap to allocate.
function
tryCatch
(
fn
,
obj
,
arg
)
{
try
{
return
{
type
:
"
normal
"
,
arg
:
fn
.
call
(
obj
,
arg
)
};
}
catch
(
err
)
{
return
{
type
:
"
throw
"
,
arg
:
err
};
}
}
var
GenStateSuspendedStart
=
"
suspendedStart
"
;
var
GenStateSuspendedYield
=
"
suspendedYield
"
;
var
GenStateExecuting
=
"
executing
"
;
var
GenStateCompleted
=
"
completed
"
;
// Returning this object from the innerFn has the same effect as
// breaking out of the dispatch switch statement.
var
ContinueSentinel
=
{};
// Dummy constructor functions that we use as the .constructor and
// .constructor.prototype properties for functions that return Generator
// objects. For full spec compliance, you may wish to configure your
// minifier not to mangle the names of these two functions.
function
Generator
()
{
}
function
GeneratorFunction
()
{
}
function
GeneratorFunctionPrototype
()
{
}
// This is a polyfill for %IteratorPrototype% for environments that
// don't natively support it.
var
IteratorPrototype
=
{};
IteratorPrototype
[
iteratorSymbol
]
=
function
()
{
return
this
;
};
var
getProto
=
Object
.
getPrototypeOf
;
var
NativeIteratorPrototype
=
getProto
&&
getProto
(
getProto
(
values
([])));
if
(
NativeIteratorPrototype
&&
NativeIteratorPrototype
!==
Op
&&
hasOwn
.
call
(
NativeIteratorPrototype
,
iteratorSymbol
))
{
// This environment has a native %IteratorPrototype%; use it instead
// of the polyfill.
IteratorPrototype
=
NativeIteratorPrototype
;
}
var
Gp
=
GeneratorFunctionPrototype
.
prototype
=
Generator
.
prototype
=
Object
.
create
(
IteratorPrototype
);
GeneratorFunction
.
prototype
=
Gp
.
constructor
=
GeneratorFunctionPrototype
;
GeneratorFunctionPrototype
.
constructor
=
GeneratorFunction
;
GeneratorFunctionPrototype
[
toStringTagSymbol
]
=
GeneratorFunction
.
displayName
=
"
GeneratorFunction
"
;
// Helper for defining the .next, .throw, and .return methods of the
// Iterator interface in terms of a single ._invoke method.
function
defineIteratorMethods
(
prototype
)
{
[
"
next
"
,
"
throw
"
,
"
return
"
].
forEach
(
function
(
method
)
{
prototype
[
method
]
=
function
(
arg
)
{
return
this
.
_invoke
(
method
,
arg
);
};
});
}
runtime
.
isGeneratorFunction
=
function
(
genFun
)
{
var
ctor
=
typeof
genFun
===
"
function
"
&&
genFun
.
constructor
;
return
ctor
?
ctor
===
GeneratorFunction
||
// For the native GeneratorFunction constructor, the best we can
// do is to check its .name property.
(
ctor
.
displayName
||
ctor
.
name
)
===
"
GeneratorFunction
"
:
false
;
};
runtime
.
mark
=
function
(
genFun
)
{
if
(
Object
.
setPrototypeOf
)
{
Object
.
setPrototypeOf
(
genFun
,
GeneratorFunctionPrototype
);
}
else
{
genFun
.
__proto__
=
GeneratorFunctionPrototype
;
if
(
!
(
toStringTagSymbol
in
genFun
))
{
genFun
[
toStringTagSymbol
]
=
"
GeneratorFunction
"
;
}
}
genFun
.
prototype
=
Object
.
create
(
Gp
);
return
genFun
;
};
// Within the body of any async function, `await x` is transformed to
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
// `hasOwn.call(value, "__await")` to determine if the yielded value is
// meant to be awaited.
runtime
.
awrap
=
function
(
arg
)
{
return
{
__await
:
arg
};
};
function
AsyncIterator
(
generator
)
{
function
invoke
(
method
,
arg
,
resolve
,
reject
)
{
var
record
=
tryCatch
(
generator
[
method
],
generator
,
arg
);
if
(
record
.
type
===
"
throw
"
)
{
reject
(
record
.
arg
);
}
else
{
var
result
=
record
.
arg
;
var
value
=
result
.
value
;
if
(
value
&&
typeof
value
===
"
object
"
&&
hasOwn
.
call
(
value
,
"
__await
"
))
{
return
Promise
.
resolve
(
value
.
__await
).
then
(
function
(
value
)
{
invoke
(
"
next
"
,
value
,
resolve
,
reject
);
},
function
(
err
)
{
invoke
(
"
throw
"
,
err
,
resolve
,
reject
);
});
}
return
Promise
.
resolve
(
value
).
then
(
function
(
unwrapped
)
{
// When a yielded Promise is resolved, its final value becomes
// the .value of the Promise<{value,done}> result for the
// current iteration. If the Promise is rejected, however, the
// result for this iteration will be rejected with the same
// reason. Note that rejections of yielded Promises are not
// thrown back into the generator function, as is the case
// when an awaited Promise is rejected. This difference in
// behavior between yield and await is important, because it
// allows the consumer to decide what to do with the yielded
// rejection (swallow it and continue, manually .throw it back
// into the generator, abandon iteration, whatever). With
// await, by contrast, there is no opportunity to examine the
// rejection reason outside the generator function, so the
// only option is to throw it from the await expression, and
// let the generator function handle the exception.
result
.
value
=
unwrapped
;
resolve
(
result
);
},
reject
);
}
}
var
previousPromise
;
function
enqueue
(
method
,
arg
)
{
function
callInvokeWithMethodAndArg
()
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
invoke
(
method
,
arg
,
resolve
,
reject
);
});
}
return
previousPromise
=
// If enqueue has been called before, then we want to wait until
// all previous Promises have been resolved before calling invoke,
// so that results are always delivered in the correct order. If
// enqueue has not been called before, then it is important to
// call invoke immediately, without waiting on a callback to fire,
// so that the async generator function has the opportunity to do
// any necessary setup in a predictable way. This predictability
// is why the Promise constructor synchronously invokes its
// executor callback, and why async functions synchronously
// execute code before the first await. Since we implement simple
// async functions in terms of async generators, it is especially
// important to get this right, even though it requires care.
previousPromise
?
previousPromise
.
then
(
callInvokeWithMethodAndArg
,
// Avoid propagating failures to Promises returned by later
// invocations of the iterator.
callInvokeWithMethodAndArg
)
:
callInvokeWithMethodAndArg
();
}
// Define the unified helper method that is used to implement .next,
// .throw, and .return (see defineIteratorMethods).
this
.
_invoke
=
enqueue
;
}
defineIteratorMethods
(
AsyncIterator
.
prototype
);
AsyncIterator
.
prototype
[
asyncIteratorSymbol
]
=
function
()
{
return
this
;
};
runtime
.
AsyncIterator
=
AsyncIterator
;
// Note that simple async functions are implemented on top of
// AsyncIterator objects; they just return a Promise for the value of
// the final result produced by the iterator.
runtime
.
async
=
function
(
innerFn
,
outerFn
,
self
,
tryLocsList
)
{
var
iter
=
new
AsyncIterator
(
wrap
(
innerFn
,
outerFn
,
self
,
tryLocsList
)
);
return
runtime
.
isGeneratorFunction
(
outerFn
)
?
iter
// If outerFn is a generator, return the full iterator.
:
iter
.
next
().
then
(
function
(
result
)
{
return
result
.
done
?
result
.
value
:
iter
.
next
();
});
};
function
makeInvokeMethod
(
innerFn
,
self
,
context
)
{
var
state
=
GenStateSuspendedStart
;
return
function
invoke
(
method
,
arg
)
{
if
(
state
===
GenStateExecuting
)
{
throw
new
Error
(
"
Generator is already running
"
);
}
if
(
state
===
GenStateCompleted
)
{
if
(
method
===
"
throw
"
)
{
throw
arg
;
}
// Be forgiving, per 25.3.3.3.3 of the spec:
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
return
doneResult
();
}
context
.
method
=
method
;
context
.
arg
=
arg
;
while
(
true
)
{
var
delegate
=
context
.
delegate
;
if
(
delegate
)
{
var
delegateResult
=
maybeInvokeDelegate
(
delegate
,
context
);
if
(
delegateResult
)
{
if
(
delegateResult
===
ContinueSentinel
)
continue
;
return
delegateResult
;
}
}
if
(
context
.
method
===
"
next
"
)
{
// Setting context._sent for legacy support of Babel's
// function.sent implementation.
context
.
sent
=
context
.
_sent
=
context
.
arg
;
}
else
if
(
context
.
method
===
"
throw
"
)
{
if
(
state
===
GenStateSuspendedStart
)
{
state
=
GenStateCompleted
;
throw
context
.
arg
;
}
context
.
dispatchException
(
context
.
arg
);
}
else
if
(
context
.
method
===
"
return
"
)
{
context
.
abrupt
(
"
return
"
,
context
.
arg
);
}
state
=
GenStateExecuting
;
var
record
=
tryCatch
(
innerFn
,
self
,
context
);
if
(
record
.
type
===
"
normal
"
)
{
// If an exception is thrown from innerFn, we leave state ===
// GenStateExecuting and loop back for another invocation.
state
=
context
.
done
?
GenStateCompleted
:
GenStateSuspendedYield
;
if
(
record
.
arg
===
ContinueSentinel
)
{
continue
;
}
return
{
value
:
record
.
arg
,
done
:
context
.
done
};
}
else
if
(
record
.
type
===
"
throw
"
)
{
state
=
GenStateCompleted
;
// Dispatch the exception by looping back around to the
// context.dispatchException(context.arg) call above.
context
.
method
=
"
throw
"
;
context
.
arg
=
record
.
arg
;
}
}
};
}
// Call delegate.iterator[context.method](context.arg) and handle the
// result, either by returning a { value, done } result from the
// delegate iterator, or by modifying context.method and context.arg,
// setting context.delegate to null, and returning the ContinueSentinel.
function
maybeInvokeDelegate
(
delegate
,
context
)
{
var
method
=
delegate
.
iterator
[
context
.
method
];
if
(
method
===
undefined
)
{
// A .throw or .return when the delegate iterator has no .throw
// method always terminates the yield* loop.
context
.
delegate
=
null
;
if
(
context
.
method
===
"
throw
"
)
{
if
(
delegate
.
iterator
.
return
)
{
// If the delegate iterator has a return method, give it a
// chance to clean up.
context
.
method
=
"
return
"
;
context
.
arg
=
undefined
;
maybeInvokeDelegate
(
delegate
,
context
);
if
(
context
.
method
===
"
throw
"
)
{
// If maybeInvokeDelegate(context) changed context.method from
// "return" to "throw", let that override the TypeError below.
return
ContinueSentinel
;
}
}
context
.
method
=
"
throw
"
;
context
.
arg
=
new
TypeError
(
"
The iterator does not provide a 'throw' method
"
);
}
return
ContinueSentinel
;
}
var
record
=
tryCatch
(
method
,
delegate
.
iterator
,
context
.
arg
);
if
(
record
.
type
===
"
throw
"
)
{
context
.
method
=
"
throw
"
;
context
.
arg
=
record
.
arg
;
context
.
delegate
=
null
;
return
ContinueSentinel
;
}
var
info
=
record
.
arg
;
if
(
!
info
)
{
context
.
method
=
"
throw
"
;
context
.
arg
=
new
TypeError
(
"
iterator result is not an object
"
);
context
.
delegate
=
null
;
return
ContinueSentinel
;
}
if
(
info
.
done
)
{
// Assign the result of the finished delegate to the temporary
// variable specified by delegate.resultName (see delegateYield).
context
[
delegate
.
resultName
]
=
info
.
value
;
// Resume execution at the desired location (see delegateYield).
context
.
next
=
delegate
.
nextLoc
;
// If context.method was "throw" but the delegate handled the
// exception, let the outer generator proceed normally. If
// context.method was "next", forget context.arg since it has been
// "consumed" by the delegate iterator. If context.method was
// "return", allow the original .return call to continue in the
// outer generator.
if
(
context
.
method
!==
"
return
"
)
{
context
.
method
=
"
next
"
;
context
.
arg
=
undefined
;
}
}
else
{
// Re-yield the result returned by the delegate method.
return
info
;
}
// The delegate iterator is finished, so forget it and continue with
// the outer generator.
context
.
delegate
=
null
;
return
ContinueSentinel
;
}
// Define Generator.prototype.{next,throw,return} in terms of the
// unified ._invoke helper method.
defineIteratorMethods
(
Gp
);
Gp
[
toStringTagSymbol
]
=
"
Generator
"
;
// A Generator should always return itself as the iterator object when the
// @@iterator function is called on it. Some browsers' implementations of the
// iterator prototype chain incorrectly implement this, causing the Generator
// object to not be returned from this call. This ensures that doesn't happen.
// See https://github.com/facebook/regenerator/issues/274 for more details.
Gp
[
iteratorSymbol
]
=
function
()
{
return
this
;
};
Gp
.
toString
=
function
()
{
return
"
[object Generator]
"
;
};
function
pushTryEntry
(
locs
)
{
var
entry
=
{
tryLoc
:
locs
[
0
]
};
if
(
1
in
locs
)
{
entry
.
catchLoc
=
locs
[
1
];
}
if
(
2
in
locs
)
{
entry
.
finallyLoc
=
locs
[
2
];
entry
.
afterLoc
=
locs
[
3
];
}
this
.
tryEntries
.
push
(
entry
);
}
function
resetTryEntry
(
entry
)
{
var
record
=
entry
.
completion
||
{};
record
.
type
=
"
normal
"
;
delete
record
.
arg
;
entry
.
completion
=
record
;
}
function
Context
(
tryLocsList
)
{
// The root entry object (effectively a try statement without a catch
// or a finally block) gives us a place to store values thrown from
// locations where there is no enclosing try statement.
this
.
tryEntries
=
[{
tryLoc
:
"
root
"
}];
tryLocsList
.
forEach
(
pushTryEntry
,
this
);
this
.
reset
(
true
);
}
runtime
.
keys
=
function
(
object
)
{
var
keys
=
[];
for
(
var
key
in
object
)
{
keys
.
push
(
key
);
}
keys
.
reverse
();
// Rather than returning an object with a next method, we keep
// things simple and return the next function itself.
return
function
next
()
{
while
(
keys
.
length
)
{
var
key
=
keys
.
pop
();
if
(
key
in
object
)
{
next
.
value
=
key
;
next
.
done
=
false
;
return
next
;
}
}
// To avoid creating an additional object, we just hang the .value
// and .done properties off the next function object itself. This
// also ensures that the minifier will not anonymize the function.
next
.
done
=
true
;
return
next
;
};
};
function
values
(
iterable
)
{
if
(
iterable
)
{
var
iteratorMethod
=
iterable
[
iteratorSymbol
];
if
(
iteratorMethod
)
{
return
iteratorMethod
.
call
(
iterable
);
}
if
(
typeof
iterable
.
next
===
"
function
"
)
{
return
iterable
;
}
if
(
!
isNaN
(
iterable
.
length
))
{
var
i
=
-
1
,
next
=
function
next
()
{
while
(
++
i
<
iterable
.
length
)
{
if
(
hasOwn
.
call
(
iterable
,
i
))
{
next
.
value
=
iterable
[
i
];
next
.
done
=
false
;
return
next
;
}
}
next
.
value
=
undefined
;
next
.
done
=
true
;
return
next
;
};
return
next
.
next
=
next
;
}
}
// Return an iterator with no values.
return
{
next
:
doneResult
};
}
runtime
.
values
=
values
;
function
doneResult
()
{
return
{
value
:
undefined
,
done
:
true
};
}
Context
.
prototype
=
{
constructor
:
Context
,
reset
:
function
(
skipTempReset
)
{
this
.
prev
=
0
;
this
.
next
=
0
;
// Resetting context._sent for legacy support of Babel's
// function.sent implementation.
this
.
sent
=
this
.
_sent
=
undefined
;
this
.
done
=
false
;
this
.
delegate
=
null
;
this
.
method
=
"
next
"
;
this
.
arg
=
undefined
;
this
.
tryEntries
.
forEach
(
resetTryEntry
);
if
(
!
skipTempReset
)
{
for
(
var
name
in
this
)
{
// Not sure about the optimal order of these conditions:
if
(
name
.
charAt
(
0
)
===
"
t
"
&&
hasOwn
.
call
(
this
,
name
)
&&
!
isNaN
(
+
name
.
slice
(
1
)))
{
this
[
name
]
=
undefined
;
}
}
}
},
stop
:
function
()
{
this
.
done
=
true
;
var
rootEntry
=
this
.
tryEntries
[
0
];
var
rootRecord
=
rootEntry
.
completion
;
if
(
rootRecord
.
type
===
"
throw
"
)
{
throw
rootRecord
.
arg
;
}
return
this
.
rval
;
},
dispatchException
:
function
(
exception
)
{
if
(
this
.
done
)
{
throw
exception
;
}
var
context
=
this
;
function
handle
(
loc
,
caught
)
{
record
.
type
=
"
throw
"
;
record
.
arg
=
exception
;
context
.
next
=
loc
;
if
(
caught
)
{
// If the dispatched exception was caught by a catch block,
// then let that catch block handle the exception normally.
context
.
method
=
"
next
"
;
context
.
arg
=
undefined
;
}
return
!!
caught
;
}
for
(
var
i
=
this
.
tryEntries
.
length
-
1
;
i
>=
0
;
--
i
)
{
var
entry
=
this
.
tryEntries
[
i
];
var
record
=
entry
.
completion
;
if
(
entry
.
tryLoc
===
"
root
"
)
{
// Exception thrown outside of any try block that could handle
// it, so set the completion value of the entire function to
// throw the exception.
return
handle
(
"
end
"
);
}
if
(
entry
.
tryLoc
<=
this
.
prev
)
{
var
hasCatch
=
hasOwn
.
call
(
entry
,
"
catchLoc
"
);
var
hasFinally
=
hasOwn
.
call
(
entry
,
"
finallyLoc
"
);
if
(
hasCatch
&&
hasFinally
)
{
if
(
this
.
prev
<
entry
.
catchLoc
)
{
return
handle
(
entry
.
catchLoc
,
true
);
}
else
if
(
this
.
prev
<
entry
.
finallyLoc
)
{
return
handle
(
entry
.
finallyLoc
);
}
}
else
if
(
hasCatch
)
{
if
(
this
.
prev
<
entry
.
catchLoc
)
{
return
handle
(
entry
.
catchLoc
,
true
);
}
}
else
if
(
hasFinally
)
{
if
(
this
.
prev
<
entry
.
finallyLoc
)
{
return
handle
(
entry
.
finallyLoc
);
}
}
else
{
throw
new
Error
(
"
try statement without catch or finally
"
);
}
}
}
},
abrupt
:
function
(
type
,
arg
)
{
for
(
var
i
=
this
.
tryEntries
.
length
-
1
;
i
>=
0
;
--
i
)
{
var
entry
=
this
.
tryEntries
[
i
];
if
(
entry
.
tryLoc
<=
this
.
prev
&&
hasOwn
.
call
(
entry
,
"
finallyLoc
"
)
&&
this
.
prev
<
entry
.
finallyLoc
)
{
var
finallyEntry
=
entry
;
break
;
}
}
if
(
finallyEntry
&&
(
type
===
"
break
"
||
type
===
"
continue
"
)
&&
finallyEntry
.
tryLoc
<=
arg
&&
arg
<=
finallyEntry
.
finallyLoc
)
{
// Ignore the finally entry if control is not jumping to a
// location outside the try/catch block.
finallyEntry
=
null
;
}
var
record
=
finallyEntry
?
finallyEntry
.
completion
:
{};
record
.
type
=
type
;
record
.
arg
=
arg
;
if
(
finallyEntry
)
{
this
.
method
=
"
next
"
;
this
.
next
=
finallyEntry
.
finallyLoc
;
return
ContinueSentinel
;
}
return
this
.
complete
(
record
);
},
complete
:
function
(
record
,
afterLoc
)
{
if
(
record
.
type
===
"
throw
"
)
{
throw
record
.
arg
;
}
if
(
record
.
type
===
"
break
"
||
record
.
type
===
"
continue
"
)
{
this
.
next
=
record
.
arg
;
}
else
if
(
record
.
type
===
"
return
"
)
{
this
.
rval
=
this
.
arg
=
record
.
arg
;
this
.
method
=
"
return
"
;
this
.
next
=
"
end
"
;
}
else
if
(
record
.
type
===
"
normal
"
&&
afterLoc
)
{
this
.
next
=
afterLoc
;
}
return
ContinueSentinel
;
},
finish
:
function
(
finallyLoc
)
{
for
(
var
i
=
this
.
tryEntries
.
length
-
1
;
i
>=
0
;
--
i
)
{
var
entry
=
this
.
tryEntries
[
i
];
if
(
entry
.
finallyLoc
===
finallyLoc
)
{
this
.
complete
(
entry
.
completion
,
entry
.
afterLoc
);
resetTryEntry
(
entry
);
return
ContinueSentinel
;
}
}
},
"
catch
"
:
function
(
tryLoc
)
{
for
(
var
i
=
this
.
tryEntries
.
length
-
1
;
i
>=
0
;
--
i
)
{
var
entry
=
this
.
tryEntries
[
i
];
if
(
entry
.
tryLoc
===
tryLoc
)
{
var
record
=
entry
.
completion
;
if
(
record
.
type
===
"
throw
"
)
{
var
thrown
=
record
.
arg
;
resetTryEntry
(
entry
);
}
return
thrown
;
}
}
// The context.catch method must only be called with a location
// argument that corresponds to a known catch block.
throw
new
Error
(
"
illegal catch attempt
"
);
},
delegateYield
:
function
(
iterable
,
resultName
,
nextLoc
)
{
this
.
delegate
=
{
iterator
:
values
(
iterable
),
resultName
:
resultName
,
nextLoc
:
nextLoc
};
if
(
this
.
method
===
"
next
"
)
{
// Deliberately forget the last sent value so that we don't
// accidentally pass it on to the delegate.
this
.
arg
=
undefined
;
}
return
ContinueSentinel
;
}
};
})(
// In sloppy mode, unbound `this` refers to the global object, fallback to
// Function constructor if we're in global strict mode. That is sadly a form
// of indirect eval which violates Content Security Policy.
(
function
()
{
return
this
})()
||
Function
(
"
return this
"
)()
);
play/assets/
tmpGame/script/Scen
e.js.meta
→
play/assets/
scene/script/runtim
e.js.meta
View file @
ba5dcce4
{
"ver": "1.0.8",
"uuid": "
f4ede462-f8d7-4069-ba80-915611c058ca
",
"isPlugin":
fals
e,
"uuid": "
b54300af-b8e5-4b4e-aa2f-9ac1cef7b598
",
"isPlugin":
tru
e,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
...
...
play/assets/
tmpGam
e/script/util.js
→
play/assets/
scen
e/script/util.js
View file @
ba5dcce4
...
...
@@ -132,3 +132,222 @@ export function btnClickAnima(btn, time=0.15, rate=1.05) {
.
start
()
})
}
export
function
getSpriteFrimeByUrl
(
url
,
cb
)
{
cc
.
loader
.
load
({
url
},
(
err
,
img
)
=>
{
const
spriteFrame
=
new
cc
.
SpriteFrame
(
img
)
if
(
cb
)
{
cb
(
spriteFrame
);
}
})
}
export
function
getSprNode
(
resName
)
{
const
sf
=
cc
.
find
(
'
Canvas/res/img/
'
+
resName
).
getComponent
(
cc
.
Sprite
).
spriteFrame
;
const
node
=
new
cc
.
Node
();
node
.
addComponent
(
cc
.
Sprite
).
spriteFrame
=
sf
;
return
node
;
}
export
function
getSprNodeByUrl
(
url
,
cb
)
{
const
node
=
new
cc
.
Node
();
const
spr
=
node
.
addComponent
(
cc
.
Sprite
);
getSpriteFrimeByUrl
(
url
,
(
sf
)
=>
{
spr
.
spriteFrame
=
sf
;
if
(
cb
)
{
cb
(
spr
);
}
})
}
export
function
playAudio
(
audioClip
,
cb
=
null
)
{
if
(
audioClip
)
{
const
audioId
=
cc
.
audioEngine
.
playEffect
(
audioClip
,
false
,
0.8
);
if
(
cb
)
{
cc
.
audioEngine
.
setFinishCallback
(
audioId
,
()
=>
{
cb
();
});
}
}
}
export
async
function
asyncDelay
(
time
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
try
{
setTimeout
(()
=>
{
resolve
();
},
time
*
1000
);
}
catch
(
e
)
{
reject
(
e
);
}
})
}
export
class
FireworkSettings
{
baseNode
;
// 父节点
nodeList
;
// 火花节点的array
pos
;
// 发射点
side
;
// 发射方向
range
;
// 扩散范围
number
;
// 发射数量
scalseRange
;
// 缩放范围
constructor
(
baseNode
,
nodeList
,
pos
=
cc
.
v2
(
0
,
0
),
side
=
cc
.
v2
(
0
,
100
),
range
=
50
,
number
=
100
,
scalseRange
=
0
)
{
this
.
baseNode
=
baseNode
;
this
.
nodeList
=
nodeList
;
this
.
pos
=
pos
;
this
.
side
=
side
;
this
.
range
=
range
;
this
.
number
=
number
;
this
.
scalseRange
=
scalseRange
;
}
static
copy
(
firework
)
{
return
new
FireworkSettings
(
firework
.
baseNode
,
firework
.
nodeList
,
firework
.
pos
,
firework
.
side
,
firework
.
range
,
firework
.
number
,
);
}
}
export
async
function
showFireworks
(
fireworkSettings
)
{
const
{
baseNode
,
nodeList
,
pos
,
side
,
range
,
number
,
scalseRange
}
=
fireworkSettings
;
new
Array
(
number
).
fill
(
'
'
).
forEach
(
async
(
_
,
i
)
=>
{
let
rabbonNode
=
new
cc
.
Node
();
rabbonNode
.
parent
=
baseNode
;
rabbonNode
.
x
=
pos
.
x
;
rabbonNode
.
y
=
pos
.
y
;
rabbonNode
.
angle
=
60
*
Math
.
random
()
-
30
;
let
node
=
cc
.
instantiate
(
nodeList
[
RandomInt
(
nodeList
.
length
)]);
node
.
parent
=
rabbonNode
;
node
.
active
=
true
;
node
.
x
=
0
;
node
.
y
=
0
;
node
.
angle
=
0
;
node
.
scale
=
(
Math
.
random
()
-
0.5
)
*
scalseRange
+
1
;
const
rate
=
Math
.
random
();
const
angle
=
Math
.
PI
*
(
Math
.
random
()
*
2
-
1
);
await
asyncTweenBy
(
rabbonNode
,
0.3
,
{
x
:
side
.
x
*
rate
+
Math
.
cos
(
angle
)
*
range
*
rate
,
y
:
side
.
y
*
rate
+
Math
.
sin
(
angle
)
*
range
*
rate
},
{
easing
:
'
quadIn
'
});
cc
.
tween
(
rabbonNode
)
.
by
(
8
,
{
y
:
-
2000
})
.
start
();
cc
.
tween
(
rabbonNode
)
.
to
(
5
,
{
scale
:
(
Math
.
random
()
-
0.5
)
*
scalseRange
+
1
})
.
start
();
rabbonFall
(
rabbonNode
);
await
asyncDelay
(
Math
.
random
());
cc
.
tween
(
node
)
.
by
(
0.15
,
{
x
:
-
10
,
angle
:
-
10
})
.
by
(
0.3
,
{
x
:
20
,
angle
:
20
})
.
by
(
0.15
,
{
x
:
-
10
,
angle
:
-
10
})
.
union
()
.
repeatForever
()
.
start
();
cc
.
tween
(
rabbonNode
)
.
delay
(
5
)
.
to
(
0.3
,
{
opacity
:
0
})
.
call
(()
=>
{
node
.
stopAllActions
();
node
.
active
=
false
;
node
.
parent
=
null
;
node
=
null
;
})
.
start
();
});
}
async
function
rabbonFall
(
node
)
{
const
time
=
1
+
Math
.
random
();
const
offsetX
=
RandomInt
(
-
200
,
200
)
*
time
;
await
asyncTweenBy
(
node
,
time
,
{
x
:
offsetX
,
angle
:
offsetX
*
60
/
200
});
rabbonFall
(
node
);
}
export
async
function
asyncTweenTo
(
node
,
duration
,
obj
,
ease
=
undefined
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
try
{
cc
.
tween
(
node
)
.
to
(
duration
,
obj
,
ease
)
.
call
(()
=>
{
resolve
();
})
.
start
();
}
catch
(
e
)
{
reject
(
e
);
}
});
}
export
async
function
asyncTweenBy
(
node
,
duration
,
obj
,
ease
=
undefined
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
try
{
cc
.
tween
(
node
)
.
by
(
duration
,
obj
,
ease
)
.
call
(()
=>
{
resolve
();
})
.
start
();
}
catch
(
e
)
{
reject
(
e
);
}
});
}
export
function
showTrebleFirework
(
baseNode
,
rabbonList
)
{
const
middle
=
new
FireworkSettings
(
baseNode
,
rabbonList
);
middle
.
pos
=
cc
.
v2
(
0
,
-
400
);
middle
.
side
=
cc
.
v2
(
0
,
1000
);
middle
.
range
=
200
;
middle
.
number
=
100
;
middle
.
scalseRange
=
0.4
;
const
left
=
FireworkSettings
.
copy
(
middle
);
left
.
pos
=
cc
.
v2
(
-
600
,
-
400
);
left
.
side
=
cc
.
v2
(
200
,
1000
);
const
right
=
FireworkSettings
.
copy
(
middle
);
right
.
pos
=
cc
.
v2
(
600
,
-
400
);
right
.
side
=
cc
.
v2
(
-
200
,
1000
);
showFireworks
(
middle
);
showFireworks
(
left
);
showFireworks
(
right
);
}
export
function
onHomeworkFinish
()
{
const
middleLayer
=
cc
.
find
(
'
middleLayer
'
);
if
(
middleLayer
)
{
const
middleLayerComponent
=
middleLayer
.
getComponent
(
'
middleLayer
'
);
if
(
middleLayerComponent
.
role
==
'
student
'
)
{
middleLayerComponent
.
onHomeworkFinish
(()
=>
{
});
}
return
;
}
}
\ No newline at end of file
play/assets/
tmpGam
e/script/util.js.meta
→
play/assets/
scen
e/script/util.js.meta
View file @
ba5dcce4
{
"ver": "1.0.8",
"uuid": "
ade7af40-d56d-4087-bbc6-2888fef55353
",
"uuid": "
78ada2a2-d787-4406-9436-760cb3fb4c04
",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
...
...
play/assets/
tmpGam
e/textures.meta
→
play/assets/
scen
e/textures.meta
View file @
ba5dcce4
{
"ver": "1.1.2",
"uuid": "
8ba21262-178f-4fa5-afc9-2c1dd50ba3ab
",
"uuid": "
948d80e8-2dab-4838-8434-f5d58c671c41
",
"isBundle": false,
"bundleName": "",
"priority": 1,
...
...
play/assets/
tmpGam
e/textures/.keep
→
play/assets/
scen
e/textures/.keep
View file @
ba5dcce4
File moved
play/assets/tmpGame.meta
deleted
100644 → 0
View file @
3f6c5725
{
"ver": "1.1.2",
"uuid": "c35bb2f6-f24a-4850-ae44-643f2fdc7541",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
play/assets/tmpGame/audios/btn.mp3
deleted
100644 → 0
View file @
3f6c5725
File deleted
play/assets/tmpGame/audios/btn.mp3.meta
deleted
100644 → 0
View file @
3f6c5725
{
"ver": "2.0.1",
"uuid": "f0680ae0-c079-45ef-abd7-9e63d90b982b",
"downloadMode": 0,
"duration": 0.130612,
"subMetas": {}
}
\ No newline at end of file
play/assets/tmpGame/fonts/BRLNSDB.TTF
deleted
100644 → 0
View file @
3f6c5725
File deleted
play/assets/tmpGame/fonts/BRLNSDB.TTF.meta
deleted
100644 → 0
View file @
3f6c5725
{
"ver": "1.1.0",
"uuid": "c551970e-b095-45f3-9f1d-25cde8b8deb1",
"subMetas": {}
}
\ No newline at end of file
play/assets/tmpGame/scene/Scene.fire
deleted
100644 → 0
View file @
3f6c5725
[
{
"__type__": "cc.SceneAsset",
"_name": "",
"_objFlags": 0,
"_native": "",
"scene": {
"__id__": 1
}
},
{
"__type__": "cc.Scene",
"_objFlags": 0,
"_parent": null,
"_children": [
{
"__id__": 2
}
],
"_active": false,
"_components": [],
"_prefab": null,
"_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,
"y": 0
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_is3DNode": true,
"_groupIndex": 0,
"groupIndex": 0,
"autoReleaseAssets": true,
"_id": "57ea7c61-9b8b-498a-b024-c98ee9124beb"
},
{
"__type__": "cc.Node",
"_name": "Canvas",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 3
},
{
"__id__": 5
},
{
"__id__": 7
},
{
"__id__": 14
}
],
"_active": true,
"_components": [
{
"__id__": 24
},
{
"__id__": 25
},
{
"__id__": 26
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
640,
360,
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": "a5esZu+45LA5mBpvttspPD"
},
{
"__type__": "cc.Node",
"_name": "Main Camera",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 4
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
362.85545494732423,
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": "e1WoFrQ79G7r4ZuQE3HlNb"
},
{
"__type__": "cc.Camera",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
},
"_enabled": true,
"_cullingMask": 4294967295,
"_clearFlags": 7,
"_backgroundColor": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_depth": -1,
"_zoomRatio": 1,
"_targetTexture": null,
"_fov": 60,
"_orthoSize": 10,
"_nearClip": 1,
"_farClip": 4096,
"_ortho": true,
"_rect": {
"__type__": "cc.Rect",
"x": 0,
"y": 0,
"width": 1,
"height": 1
},
"_renderStages": 1,
"_alignWithScreen": true,
"_id": "81GN3uXINKVLeW4+iKSlim"
},
{
"__type__": "cc.Node",
"_name": "bg",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 6
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
},
"_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": "32MJMZ2HRGF4BOf533Avyi"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "8288e3d4-4c75-4b27-8f01-f7014417f4dd"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "97/S6HDq9MeqgmV1Zwnhbb"
},
{
"__type__": "cc.Node",
"_name": "bottomPart",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [
{
"__id__": 8
},
{
"__id__": 11
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_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": [
635.132,
-356.326,
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": "8c7k8ep/ZFNpO263+1QHz9"
},
{
"__type__": "cc.Node",
"_name": "btn_left",
"_objFlags": 0,
"_parent": {
"__id__": 7
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 9
},
{
"__id__": 10
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 61,
"height": 67
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-148.464,
34,
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": "5ad2wLQLxIN5Eg7OHecSH6"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "ce19457d-e8f3-4c38-ae3e-d4b99208ddb5"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "84mqOgJ3JNqZrYVTEU8CjE"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": null,
"_id": "bcYN/4EKBJhbIAfovo9Ah1"
},
{
"__type__": "cc.Node",
"_name": "btn_right",
"_objFlags": 0,
"_parent": {
"__id__": 7
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 12
},
{
"__id__": 13
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 60,
"height": 66
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-47.164,
34,
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": "46i3stdzpHX6zQHTGnRsNE"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "e5a2dbaa-a677-4a32-90d7-a1b057d7fb59"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "42Sh8QS/BHn4WiGyPQPKPt"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": null,
"_id": "1aj32fYY1IxLesa77E70Qu"
},
{
"__type__": "cc.Node",
"_name": "res",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [
{
"__id__": 15
},
{
"__id__": 18
},
{
"__id__": 21
}
],
"_active": false,
"_components": [],
"_prefab": null,
"_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": "0aAzbH6R1E+6AmGRrkKa5O"
},
{
"__type__": "cc.Node",
"_name": "font",
"_objFlags": 0,
"_parent": {
"__id__": 14
},
"_children": [
{
"__id__": 16
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_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": "9bLfcYeeNKrr524vzWchiM"
},
{
"__type__": "cc.Node",
"_name": "BRLNSDB",
"_objFlags": 0,
"_parent": {
"__id__": 15
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 17
}
],
"_prefab": null,
"_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": "cfMLGsq0BMhJARv+ySMAxS"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 16
},
"_enabled": true,
"_materials": [],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_useOriginalSize": true,
"_string": "",
"_N$string": "",
"_fontSize": 40,
"_lineHeight": 40,
"_enableWrapText": true,
"_N$file": {
"__uuid__": "c551970e-b095-45f3-9f1d-25cde8b8deb1"
},
"_isSystemFontUsed": false,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 0,
"_underlineHeight": 0,
"_N$horizontalAlign": 0,
"_N$verticalAlign": 0,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "9bNHNPu5lC7rQYyr8ai/sY"
},
{
"__type__": "cc.Node",
"_name": "img",
"_objFlags": 0,
"_parent": {
"__id__": 14
},
"_children": [
{
"__id__": 19
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_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": "53LUHHG2pEr79fyrvazXJs"
},
{
"__type__": "cc.Node",
"_name": "icon",
"_objFlags": 0,
"_parent": {
"__id__": 18
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 20
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 138,
"height": 141
},
"_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": "1blU2OArJIfoC9XfupGxJG"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 19
},
"_enabled": true,
"_materials": [],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "6fbc30a8-3c49-44ae-8ba4-7f56f385b78a"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "03GEWUEZJGyKormWgIWCtM"
},
{
"__type__": "cc.Node",
"_name": "audio",
"_objFlags": 0,
"_parent": {
"__id__": 14
},
"_children": [
{
"__id__": 22
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_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": "b823DIVC9L+Ihc3T9Bt7m3"
},
{
"__type__": "cc.Node",
"_name": "btn",
"_objFlags": 0,
"_parent": {
"__id__": 21
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 23
}
],
"_prefab": null,
"_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": "3d0p0/uJZJIoRva5Br2iqv"
},
{
"__type__": "cc.AudioSource",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 22
},
"_enabled": true,
"_clip": {
"__uuid__": "f0680ae0-c079-45ef-abd7-9e63d90b982b"
},
"_volume": 1,
"_mute": false,
"_loop": false,
"playOnLoad": false,
"preload": false,
"_id": "0adN50f61DlbmppsPkOnjX"
},
{
"__type__": "cc.Canvas",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_designResolution": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
},
"_fitWidth": false,
"_fitHeight": false,
"_id": "59Cd0ovbdF4byw5sbjJDx7"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "29zXboiXFBKoIV4PQ2liTe"
},
{
"__type__": "f4edeRi+NdAabqAkVYRwFjK",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_id": "e687yyoRBIzZAOVRL8Sseh"
}
]
\ No newline at end of file
play/assets/tmpGame/script/utils.js
deleted
100644 → 0
View file @
3f6c5725
export
function
getPosByAngle
(
angle
,
len
)
{
const
radian
=
angle
*
Math
.
PI
/
180
;
const
x
=
Math
.
sin
(
radian
)
*
len
;
const
y
=
Math
.
cos
(
radian
)
*
len
;
return
{
x
,
y
};
}
export
function
getAngleByPos
(
px
,
py
,
mx
,
my
)
{
const
x
=
Math
.
abs
(
px
-
mx
);
const
y
=
Math
.
abs
(
py
-
my
);
const
z
=
Math
.
sqrt
(
Math
.
pow
(
x
,
2
)
+
Math
.
pow
(
y
,
2
));
const
cos
=
y
/
z
;
const
radina
=
Math
.
acos
(
cos
);
// 用反三角函数求弧度
let
angle
=
Math
.
floor
(
180
/
(
Math
.
PI
/
radina
)
*
100
)
/
100
;
// 将弧度转换成角度
if
(
mx
>
px
&&
my
>
py
)
{
// 鼠标在第四象限
angle
=
180
-
angle
;
}
if
(
mx
===
px
&&
my
>
py
)
{
// 鼠标在y轴负方向上
angle
=
180
;
}
if
(
mx
>
px
&&
my
===
py
)
{
// 鼠标在x轴正方向上
angle
=
90
;
}
if
(
mx
<
px
&&
my
>
py
)
{
// 鼠标在第三象限
angle
=
180
+
angle
;
}
if
(
mx
<
px
&&
my
===
py
)
{
// 鼠标在x轴负方向
angle
=
270
;
}
if
(
mx
<
px
&&
my
<
py
)
{
// 鼠标在第二象限
angle
=
360
-
angle
;
}
// console.log('angle: ', angle);
return
angle
;
}
export
function
exchangeNodePos
(
baseNode
,
targetNode
)
{
return
baseNode
.
convertToNodeSpaceAR
(
targetNode
.
_parent
.
convertToWorldSpaceAR
(
cc
.
v2
(
targetNode
.
x
,
targetNode
.
y
)));
}
export
function
RandomInt
(
a
,
b
=
0
)
{
let
max
=
Math
.
max
(
a
,
b
);
let
min
=
Math
.
min
(
a
,
b
);
return
Math
.
floor
(
Math
.
random
()
*
(
max
-
min
)
+
min
);
}
export
function
Between
(
a
,
b
,
c
)
{
return
[
a
,
b
,
c
].
sort
((
a
,
b
)
=>
a
-
b
)[
1
];
}
export
function
randomSortByArr
(
arr
)
{
const
newArr
=
[];
const
tmpArr
=
arr
.
concat
();
while
(
tmpArr
.
length
>
0
)
{
const
randomIndex
=
Math
.
floor
(
tmpArr
.
length
*
Math
.
random
());
newArr
.
push
(
tmpArr
[
randomIndex
]);
tmpArr
.
splice
(
randomIndex
,
1
);
}
return
newArr
;
}
export
async
function
asyncTweenTo
(
node
,
duration
,
obj
,
ease
=
undefined
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
cc
.
tween
(
node
)
.
to
(
duration
,
obj
,
ease
)
.
call
(()
=>
{
resolve
();
})
.
start
();
});
}
export
async
function
asyncTweenBy
(
node
,
duration
,
obj
,
ease
=
undefined
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
cc
.
tween
(
node
)
.
by
(
duration
,
obj
,
ease
)
.
call
(()
=>
{
resolve
();
})
.
start
();
});
}
export
async
function
asyncPlayDragonBoneAnimation
(
node
,
animationName
,
time
=
1
,
onFrameEvent
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
node
.
getComponent
(
dragonBones
.
ArmatureDisplay
)
.
once
(
dragonBones
.
EventObject
.
COMPLETE
,
()
=>
{
resolve
();
});
node
.
getComponent
(
dragonBones
.
ArmatureDisplay
)
.
on
(
dragonBones
.
EventObject
.
FRAME_EVENT
,
({
name
})
=>
{
if
(
onFrameEvent
&&
typeof
(
onFrameEvent
)
==
'
function
'
)
{
onFrameEvent
(
name
);
}
});
node
.
getComponent
(
dragonBones
.
ArmatureDisplay
)
.
playAnimation
(
animationName
,
time
);
});
}
export
async
function
asyncPlayEffectByUrl
(
url
,
loop
=
false
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
cc
.
assetManager
.
loadRemote
(
url
,
(
err
,
clip
)
=>
{
console
.
log
(
clip
);
cc
.
audioEngine
.
playEffect
(
clip
,
loop
);
resolve
();
});
});
}
export
async
function
jelly
(
node
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
cc
.
tween
(
node
)
.
to
(
0.1
,
{
scaleX
:
0.9
,
scaleY
:
1.1
})
.
to
(
0.1
,
{
scaleX
:
1.1
,
scaleY
:
0.9
})
.
to
(
0.1
,
{
scaleX
:
1
,
scaleY
:
1
})
.
call
(
resolve
)
.
start
();
});
}
export
async
function
asyncDelay
(
time
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
resolve
();
},
time
*
1000
);
})
}
export
async
function
showFireworks
(
baseNode
,
nodeList
,
pos
=
cc
.
v2
(
0
,
0
),
side
=
cc
.
v2
(
0
,
100
),
range
=
50
,
number
=
100
)
{
new
Array
(
number
).
fill
(
'
'
).
forEach
(
async
(
_
,
i
)
=>
{
let
rabbonNode
=
new
cc
.
Node
();
rabbonNode
.
parent
=
baseNode
;
rabbonNode
.
x
=
pos
.
x
;
rabbonNode
.
y
=
pos
.
y
;
rabbonNode
.
angle
=
60
*
Math
.
random
()
-
30
;
let
node
=
cc
.
instantiate
(
nodeList
[
RandomInt
(
nodeList
.
length
)]);
node
.
parent
=
rabbonNode
;
node
.
active
=
true
;
node
.
x
=
0
;
node
.
y
=
0
;
node
.
angle
=
0
;
const
rate
=
Math
.
random
();
const
angle
=
Math
.
PI
*
(
Math
.
random
()
*
2
-
1
);
await
asyncTweenBy
(
rabbonNode
,
0.3
,
{
x
:
side
.
x
*
rate
+
Math
.
cos
(
angle
)
*
range
*
rate
,
y
:
side
.
y
*
rate
+
Math
.
sin
(
angle
)
*
range
*
rate
},
{
easing
:
'
quadIn
'
});
cc
.
tween
(
rabbonNode
)
.
by
(
8
,
{
y
:
-
2000
})
.
start
();
rabbonFall
(
rabbonNode
);
await
asyncDelay
(
Math
.
random
());
cc
.
tween
(
node
)
.
by
(
0.15
,
{
x
:
-
10
,
angle
:
-
10
})
.
by
(
0.3
,
{
x
:
20
,
angle
:
20
})
.
by
(
0.15
,
{
x
:
-
10
,
angle
:
-
10
})
.
union
()
.
repeatForever
()
.
start
();
cc
.
tween
(
rabbonNode
)
.
delay
(
5
)
.
to
(
0.3
,
{
opacity
:
0
})
.
call
(()
=>
{
node
.
stopAllActions
();
node
.
active
=
false
;
node
.
parent
=
null
;
node
=
null
;
})
.
start
();
});
}
async
function
rabbonFall
(
node
)
{
const
time
=
1
+
Math
.
random
();
const
offsetX
=
RandomInt
(
-
200
,
200
)
*
time
;
await
asyncTweenBy
(
node
,
time
,
{
x
:
offsetX
,
angle
:
offsetX
*
60
/
200
});
rabbonFall
(
node
);
}
\ No newline at end of file
play/assets/tmpGame/textures/1orange.png
deleted
100644 → 0
View file @
3f6c5725
123 KB
play/assets/tmpGame/textures/1orange.png.meta
deleted
100644 → 0
View file @
3f6c5725
{
"ver": "2.3.5",
"uuid": "efa5fa09-a4dd-4bfc-ab7e-17c19f85408f",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 366,
"height": 336,
"platformSettings": {},
"subMetas": {
"1orange": {
"ver": "1.0.4",
"uuid": "43d1e79d-6de8-4dcb-b8ce-d767df7913aa",
"rawTextureUuid": "efa5fa09-a4dd-4bfc-ab7e-17c19f85408f",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": -0.5,
"trimX": 0,
"trimY": 1,
"width": 366,
"height": 335,
"rawWidth": 366,
"rawHeight": 336,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
play/assets/tmpGame/textures/bg.jpg
deleted
100644 → 0
View file @
3f6c5725
25.8 KB
play/assets/tmpGame/textures/bg.jpg.meta
deleted
100644 → 0
View file @
3f6c5725
{
"ver": "2.3.5",
"uuid": "e1b4d971-9876-4832-803a-5a321964a78b",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1280,
"height": 720,
"platformSettings": {},
"subMetas": {
"bg": {
"ver": "1.0.4",
"uuid": "8288e3d4-4c75-4b27-8f01-f7014417f4dd",
"rawTextureUuid": "e1b4d971-9876-4832-803a-5a321964a78b",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1280,
"height": 720,
"rawWidth": 1280,
"rawHeight": 720,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
play/assets/tmpGame/textures/btn_left.png
deleted
100644 → 0
View file @
3f6c5725
1.97 KB
play/assets/tmpGame/textures/btn_left.png.meta
deleted
100644 → 0
View file @
3f6c5725
{
"ver": "2.3.5",
"uuid": "9a79969a-0506-48d4-bc98-3c05d109b027",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 61,
"height": 67,
"platformSettings": {},
"subMetas": {
"btn_left": {
"ver": "1.0.4",
"uuid": "ce19457d-e8f3-4c38-ae3e-d4b99208ddb5",
"rawTextureUuid": "9a79969a-0506-48d4-bc98-3c05d109b027",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 61,
"height": 67,
"rawWidth": 61,
"rawHeight": 67,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
play/assets/tmpGame/textures/btn_right.png
deleted
100644 → 0
View file @
3f6c5725
1.88 KB
play/assets/tmpGame/textures/btn_right.png.meta
deleted
100644 → 0
View file @
3f6c5725
{
"ver": "2.3.5",
"uuid": "d582359e-924e-4ee9-9964-1fc4bb417e71",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 61,
"height": 67,
"platformSettings": {},
"subMetas": {
"btn_right": {
"ver": "1.0.4",
"uuid": "e5a2dbaa-a677-4a32-90d7-a1b057d7fb59",
"rawTextureUuid": "d582359e-924e-4ee9-9964-1fc4bb417e71",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -0.5,
"offsetY": 0.5,
"trimX": 0,
"trimY": 0,
"width": 60,
"height": 66,
"rawWidth": 61,
"rawHeight": 67,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
play/assets/tmpGame/textures/icon.png
deleted
100644 → 0
View file @
3f6c5725
10.7 KB
play/assets/tmpGame/textures/icon.png.meta
deleted
100644 → 0
View file @
3f6c5725
{
"ver": "2.3.5",
"uuid": "18d07592-51a9-421e-8972-0f67b68d29e1",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 144,
"height": 144,
"platformSettings": {},
"subMetas": {
"icon": {
"ver": "1.0.4",
"uuid": "6fbc30a8-3c49-44ae-8ba4-7f56f385b78a",
"rawTextureUuid": "18d07592-51a9-421e-8972-0f67b68d29e1",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": -0.5,
"trimX": 3,
"trimY": 2,
"width": 138,
"height": 141,
"rawWidth": 144,
"rawHeight": 144,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
play/project.json
View file @
ba5dcce4
...
...
@@ -3,6 +3,6 @@
"packages"
:
"packages"
,
"name"
:
"play"
,
"id"
:
"9af72fd2-44a6-4131-8ea3-3e1b3fa22231"
,
"version"
:
"2.4.
0
"
,
"version"
:
"2.4.
4
"
,
"isNew"
:
false
}
\ No newline at end of file
play/settings/project.json
View file @
ba5dcce4
{
"last-module-event-record-time"
:
1600677246969
"last-module-event-record-time"
:
1600677246969
,
"migrate-history"
:
[
"cloud-function"
]
}
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