Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zeroing-libs
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
劳工
zeroing-libs
Commits
5e341b08
Commit
5e341b08
authored
Jun 15, 2020
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
8df614f3
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
1162 additions
and
156 deletions
+1162
-156
recycling.json
dist/customs/recycling.json
+57
-51
app.js
src/custom/recycling/debug/app.js
+1
-1
main.js
src/custom/recycling/debug/main.js
+994
-1
main.js.map
src/custom/recycling/debug/main.js.map
+1
-1
meta.json
src/custom/recycling/meta.json
+57
-50
GarbageConfig.ts
src/custom/recycling/src/game/datas/GarbageConfig.ts
+52
-52
No files found.
dist/customs/recycling.json
View file @
5e341b08
...
...
@@ -81,303 +81,309 @@
"uuid"
:
"196d410b-a645-4956-9ef1-d6f30be7c1fd"
,
"ext"
:
".png"
},
{
"name"
:
"g50"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/99a2ed7d25039e005312eed19f56ad1b451564eb.png"
,
"uuid"
:
"fe97cd48-720b-4412-9bcf-0bdd3a8e96a1"
,
"ext"
:
".png"
},
{
"name"
:
"g49"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
e408d950683da66d0a9b82de86c2a8cf532482ad
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
5564ae74afe698c969f4fe292087bb10d0b21687
.png"
,
"uuid"
:
"fe97cd48-720b-4412-9bcf-0bdd3a8e96a1"
,
"ext"
:
".png"
},
{
"name"
:
"g48"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
c13f4675de5e711bdcf2f1c5b2f7d45dd2f92aac
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
159b05de98c981b940c94e090d28a4885c421235
.png"
,
"uuid"
:
"e1aedf7c-4352-4583-9df2-d2a6aea163dd"
,
"ext"
:
".png"
},
{
"name"
:
"g47"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
48f3774efcbf5f9ef0e5141f12b9ff07f5019bbc
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
7c48a3b8ca06833310640718d8b8812c6e584c0d
.png"
,
"uuid"
:
"402f8717-a023-4625-9daf-4e8f7964e7a2"
,
"ext"
:
".png"
},
{
"name"
:
"g46"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
e2ad0647d07daf99ecc7606a6e0832cfc7f7a8f8
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
534cef6d7a73022dac36a8f917aaba59138ab5d3
.png"
,
"uuid"
:
"9445c37d-e81c-4d36-a211-eed7a97eea4d"
,
"ext"
:
".png"
},
{
"name"
:
"g45"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
8aa58ad538a67a539176479e072769de0efea638
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
360c8b26d732c3952621a4949a81329aad2bdf82
.png"
,
"uuid"
:
"10e25631-ea9d-4dd3-8bef-4c340068c81a"
,
"ext"
:
".png"
},
{
"name"
:
"g44"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
7d8526e6e57130b54290a2b64567afd27c8d8f91
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
4ad9335add89aebbfcb1e8b501ceb64d4df1a534
.png"
,
"uuid"
:
"202c0ea8-bc6b-4098-aae8-bd29cf13b35f"
,
"ext"
:
".png"
},
{
"name"
:
"g43"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
967da517b471f7ed4629bba46f8dc2ba8beb1f0d
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
2e6f5306255d434119e6dc986a9098b09426e252
.png"
,
"uuid"
:
"bb47d087-004c-4882-8d80-d172c0bff8a7"
,
"ext"
:
".png"
},
{
"name"
:
"g42"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
bf7eddba2dc2ce6ce8103175e96a348bc7e272c8
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
5d1537eccc3c3a5252990a8b20b30c357840b14d
.png"
,
"uuid"
:
"3a9c692c-2683-4ad5-a0b5-6193e5f708d1"
,
"ext"
:
".png"
},
{
"name"
:
"g41"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
767bcb92c9293d4edb60e413a11823b82ba05589
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
4ea16fb41faede6cfbb06d00cdc14899252d49fe
.png"
,
"uuid"
:
"3e6d234e-2393-4d75-9e5c-c87e9f4f4370"
,
"ext"
:
".png"
},
{
"name"
:
"g40"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
0a6276f244a36da419ca1b30180a126744e1838e
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
13ee95640c7269d89bf788cf200c734006b06329
.png"
,
"uuid"
:
"2c7df6ab-6ed5-451a-8da3-1de64e9a6518"
,
"ext"
:
".png"
},
{
"name"
:
"g39"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
b403cf582c53ea72cb48a46ae8b85c8f124d0454
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
07c67a3b9decae820fed0e1a627c9c02e4da3b6e
.png"
,
"uuid"
:
"2614eb6c-9153-4149-b8d6-ef02ac2200ae"
,
"ext"
:
".png"
},
{
"name"
:
"g38"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
b4542db81f188832e04caaf85ab17aef4d44c814
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
0b8bbf79b28f868822050f82c91092f2d12be0eb
.png"
,
"uuid"
:
"g38"
,
"ext"
:
".png"
},
{
"name"
:
"g37"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
6d3de9973a67e5ceba1400953bfb6f1c97e20697
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
54be9165464c72c73274424ba811ca297cba748c
.png"
,
"uuid"
:
"g37"
,
"ext"
:
".png"
},
{
"name"
:
"g36"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
620f1419ace61c7f32ea180a8f22cddd21f976aa
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
aae4011a2400b0f8653eb4355ec73a338a3a0d61
.png"
,
"uuid"
:
"g36"
,
"ext"
:
".png"
},
{
"name"
:
"g35"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
e8e2eae1199d60f79da5206fdbfb028db20ff76d
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
a40e4f7fc60a22562681573ba88c4dd43900461e
.png"
,
"uuid"
:
"g35"
,
"ext"
:
".png"
},
{
"name"
:
"g34"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
d9e7793207b2fcc30251d0886576d9d7fcb5e9ee
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
a25b8528764046567bddba363a0dc910d0ea7a28
.png"
,
"uuid"
:
"g34"
,
"ext"
:
".png"
},
{
"name"
:
"g33"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
3fa131f7f897c34fb379f7bf9c29747f3e69bf43
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
60689312961248d1469c63a60d67af7a53d0b659
.png"
,
"uuid"
:
"g33"
,
"ext"
:
".png"
},
{
"name"
:
"g32"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
3269880aaca62db34a6deb5199308adc0d25401
2.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
d78c7693b66d4a7716d741c37d3ed1e334265d4
2.png"
,
"uuid"
:
"g32"
,
"ext"
:
".png"
},
{
"name"
:
"g31"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
751067560cd76d7f9e5ceaa6b3f14479e55a69da
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
d16defc2eb95c09884287031e24f5ebc67c06f55
.png"
,
"uuid"
:
"g31"
,
"ext"
:
".png"
},
{
"name"
:
"g30"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/5
a3a283ecbf493d8773b31ccf2f723e91ed98d6c
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/5
50a9de40b797beb8b9504ea797004e29b415276
.png"
,
"uuid"
:
"g30"
,
"ext"
:
".png"
},
{
"name"
:
"g29"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
9b18c4e4ee1e8c841446fc595b8f0e211a454437
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
aaaf6a8c3c8e550ed34a5bcbf4881e924f9852cb
.png"
,
"uuid"
:
"g29"
,
"ext"
:
".png"
},
{
"name"
:
"g28"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
690129e1862415926738babe59f518b6b1b5cb4e
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
fce08988ad87102d726a8d3b90cef89fdc3d2d2a
.png"
,
"uuid"
:
"g28"
,
"ext"
:
".png"
},
{
"name"
:
"g27"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
17080c9fec412c3dc013fbc5c7507e5960aed1a3
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
fc9dc534b36263f05dff38ece12b8c8dfdcc4008
.png"
,
"uuid"
:
"g27"
,
"ext"
:
".png"
},
{
"name"
:
"g26"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
a34628a8370ee6b18a84e4b340ea3e199b88722d
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
e12f30a5a9035bcf9079c67ffdc0a61a4e9d2653
.png"
,
"uuid"
:
"g26"
,
"ext"
:
".png"
},
{
"name"
:
"g25"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
3fd8d25962065b95ea92d15ba8ed72650bd619f7
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
ea83372b1cc61bc68923748b9bb17cbdab9e0f84
.png"
,
"uuid"
:
"g25"
,
"ext"
:
".png"
},
{
"name"
:
"g24"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
c309687ae634221e99020cd22ffb08ffcc0d8302
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
98db6bd77d14c1ca262ce903fc3ee8f0bf34804b
.png"
,
"uuid"
:
"g24"
,
"ext"
:
".png"
},
{
"name"
:
"g23"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
c428c61edd2143dd29836545cadc5fb69035ee80
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
9d38482c8505f1483d32d8ca5960f02cbadfe044
.png"
,
"uuid"
:
"g23"
,
"ext"
:
".png"
},
{
"name"
:
"g22"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
2a147aa052d47ac0e06910e5df9ab1c932e34a92
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
6d6f4c7c6c4dd95e8cf448b3377c92ecfd462a0e
.png"
,
"uuid"
:
"g22"
,
"ext"
:
".png"
},
{
"name"
:
"g21"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
7ec81f1b13b8550effdf178101985fa31c50956a
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
5a8306bd5c826f10f785230b659df0c9eb3dbfcf
.png"
,
"uuid"
:
"g21"
,
"ext"
:
".png"
},
{
"name"
:
"g20"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
5b7500d82e6889e69fe24d605f253dfec0a42e39
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
e21d6e158e601c4677593e0779fed23cc91860e8
.png"
,
"uuid"
:
"g20"
,
"ext"
:
".png"
},
{
"name"
:
"g19"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
351ba4e8ca0c31caf69bc1b33917058e16970ef4
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
876d34e94dcc98b7d5457be79454042ec65c9fd6
.png"
,
"uuid"
:
"g19"
,
"ext"
:
".png"
},
{
"name"
:
"g18"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
29a63f67324429bcdaab1bb32bc944ff91bd47de
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
692aac3b874926dee775ffe0fd73f8c4e7e39bd3
.png"
,
"uuid"
:
"g18"
,
"ext"
:
".png"
},
{
"name"
:
"g17"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
8b65937268201d986f4307d2c50f9b7ab41eaaa2
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
ed14bd294d187104dc22ac0ecda28109a37593fa
.png"
,
"uuid"
:
"g17"
,
"ext"
:
".png"
},
{
"name"
:
"g16"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
8867de1b241ffa9f0c74a052a5b16ccc32c6fee6
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
1e21621783f6be0ba00b869e980cc3a869e53439
.png"
,
"uuid"
:
"g16"
,
"ext"
:
".png"
},
{
"name"
:
"g15"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
93973a7931aee434f47fa66630c73c77a7f6dcee
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
5fa0dc818ea9574f23adf091bdaa40d3cf6ccc11
.png"
,
"uuid"
:
"g15"
,
"ext"
:
".png"
},
{
"name"
:
"g14"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
433e648f4dbdc3d64e1661e91997f09f292cfec6
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
18d5086dbd7213a8a0ce7d8a159cba1f1e901d77
.png"
,
"uuid"
:
"g14"
,
"ext"
:
".png"
},
{
"name"
:
"g13"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
0763e6fb31df6b0c13d466592c06d040cd2f0914
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
63650960879b4d743b6954e1ec805684325af48d
.png"
,
"uuid"
:
"g13"
,
"ext"
:
".png"
},
{
"name"
:
"g12"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
6780831550258c98a024dda3dad66b38d47735c5
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
b3e66d60f64f00b248c762ce0df045eafe5f70d1
.png"
,
"uuid"
:
"g12"
,
"ext"
:
".png"
},
{
"name"
:
"g11"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
f0291b80012c07b9a6b000ae08f06117bc091ce4
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
9998bf5779dffe3097681a09ab97e7822f09ba92
.png"
,
"uuid"
:
"g11"
,
"ext"
:
".png"
},
{
"name"
:
"g10"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
ee55052e92922d7d4e8d103abc1b69f985bb32d2
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
337719d386e7979debaa3f8a58a17e416c474338
.png"
,
"uuid"
:
"g10"
,
"ext"
:
".png"
},
{
"name"
:
"g09"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
2ea8754293f74e08fe55496f7849804e6051b2ef
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
942bdcd7fd3475bc2a4af2f2b96fb1ad2ab659d9
.png"
,
"uuid"
:
"g09"
,
"ext"
:
".png"
},
{
"name"
:
"g08"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
0648601cff5448dcb1eea1db5e70f12376c695e5
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
1b8e1a03df623870576c063c04a4b8e1aef8bf72
.png"
,
"uuid"
:
"g08"
,
"ext"
:
".png"
},
{
"name"
:
"g07"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
b1a9a28a146a1ecb4dbd203fcae6c036a9acf041
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
95a5d437fe386cf9f6c52587c1d2db98f2d23f0c
.png"
,
"uuid"
:
"g07"
,
"ext"
:
".png"
},
{
"name"
:
"g06"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
db9fa8e9fbea957e9f02502d3fc7be96ad9e6edc
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
2d288b4f549d0e69c6b7fc6e863aaf10e3e2604d
.png"
,
"uuid"
:
"g06"
,
"ext"
:
".png"
},
{
"name"
:
"g05"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
f0d6ea6ba0fb0cda815910d5d2c5d7d1a0af0675
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
45c17615fdff30ed6584161a9cea26189239678e
.png"
,
"uuid"
:
"g05"
,
"ext"
:
".png"
},
{
"name"
:
"g04"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/f
b5bfe673bcadc393c15be3892e7223bf18a0a0b
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/f
fd3cffe53e031b5891bcfcfbcafa4443f6dc40e
.png"
,
"uuid"
:
"g04"
,
"ext"
:
".png"
},
{
"name"
:
"g03"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
79d84185ebddb82219e92187d11368a5c1eb650
5.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
a51f82e1a931ad7c9d5cb915c4f9b7fb3fac0de
5.png"
,
"uuid"
:
"g03"
,
"ext"
:
".png"
},
{
"name"
:
"g02"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
cf931a6dfd7d2938d31345c980b7caa22d515809
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
82699aa20a75cc5670b54a6bb4c83a8c56811fdf
.png"
,
"uuid"
:
"g02"
,
"ext"
:
".png"
},
{
"name"
:
"g01"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
0772e858d5337e5a52d17f6c6b0b9a7e79fa9c36
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
726ee984b6b56d75d2bd3d89b3c1c4714fb79314
.png"
,
"uuid"
:
"g01"
,
"ext"
:
".png"
},
{
"name"
:
"g00"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
38af7a09502570152c2f8238a93f6b35b40525d7
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
d2f1d01024247ea64cf35c610fec85f19dd89c21
.png"
,
"uuid"
:
"g00"
,
"ext"
:
".png"
}
...
...
@@ -424,5 +430,5 @@
}
},
"id"
:
"recycling"
,
"code"
:
"
\"
use strict
\"
;var tslib=require(
\"
tslib
\"
);function getTexture(e){return engine.Texture.from(getAssetByUUID(e).uuid)}function getTextureByName(e){return getTexture(engine.getAssetByName(e).uuid)}function createSvga(e,t){var i=new svga.Svga;return i.source=
\"
asset://
\"
+engine.getAssetByName(e).uuid,i}var props={};function prepareProps(){var e=getProps();engine.injectProp(props,e)}function injectProps(e){engine.injectProp(props,e)}var GarbageTypes,Conveyor=function(i){function e(){var e=i.call(this)||this;e.y=904.21;var t=new engine.Sprite(getTextureByName(
\"
conveyor
\"
));return e.addChild(t),e.idx0=e.createItem(75,50),e.idx1=e.createItem(225,50),e.idx2=e.createItem(375,50),e.idx3=e.createItem(525,50),e.idx4=e.createItem(675,50),e}return tslib.__extends(e,i),e.prototype.clear=function(){this.clearItem(this.idx0),this.clearItem(this.idx1),this.clearItem(this.idx2),this.clearItem(this.idx3),this.clearItem(this.idx4)},e.prototype.clearItem=function(e){0<e.children.length&&e.removeChildAt(0)},e.prototype.createItem=function(e,t){var i=new engine.Sprite;return this.addChild(i),i.x=e,i.y=t,i},e}(engine.Sprite);!function(e){e.recoverableWaste=
\"
recoverableWaste
\"
,e.harmfulWaste=
\"
harmfulWaste
\"
,e.wetWaste=
\"
wetWaste
\"
,e.dryWaste=
\"
dryWaste
\"
}(GarbageTypes=GarbageTypes||{});var GarbageConfig=function(){function e(){}return e.config=[{name:
\"
电池
\"
,source:
\"
g00
\"
,type:GarbageTypes.harmfulWaste,width:51,height:123},{name:
\"
温度计
\"
,source:
\"
g01
\"
,type:GarbageTypes.harmfulWaste,width:65,height:130},{name:
\"
鱼刺
\"
,source:
\"
g02
\"
,type:GarbageTypes.wetWaste,width:104,height:82},{name:
\"
龙虾
\"
,source:
\"
g03
\"
,type:GarbageTypes.wetWaste,width:129,height:122},{name:
\"
西瓜
\"
,source:
\"
g04
\"
,type:GarbageTypes.wetWaste,width:134,height:111},{name:
\"
旧玩具
\"
,source:
\"
g05
\"
,type:GarbageTypes.recoverableWaste,width:72,height:135},{name:
\"
口红
\"
,source:
\"
g06
\"
,type:GarbageTypes.dryWaste,width:49,height:134},{name:
\"
面包
\"
,source:
\"
g07
\"
,type:GarbageTypes.wetWaste,width:96,height:128},{name:
\"
绿植
\"
,source:
\"
g08
\"
,type:GarbageTypes.wetWaste,width:81,height:131},{name:
\"
保温瓶
\"
,source:
\"
g09
\"
,type:GarbageTypes.recoverableWaste,width:66,height:137},{name:
\"
破衣服
\"
,source:
\"
g10
\"
,type:GarbageTypes.recoverableWaste,width:91,height:121},{name:
\"
茶叶渣
\"
,source:
\"
g11
\"
,type:GarbageTypes.wetWaste,width:108,height:125},{name:
\"
湿巾
\"
,source:
\"
g12
\"
,type:GarbageTypes.dryWaste,width:106,height:109},{name:
\"
过期药膏
\"
,source:
\"
g13
\"
,type:GarbageTypes.harmfulWaste,width:107,height:130},{name:
\"
用完的洗发水瓶
\"
,source:
\"
g14
\"
,type:GarbageTypes.recoverableWaste,width:153,height:148},{name:
\"
婴儿纸尿裤
\"
,source:
\"
g15
\"
,type:GarbageTypes.dryWaste,width:108,height:123},{name:
\"
香水瓶
\"
,source:
\"
g16
\"
,type:GarbageTypes.recoverableWaste,width:65,height:127},{name:
\"
花甲壳
\"
,source:
\"
g17
\"
,type:GarbageTypes.wetWaste,width:99,height:115},{name:
\"
过期调味料
\"
,source:
\"
g18
\"
,type:GarbageTypes.wetWaste,width:109,height:130},{name:
\"
地毯
\"
,source:
\"
g19
\"
,type:GarbageTypes.recoverableWaste,width:145,height:119},{name:
\"
甘蔗渣
\"
,source:
\"
g20
\"
,type:GarbageTypes.wetWaste,width:100,height:116},{name:
\"
玻璃渣
\"
,source:
\"
g21
\"
,type:GarbageTypes.recoverableWaste,width:95,height:122},{name:
\"
番茄酱
\"
,source:
\"
g22
\"
,type:GarbageTypes.wetWaste,width:82,height:125},{name:
\"
酒精棉
\"
,source:
\"
g23
\"
,type:GarbageTypes.dryWaste,width:64,height:124},{name:
\"
指甲油瓶子
\"
,source:
\"
g24
\"
,type:GarbageTypes.harmfulWaste,width:109,height:125},{name:
\"
肉骨头
\"
,source:
\"
g25
\"
,type:GarbageTypes.dryWaste,width:67,height:123},{name:
\"
嚼过的口香糖
\"
,source:
\"
g26
\"
,type:GarbageTypes.dryWaste,width:135,height:116},{name:
\"
充电插头
\"
,source:
\"
g27
\"
,type:GarbageTypes.recoverableWaste,width:86,height:128},{name:
\"
旧报纸
\"
,source:
\"
g28
\"
,type:GarbageTypes.recoverableWaste,width:68,height:124},{name:
\"
烟头
\"
,source:
\"
g29
\"
,type:GarbageTypes.dryWaste,width:108,height:145},{name:
\"
奶茶塑料杯
\"
,source:
\"
g30
\"
,type:GarbageTypes.dryWaste,width:109,height:143},{name:
\"
瓜子壳
\"
,source:
\"
g31
\"
,type:GarbageTypes.wetWaste,width:87,height:121},{name:
\"
橘子皮
\"
,source:
\"
g32
\"
,type:GarbageTypes.wetWaste,width:78,height:120},{name:
\"
气球
\"
,source:
\"
g33
\"
,type:GarbageTypes.dryWaste,width:78,height:121},{name:
\"
树叶
\"
,source:
\"
g34
\"
,type:GarbageTypes.wetWaste,width:75,height:117},{name:
\"
感冒药
\"
,source:
\"
g35
\"
,type:GarbageTypes.harmfulWaste,width:92,height:121},{name:
\"
电话机
\"
,source:
\"
g36
\"
,type:GarbageTypes.recoverableWaste,width:63,height:121},{name:
\"
奶酪
\"
,source:
\"
g37
\"
,type:GarbageTypes.wetWaste,width:90,height:116},{name:
\"
啤酒瓶
\"
,source:
\"
g38
\"
,type:GarbageTypes.recoverableWaste,width:64,height:123},{name:
\"
薯片包装
\"
,source:
\"
g39
\"
,type:GarbageTypes.dryWaste,width:134,height:123},{name:
\"
过期保健品
\"
,source:
\"
g40
\"
,type:GarbageTypes.harmfulWaste,width:108,height:125},{name:
\"
雪糕包装袋
\"
,source:
\"
g41
\"
,type:GarbageTypes.dryWaste,width:109,height:128},{name:
\"
废油漆
\"
,source:
\"
g42
\"
,type:GarbageTypes.harmfulWaste,width:98,height:122},{name:
\"
食品罐头
\"
,source:
\"
g43
\"
,type:GarbageTypes.recoverableWaste,width:94,height:117},{name:
\"
陶瓷碗
\"
,source:
\"
g44
\"
,type:GarbageTypes.dryWaste,width:105,height:122},{name:
\"
蚊香
\"
,source:
\"
g45
\"
,type:GarbageTypes.dryWaste,width:69,height:146},{name:
\"
电脑机箱
\"
,source:
\"
g46
\"
,type:GarbageTypes.recoverableWaste,width:84,height:124},{name:
\"
鲜花
\"
,source:
\"
g47
\"
,type:GarbageTypes.wetWaste,width:62,height:122},{name:
\"
宠物粮食
\"
,source:
\"
g48
\"
,type:GarbageTypes.wetWaste,width:87,height:121},{name:
\"
银行卡
\"
,source:
\"
g49
\"
,type:GarbageTypes.recoverableWaste,width:115,height:123}],e}(),transStores=function(e){var a=[];e.forEach(function(e){!function(e){for(var t=0,i=a;t<i.length;t++){var r=i[t];if(e.targetType==r.targetType&&e.itemType==r.itemType&&e.itemName==r.itemName)return!0}return!1}(e)&&a.push(e)}),e=a,a=[];var n=[];return e.forEach(function(e){!function(e){for(var t=0,i=a;t<i.length;t++){var r=i[t];if(e.itemName==r.itemName)return n.push(r.itemName),!0}return!1}(e)&&a.push(e)}),(e=a).forEach(function(e){-1!=n.indexOf(e.itemName)&&(e.targetType=e.itemType)}),e.map(function(e){return{targetName:getTargetName(e.targetType),isCorrect:e.targetType==e.itemType,itemName:e.itemName}})},getTargetName=function(e){switch(e){case GarbageTypes.recoverableWaste:return
\"
可回收物
\"
;case GarbageTypes.harmfulWaste:return
\"
有害垃圾
\"
;case GarbageTypes.wetWaste:return
\"
湿垃圾
\"
;case GarbageTypes.dryWaste:return
\"
其他垃圾
\"
}},checkHit=function(e,t){var i=e.x,r=e.y,a=e.texture,n=a.width,s=a.height;return i>t.x&&r>t.y&&i+n<t.x+t.width&&r+s<t.y+t.height},removeChild=function(e){e&&e.parent&&e.parent.removeChild(e)},removeEle=function(e,t){var i=t.indexOf(e);0<=i&&t.splice(i,1)},shuffle=function(e){for(var t,i=e.length;i;){var r=Math.floor(Math.random()*i--);t=[e[i],e[r]],e[r]=t[0],e[i]=t[1]}return e},WrongTips=function(t){function e(){var e=t.call(this)||this;return e.img=new engine.Image,e.img.texture=getTextureByName(
\"
wrongTips
\"
),e.addChild(e.img),e.img.anchorX=44,e.img.anchorY=42.5,e.visible=!1,e}return tslib.__extends(e,t),e.prototype.play=function(e){this.visible=!0;engine.Tween.get(this.img).set({x:0,y:0,scaleX:1,scaleY:1,alpha:1}).to({x:20},70).to({x:0},70).to({x:-20},70).to({x:0},70).wait(200).to({alpha:0},300),this.x=e.x+180,this.y=e.y},e}(engine.Sprite),getTargetRect=function(e,t){switch(e){case GarbageTypes.dryWaste:return t.dryWaste;case GarbageTypes.wetWaste:return t.wetWaste;case GarbageTypes.harmfulWaste:return t.harmfulWaste;case GarbageTypes.recoverableWaste:return t.recoverableWaste}},Conveyors=function(i){function e(e){var t=i.call(this)||this;return t.conveyorsPool=[],t.GarbageConfig=GarbageConfig.config,t.datas=[],t.wrapper=e,t}return tslib.__extends(e,i),e.prototype.initData=function(e,t){this.conveyor0=e,this.conveyor1=t},e.prototype.setDefault=function(){this.score=0,this.conveyorsPool.push(this.conveyor0),this.conveyorsPool.push(this.conveyor1);for(var e=shuffle(this.GarbageConfig.concat([])),t=0;t<GarbageConfig.config.length;t++)e[t].idx=t,e[t].isRight=!1,e[t].isMistake=!1,e[t].isOnStage=!1,this.datas.push(e[t]);for(t=0;t<5;t++){var i=this.datas[t],r=new engine.Sprite(getTextureByName(i.source));r.isWrong=!1,r.isRight=!1,i.isOnStage=!0,r.type=i.type,r.name=i.name,r.anchorX=i.width/2,r.anchorY=i.height,r.x=-i.width/2,r.y=40-i.height,this.conveyor1[
\"
idx
\"
+t].addChild(r),r.addEventListener(engine.MouseEvent.MOUSE_DOWN,this.onDown_garbage,this)}},e.prototype.startConveyors=function(){this.setDefault(),engine.gameStage.addEventListener(engine.Event.ENTER_FRAME,this.onEnterFrame,this)},e.prototype.onEnterFrame=function(e,t,i){if(this.score==(props.maxScore||100)&&(this.gameOver(),this.wrapper.stop()),this.conveyorsPool.forEach(function(e){e.x-=props.speed||3}),this.conveyorsPool[this.conveyorsPool.length-1].x<=764){var r=new Conveyor;r.x=this.conveyorsPool[this.conveyorsPool.length-1].x+764,this.wrapper.addChild(r),this.conveyorsPool.push(r)}else{for(var a=[],n=0;n<this.datas.length;n++){(u=this.datas[n]).isRight||u.isOnStage||a.push(u)}for(var s=this.conveyorsPool[this.conveyorsPool.length-1],o=0;o<5;o++)if(!s[
\"
idx
\"
+o].children[0]){var h=a.shift();if(!h)break;h.isOnStage=!0;var g=new engine.Sprite(getTextureByName(h.source));g.isWrong=!1,g.isRight=!1,g.type=h.type,g.name=h.name,g.anchorX=h.width/2,g.anchorY=h.height,g.x=-h.width/2,g.y=40-h.height,s[
\"
idx
\"
+o].addChild(g),g.addEventListener(engine.MouseEvent.MOUSE_DOWN,this.onDown_garbage,this)}}if(this.conveyorsPool[0].x<-750){for(var c=0;c<this.datas.length;c++){var u=this.datas[c],l=this.conveyorsPool[0].idx4;if(l.children[0]&&u.name==l.children[0].name){u.isOnStage=!1,removeEle(u,this.datas),this.datas.push(u),l.removeChild(l.children[0]);break}}this.conveyorsPool.shift()}else if(this.conveyorsPool[0].x<-600)for(c=0;c<this.datas.length;c++){u=this.datas[c];var p=this.conveyorsPool[0].idx3;if(p.children[0]&&u.name==p.children[0].name){u.isOnStage=!1,removeEle(u,this.datas),this.datas.push(u),p.removeChild(p.children[0]);break}}else if(this.conveyorsPool[0].x<-450)for(c=0;c<this.datas.length;c++){u=this.datas[c];var d=this.conveyorsPool[0].idx2;if(d.children[0]&&u.name==d.children[0].name){u.isOnStage=!1,removeEle(u,this.datas),this.datas.push(u),d.removeChild(d.children[0]);break}}else if(this.conveyorsPool[0].x<-300)for(c=0;c<this.datas.length;c++){u=this.datas[c];var y=this.conveyorsPool[0].idx1;if(y.children[0]&&u.name==y.children[0].name){u.isOnStage=!1,removeEle(u,this.datas),this.datas.push(u),y.removeChild(y.children[0]);break}}else if(this.conveyorsPool[0].x<-150)for(c=0;c<this.datas.length;c++){u=this.datas[c];var m=this.conveyorsPool[0].idx0;if(m.children[0]&&u.name==m.children[0].name){u.isOnStage=!1,removeEle(u,this.datas),this.datas.push(u),m.removeChild(m.children[0]);break}}},e.prototype.addscore=function(){this.score+=props.onceScore||2,engine.globalEvent.dispatchEvent(
\"
recycling-score-update
\"
,{score:this.score})},e.prototype.gameOver=function(){engine.gameStage.removeEventListener(engine.Event.ENTER_FRAME,this.onEnterFrame,this),engine.globalEvent.dispatchEvent(
\"
recycling-game-end
\"
,transStores(this.stores))},e.prototype.onDown_garbage=function(e){this._currentDragView&&removeChild(this._currentDragView);var t=e.target,i=new engine.Sprite(t.texture);this._currentDragView=i,(this._currentTarget=t).scaleX=t.scaleY=0,this.wrapper.addChild(i),i.x=e.stageX-t.texture.width/2,i.y=e.stageY-t.texture.height/2,i.type=t.type,i.name=t.name,this.wrapper.addEventListener(engine.MouseEvent.MOUSE_UP,this.onStageMouseUp,this),this.wrapper.addEventListener(engine.MouseEvent.MOUSE_MOVE,this.onStageMouseMove,this)},e.prototype.onStageMouseMove=function(e){var t=this._currentDragView;t.x=e.stageX-t.texture.width/2,t.y=e.stageY-t.texture.height/2},e.prototype.onStageMouseUp=function(e){var t=this;if(this.wrapper.removeEventListener(engine.MouseEvent.MOUSE_UP,this.onStageMouseUp,this),this.wrapper.removeEventListener(engine.MouseEvent.MOUSE_MOVE,this.onStageMouseMove,this),this._currentDragView){var i=this.checkHitRect();i?(i==this._currentDragView.type?(this.addscore(),this.wrapper.rightTips.play(getTargetRect(i,this.wrapper))):(engine.Tween.get(this._currentTarget).to({scaleX:1,scaleY:1},300).call(function(){}),this.wrapper.wrongTips.play(getTargetRect(i,this.wrapper))),this.stores.push({targetType:i,itemType:this._currentDragView.type,itemName:this._currentDragView.name})):engine.Tween.get(this._currentTarget).to({scaleX:1,scaleY:1},300).call(function(){}),this._currentDragView.anchorX=this._currentDragView.texture.width/2,this._currentDragView.anchorY=this._currentDragView.texture.height/2,engine.Tween.get(this._currentDragView).to({scaleX:0,scaleY:0},300).call(function(){removeChild(t._currentDragView)})}},e.prototype.clear=function(){this.conveyor0.x=0,this.conveyor1.x=764,this.conveyorsPool.forEach(function(e){e.clear()}),this.conveyorsPool=[],this.datas=[],this.stores=[]},e.prototype.timeout=function(){this._currentDragView&&removeChild(this._currentDragView),this.wrapper.removeEventListener(engine.MouseEvent.MOUSE_UP,this.onStageMouseUp,this),this.wrapper.removeEventListener(engine.MouseEvent.MOUSE_MOVE,this.onStageMouseMove,this),this.gameOver()},e.prototype.checkHitRect=function(){return checkHit(this._currentDragView,this.wrapper.wetWaste)?GarbageTypes.wetWaste:checkHit(this._currentDragView,this.wrapper.harmfulWaste)?GarbageTypes.harmfulWaste:checkHit(this._currentDragView,this.wrapper.dryWaste)?GarbageTypes.dryWaste:checkHit(this._currentDragView,this.wrapper.recoverableWaste)?GarbageTypes.recoverableWaste:null},e}(engine.Sprite),uiConfig=function(){return[{id:
\"
playBg
\"
,texture:
\"
playBg
\"
},{id:
\"
idler0
\"
,texture:
\"
idlerWheel
\"
,pos:[75,1038],anchor:[20,21.5]},{id:
\"
idler1
\"
,texture:
\"
idlerWheel
\"
,pos:[175,1038],anchor:[20,21.5]},{id:
\"
idler2
\"
,texture:
\"
idlerWheel
\"
,pos:[275,1038],anchor:[20,21.5]},{id:
\"
idler3
\"
,texture:
\"
idlerWheel
\"
,pos:[375,1038],anchor:[20,21.5]},{id:
\"
idler4
\"
,texture:
\"
idlerWheel
\"
,pos:[475,1038],anchor:[20,21.5]},{id:
\"
idler5
\"
,texture:
\"
idlerWheel
\"
,pos:[575,1038],anchor:[20,21.5]},{id:
\"
idler6
\"
,texture:
\"
idlerWheel
\"
,pos:[675,1038],anchor:[20,21.5]}]},getGuideInfo=function(){return window.localStorage?localStorage.getItem(
\"
recyclingGuide
\"
):0},setGuide=function(){window.localStorage&&localStorage.setItem(
\"
recyclingGuide
\"
,
\"
1
\"
)},createBg=function(e){void 0===e&&(e=1);var t=new engine.Graphics;return t.beginFill(0),t.drawRect(0,0,750,1624),t.endFill(),t.alpha=e,t},createImg=function(e){return new engine.Sprite(getTextureByName(e))},CountDownGroup=function(t){function e(){var e=t.call(this)||this;return e.addChild(createBg(.6)),e.num1=createImg(
\"
num1
\"
),e.num2=createImg(
\"
num2
\"
),e.num3=createImg(
\"
num3
\"
),e.go=createImg(
\"
go
\"
),e.go.anchorX=240,e.go.anchorY=171.5,e.num1.anchorX=125.5,e.num1.anchorY=189,e.num2.anchorX=149.5,e.num2.anchorY=191.5,e.num3.anchorX=148.5,e.num3.anchorY=191.5,e.go.x=135,e.go.y=353.5,e.num1.x=249.5,e.num1.y=340,e.num2.x=225.5,e.num2.y=334.5,e.num3.x=226.5,e.num3.y=333.5,e.addChild(e.num1),e.addChild(e.num2),e.addChild(e.num3),e.addChild(e.go),e.visible=!1,e.reset(),e}return tslib.__extends(e,t),e.prototype.reset=function(){this.go.alpha=this.num1.alpha=this.num2.alpha=this.num3.alpha=0,this.go.scaleX=this.num1.scaleX=this.num2.scaleX=this.num3.scaleX=3,this.go.scaleY=this.num1.scaleY=this.num2.scaleY=this.num3.scaleY=3},e.prototype.startCountDown=function(){return tslib.__awaiter(this,void 0,void 0,function(){var t=this;return tslib.__generator(this,function(e){return[2,new Promise(function(e){t.reset(),t.visible=!0,t.num3.alpha=1,engine.Tween.get(t.num3).to({scaleX:.8,scaleY:.8},200).to({scaleX:1,scaleY:1},100).wait(500).to({scaleX:0,scaleY:0},200).call(function(){t.num2.alpha=1,engine.Tween.get(t.num2).to({scaleX:.8,scaleY:.8},200).to({scaleX:1,scaleY:1},100).wait(500).to({scaleX:0,scaleY:0},200).call(function(){t.num1.alpha=1,engine.Tween.get(t.num1).to({scaleX:.8,scaleY:.8},200).to({scaleX:1,scaleY:1},100).wait(500).to({scaleX:0,scaleY:0},200).call(function(){t.go.alpha=1,engine.Tween.get(t.go).to({scaleX:.8,scaleY:.8},200).to({scaleX:1,scaleY:1},100).wait(500).call(function(){t.visible=!1,e()})})})})})]})})},e}(engine.Sprite),GuideView=function(t){function e(){var e=t.call(this)||this;return e.initUI(),e.visible=!1,e}return tslib.__extends(e,t),e.prototype.initUI=function(){this.addChild(createBg(.6)),this.guideBg=createImg(
\"
guideBg
\"
),this.addChild(this.guideBg),this.guideEle=createImg(
\"
guideEle
\"
),this.addChild(this.guideEle),this.guideBg.x=393,this.guideBg.y=552,this.guideEle.x=361,this.guideEle.y=877,this.guideEle.mouseEnabled=this.guideEle.mouseChildren=!0;var e=createSvga(
\"
guideTips
\"
);this.svga=e,this.addChild(e),e.gotoAndStop(1),e.mouseEnabled=e.mouseChildren=!1},e.prototype.checkHit=function(e,t,i,r){var a=new engine.Rectangle(393,552,281,320);return e>a.x&&t>a.y&&e+i<a.x+a.width&&t+r<a.y+a.height},e.prototype.startGuide=function(){return tslib.__awaiter(this,void 0,void 0,function(){var s=this;return tslib.__generator(this,function(e){return[2,new Promise(function(t){s.visible=!0,s.svga.gotoAndStop(1),s.svga.play(!1,!0),s.guideEle.scaleX=1,s.guideEle.scaleY=1;function i(e){s.stage.removeEventListener(engine.MouseEvent.MOUSE_MOVE,a,s),s.checkHit(s.guideEle.x,s.guideEle.y,s.guideEle.width,s.guideEle.height)?(s.guideEle.removeEventListener(engine.MouseEvent.MOUSE_DOWN,n,s),engine.Tween.get(s.guideEle).to({scaleX:0,scaleY:0},300).call(function(){s.visible=!1,t()})):(s.svga.visible=!0,s.guideEle.x=361,s.guideEle.y=877)}var r=[0,0],a=function(e){s.guideEle.x=e.stageX-r[0],s.guideEle.y=e.stageY-r[1]},n=function(e){r=[e.localX,e.localY],s.svga.visible=!1,s.stage.once(engine.MouseEvent.MOUSE_UP,i,s),s.stage.addEventListener(engine.MouseEvent.MOUSE_MOVE,a,s)};s.guideEle.addEventListener(engine.MouseEvent.MOUSE_DOWN,n,s)})]})})},e}(engine.Sprite),RightTips=function(t){function e(){var e=t.call(this)||this;return e.SCORE=props.onceScore||2,e.img=new engine.Image,e.img.texture=getTextureByName(
\"
rightTips
\"
),e.addChild(e.img),e.img.anchorX=44,e.img.anchorY=42.5,e.visible=!1,e.txt=new engine.TextField,e.addChild(e.txt),e.txt.text=
\"
+
\"
+e.SCORE,e.txt.size=60,e.txt.fillColor=
\"
#437726
\"
,engine.playSound,e}return tslib.__extends(e,t),e.prototype.play=function(e){this.visible=!0,this.txt.x=100,engine.Tween.get(this.txt).set({y:60,alpha:1}).to({y:-50},500).to({alpha:0}),engine.Tween.get(this.img).set({x:0,y:0,scaleX:0,scaleY:0,alpha:1}).to({scaleX:1,scaleY:1},200,engine.Ease.getBackOut(1)).wait(200).to({alpha:0},300),this.x=e.x+180,this.y=e.y},e}(engine.Sprite),GameView=function(t){function e(){var e=t.call(this)||this;return e._timeCounter=0,e.once(engine.Event.ADDED_TO_STAGE,e.setup,e),e}return tslib.__extends(e,t),e.prototype.configUI=function(){var e={};this.uiMap=e;for(var t=0,i=uiConfig();t<i.length;t++){var r=i[t],a=r.id,n=r.texture,s=r.pos,o=r.anchor,h=new engine.Sprite(getTextureByName(n));this.addChild(h),e[a]=h,o&&(h.anchorX=o[0],h.anchorY=o[1]),s&&(h.x=s[0],h.y=s[1],o&&(h.x=s[0]-h.anchorX,h.y=s[1]-h.anchorY))}this.configConveyors(),this.createRects(),this.countdown=new CountDownGroup,this.addChild(this.countdown),this.guide=new GuideView,this.addChild(this.guide),this.wrongTips=new WrongTips,this.rightTips=new RightTips,this.addChild(this.wrongTips),this.addChild(this.rightTips)},e.prototype.createRects=function(){this.wetWaste=this.createRect(74,552,301,293,16777215),this.harmfulWaste=this.createRect(75,247,300,293,16711680),this.dryWaste=this.createRect(389,249,286,291,0),this.recoverableWaste=this.createRect(389,551,287,292,255)},e.prototype.createRect=function(e,t,i,r,a){var n=new engine.Rectangle(e,t,i,r),s=new engine.Sprite;this.addChild(s),s.x=e,s.y=t;var o=new engine.Graphics;return o.alpha=0,o.beginFill(a),o.drawRect(0,0,i,r),o.endFill(),s.addChild(o),n},e.prototype.configConveyors=function(){var e=new Conveyor,t=new Conveyor;this.addChild(e),this.addChild(t),e.x=0,t.x=764,this.conveyors=new Conveyors(this),this.conveyors.initData(e,t)},e.prototype.playAni=function(){var t=this,e=[
\"
idler0
\"
,
\"
idler1
\"
,
\"
idler2
\"
,
\"
idler3
\"
,
\"
idler4
\"
,
\"
idler5
\"
,
\"
idler6
\"
];(e=e.map(function(e){return t.uiMap[e]})).forEach(function(e){engine.Tween.get(e,{loop:!0}).to({rotation:-360},1e3)})},e.prototype.stopAni=function(){var t=this,e=[
\"
idler0
\"
,
\"
idler1
\"
,
\"
idler2
\"
,
\"
idler3
\"
,
\"
idler4
\"
,
\"
idler5
\"
,
\"
idler6
\"
];(e=e.map(function(e){return t.uiMap[e]})).forEach(function(e){engine.Tween.removeTweens(e)})},e.prototype.start=function(){return tslib.__awaiter(this,void 0,void 0,function(){var t=this;return tslib.__generator(this,function(e){switch(e.label){case 0:return console.log(
\"
on start
\"
),this._timeCounter=0,getGuideInfo()?[3,2]:[4,this.guide.startGuide()];case 1:e.sent(),setGuide(),e.label=2;case 2:return this.conveyors.clear(),[4,this.countdown.startCountDown()];case 3:return e.sent(),this.startGame(),engine.globalEvent.dispatchEvent(
\"
recycling-time-update
\"
,{second:this.getSecond()}),this._timer=setInterval(function(){t.onTimer()},1e3),[2]}})})},e.prototype.startGame=function(){this.playAni(),this.conveyors.startConveyors()},e.prototype.stopGame=function(){this.stopAni()},e.prototype.getSecond=function(){return props.time-this._timeCounter},e.prototype.onTimer=function(){this._timeCounter++,engine.globalEvent.dispatchEvent(
\"
recycling-time-update
\"
,{second:this.getSecond()}),0==this.getSecond()&&(this.stop(),this.conveyors.timeout())},e.prototype.stop=function(){clearInterval(this._timer),this.stopGame()},e.prototype.setup=function(){console.log(
\"
onSteup
\"
,props),this.configUI()},e.prototype.onDown=function(e){},e.prototype.stageOnUp=function(e){},e.prototype.onSuccess=function(){},e.prototype.onMove=function(e){},e}(engine.Container),GameWrapper=function(i){function e(){var e=i.call(this)||this;engine.globalEvent.addEventListener(
\"
recycling-start
\"
,e.start,e),engine.globalEvent.addEventListener(
\"
recycling-stop
\"
,e.stop,e);var t=e._gameView=new GameView;return e.addChild(t),e}return tslib.__extends(e,i),e.prototype.start=function(e){injectProps(e.data),this._gameView.start()},e.prototype.stop=function(e){this._gameView.stop()},e}(engine.Container);function index(e){return prepareProps(),injectProps(e),new GameWrapper}module.exports=index
;
\n
"
"code"
:
"
(function (global, factory) {
\n\t
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('tslib')) :
\n\t
typeof define === 'function' && define.amd ? define(['tslib'], factory) :
\n\t
(global = global || self, global.recycling = factory(global.tslib));
\n
}(this, (function (tslib) { 'use strict';
\n\n\t
function getTexture(uuid) {
\n\t
return engine.Texture.from(getAssetByUUID(uuid).uuid);
\n\t
}
\n\t
function getTextureByName(name) {
\n\t
return getTexture(engine.getAssetByName(name).uuid);
\n\t
}
\n\t
function createSvga(name, anchorName) {
\n\t
var inst = new svga.Svga();
\n\t
inst.source = 'asset://' + engine.getAssetByName(name).uuid;
\n\t
return inst;
\n\t
}
\n\t
//# sourceMappingURL=utils.js.map
\n\n\t
var props = {};
\n\t
function prepareProps() {
\n\t
var metaProps = getProps();
\n\t
engine.injectProp(props, metaProps);
\n\t
}
\n\t
function injectProps(p) {
\n\t
engine.injectProp(props, p);
\n\t
}
\n\t
//# sourceMappingURL=props.js.map
\n\n\t
var Conveyor = (function (_super) {
\n\t
tslib.__extends(Conveyor, _super);
\n\t
function Conveyor() {
\n\t
var _this = _super.call(this) || this;
\n\t
_this.y = 904.21;
\n\t
var sp = new engine.Sprite(getTextureByName('conveyor'));
\n\t
_this.addChild(sp);
\n\t
_this.idx0 = _this.createItem(75, 50);
\n\t
_this.idx1 = _this.createItem(225, 50);
\n\t
_this.idx2 = _this.createItem(375, 50);
\n\t
_this.idx3 = _this.createItem(525, 50);
\n\t
_this.idx4 = _this.createItem(675, 50);
\n\t
return _this;
\n\t
}
\n\t
Conveyor.prototype.clear = function () {
\n\t
this.clearItem(this.idx0);
\n\t
this.clearItem(this.idx1);
\n\t
this.clearItem(this.idx2);
\n\t
this.clearItem(this.idx3);
\n\t
this.clearItem(this.idx4);
\n\t
};
\n\t
Conveyor.prototype.clearItem = function (idx) {
\n\t
if (idx.children.length > 0)
\n\t
idx.removeChildAt(0);
\n\t
};
\n\t
Conveyor.prototype.createItem = function (x, y) {
\n\t
var sp = new engine.Sprite();
\n\t
this.addChild(sp);
\n\t
sp.x = x;
\n\t
sp.y = y;
\n\t
return sp;
\n\t
};
\n\t
return Conveyor;
\n\t
}(engine.Sprite));
\n\t
//# sourceMappingURL=Conveyor.js.map
\n\n\t
var GarbageTypes;
\n\t
(function (GarbageTypes) {
\n\t
GarbageTypes[
\"
recoverableWaste
\"
] =
\"
recoverableWaste
\"
;
\n\t
GarbageTypes[
\"
harmfulWaste
\"
] =
\"
harmfulWaste
\"
;
\n\t
GarbageTypes[
\"
wetWaste
\"
] =
\"
wetWaste
\"
;
\n\t
GarbageTypes[
\"
dryWaste
\"
] =
\"
dryWaste
\"
;
\n\t
})(GarbageTypes || (GarbageTypes = {}));
\n\t
//# sourceMappingURL=GarbageTypes.js.map
\n\n\t
var GarbageConfig = (function () {
\n\t
function GarbageConfig() {
\n\t
}
\n\t
GarbageConfig.config = [
\n\t
{ name:
\"
保鲜盒
\"
, source:
\"
g00
\"
, type: GarbageTypes.recoverableWaste, width: 129, height: 111 },
\n\t
{ name:
\"
报纸
\"
, source:
\"
g01
\"
, type: GarbageTypes.recoverableWaste, width: 138, height: 144 },
\n\t
{ name:
\"
贝壳
\"
, source:
\"
g02
\"
, type: GarbageTypes.dryWaste, width: 79, height: 117 },
\n\t
{ name:
\"
冰箱
\"
, source:
\"
g03
\"
, type: GarbageTypes.wetWaste, width: 63, height: 151 },
\n\t
{ name:
\"
菜梗菜叶
\"
, source:
\"
g04
\"
, type: GarbageTypes.wetWaste, width: 144, height: 98 },
\n\t
{ name:
\"
残枝落叶
\"
, source:
\"
g05
\"
, type: GarbageTypes.wetWaste, width: 120, height: 99 },
\n\t
{ name:
\"
茶叶渣
\"
, source:
\"
g06
\"
, type: GarbageTypes.wetWaste, width: 86, height: 96 },
\n\t
{ name:
\"
尘土
\"
, source:
\"
g07
\"
, type: GarbageTypes.dryWaste, width: 109, height: 114 },
\n\t
{ name:
\"
创可贴
\"
, source:
\"
g08
\"
, type: GarbageTypes.dryWaste, width: 112, height: 90 },
\n\t
{ name:
\"
大骨头
\"
, source:
\"
g09
\"
, type: GarbageTypes.dryWaste, width: 89, height: 101 },
\n\t
{ name:
\"
灯泡
\"
, source:
\"
g10
\"
, type: GarbageTypes.recoverableWaste, width: 84, height: 104 },
\n\t
{ name:
\"
电池
\"
, source:
\"
g11
\"
, type: GarbageTypes.dryWaste, width: 89, height: 131 },
\n\t
{ name:
\"
方便面盒
\"
, source:
\"
g12
\"
, type: GarbageTypes.dryWaste, width: 89, height: 168 },
\n\t
{ name:
\"
废弃食用油脂
\"
, source:
\"
g13
\"
, type: GarbageTypes.wetWaste, width: 131, height: 164 },
\n\t
{ name:
\"
骨骼内脏
\"
, source:
\"
g14
\"
, type: GarbageTypes.wetWaste, width: 104, height: 82 },
\n\t
{ name:
\"
锅具
\"
, source:
\"
g15
\"
, type: GarbageTypes.recoverableWaste, width: 119, height: 149 },
\n\t
{ name:
\"
果核
\"
, source:
\"
g16
\"
, type: GarbageTypes.wetWaste, width: 99, height: 95 },
\n\t
{ name:
\"
果皮
\"
, source:
\"
g17
\"
, type: GarbageTypes.wetWaste, width: 115, height: 127 },
\n\t
{ name:
\"
化妆品
\"
, source:
\"
g18
\"
, type: GarbageTypes.harmfulWaste, width: 67, height: 151 },
\n\t
{ name:
\"
鸡蛋壳
\"
, source:
\"
g19
\"
, type: GarbageTypes.wetWaste, width: 99, height: 107 },
\n\t
{ name:
\"
剪刀
\"
, source:
\"
g20
\"
, type: GarbageTypes.recoverableWaste, width: 96, height: 127 },
\n\t
{ name:
\"
胶带
\"
, source:
\"
g21
\"
, type: GarbageTypes.dryWaste, width: 87, height: 113 },
\n\t
{ name:
\"
榴莲壳
\"
, source:
\"
g22
\"
, type: GarbageTypes.dryWaste, width: 136, height: 116 },
\n\t
{ name:
\"
毛巾
\"
, source:
\"
g23
\"
, type: GarbageTypes.recoverableWaste, width: 108, height: 96 },
\n\t
{ name:
\"
纽扣电池
\"
, source:
\"
g24
\"
, type: GarbageTypes.harmfulWaste, width: 87, height: 89 },
\n\t
{ name:
\"
破旧陶瓷罐
\"
, source:
\"
g25
\"
, type: GarbageTypes.dryWaste, width: 110, height: 125 },
\n\t
{ name:
\"
杀虫剂
\"
, source:
\"
g26
\"
, type: GarbageTypes.harmfulWaste, width: 64, height: 160 },
\n\t
{ name:
\"
剩菜剩饭
\"
, source:
\"
g27
\"
, type: GarbageTypes.wetWaste, width: 128, height: 96 },
\n\t
{ name:
\"
手机
\"
, source:
\"
g28
\"
, type: GarbageTypes.recoverableWaste, width: 82, height: 142 },
\n\t
{ name:
\"
书本
\"
, source:
\"
g29
\"
, type: GarbageTypes.recoverableWaste, width: 106, height: 132 },
\n\t
{ name:
\"
水杯
\"
, source:
\"
g30
\"
, type: GarbageTypes.recoverableWaste, width: 62, height: 119 },
\n\t
{ name:
\"
水银温度计
\"
, source:
\"
g31
\"
, type: GarbageTypes.harmfulWaste, width: 109, height: 162 },
\n\t
{ name:
\"
水银血压计
\"
, source:
\"
g32
\"
, type: GarbageTypes.harmfulWaste, width: 115, height: 147 },
\n\t
{ name:
\"
塑料桶
\"
, source:
\"
g33
\"
, type: GarbageTypes.recoverableWaste, width: 92, height: 131 },
\n\t
{ name:
\"
卫生纸
\"
, source:
\"
g34
\"
, type: GarbageTypes.dryWaste, width: 92, height: 132 },
\n\t
{ name:
\"
污染织物
\"
, source:
\"
g35
\"
, type: GarbageTypes.dryWaste, width: 128, height: 139 },
\n\t
{ name:
\"
污染纸张
\"
, source:
\"
g36
\"
, type: GarbageTypes.dryWaste, width: 96, height: 136 },
\n\t
{ name:
\"
洗衣机
\"
, source:
\"
g37
\"
, type: GarbageTypes.recoverableWaste, width: 87, height: 157 },
\n\t
{ name:
\"
烟蒂
\"
, source:
\"
g38
\"
, type: GarbageTypes.dryWaste, width: 87, height: 124 },
\n\t
{ name:
\"
药品
\"
, source:
\"
g39
\"
, type: GarbageTypes.harmfulWaste, width: 109, height: 131 },
\n\t
{ name:
\"
药品包装
\"
, source:
\"
g40
\"
, type: GarbageTypes.harmfulWaste, width: 108, height: 125 },
\n\t
{ name:
\"
椰子壳
\"
, source:
\"
g41
\"
, type: GarbageTypes.dryWaste, width: 104, height: 119 },
\n\t
{ name:
\"
衣服
\"
, source:
\"
g42
\"
, type: GarbageTypes.recoverableWaste, width: 83, height: 137 },
\n\t
{ name:
\"
衣架
\"
, source:
\"
g43
\"
, type: GarbageTypes.recoverableWaste, width: 132, height: 125 },
\n\t
{ name:
\"
易拉罐
\"
, source:
\"
g44
\"
, type: GarbageTypes.recoverableWaste, width: 65, height: 133 },
\n\t
{ name:
\"
荧光灯
\"
, source:
\"
g45
\"
, type: GarbageTypes.harmfulWaste, width: 90, height: 118 },
\n\t
{ name:
\"
油漆桶
\"
, source:
\"
g46
\"
, type: GarbageTypes.harmfulWaste, width: 65, height: 143 },
\n\t
{ name:
\"
纸杯
\"
, source:
\"
g47
\"
, type: GarbageTypes.dryWaste, width: 76, height: 116 },
\n\t
{ name:
\"
纸尿裤
\"
, source:
\"
g48
\"
, type: GarbageTypes.dryWaste, width: 93, height: 138 },
\n\t
{ name:
\"
纸箱
\"
, source:
\"
g49
\"
, type: GarbageTypes.recoverableWaste, width: 112, height: 118 },
\n\t
{ name:
\"
指甲油
\"
, source:
\"
g50
\"
, type: GarbageTypes.harmfulWaste, width: 64, height: 138 },
\n\t
];
\n\t
return GarbageConfig;
\n\t
}());
\n\t
//# sourceMappingURL=GarbageConfig.js.map
\n\n\t
var transStores = (function (list) {
\n\t
var tmp = [];
\n\t
var contains = function (val) {
\n\t
for (var _i = 0, tmp_1 = tmp; _i < tmp_1.length; _i++) {
\n\t
var i = tmp_1[_i];
\n\t
if (val.targetType == i.targetType && val.itemType == i.itemType && val.itemName == i.itemName)
\n\t
return true;
\n\t
}
\n\t
return false;
\n\t
};
\n\t
list.forEach(function (i) {
\n\t
if (!contains(i))
\n\t
tmp.push(i);
\n\t
});
\n\t
list = tmp;
\n\t
tmp = [];
\n\t
var nameList = [];
\n\t
var contains2 = function (val) {
\n\t
for (var _i = 0, tmp_2 = tmp; _i < tmp_2.length; _i++) {
\n\t
var i = tmp_2[_i];
\n\t
if (val.itemName == i.itemName) {
\n\t
nameList.push(i.itemName);
\n\t
return true;
\n\t
}
\n\t
}
\n\t
return false;
\n\t
};
\n\t
list.forEach(function (i) {
\n\t
if (!contains2(i))
\n\t
tmp.push(i);
\n\t
});
\n\t
list = tmp;
\n\t
list.forEach(function (i) {
\n\t
if (nameList.indexOf(i.itemName) != -1) {
\n\t
i.targetType = i.itemType;
\n\t
}
\n\t
});
\n\t
return list.map(function (i) {
\n\t
return {
\n\t
'targetName': getTargetName(i.targetType),
\n\t
'isCorrect': i.targetType == i.itemType,
\n\t
'itemName': i.itemName
\n\t
};
\n\t
});
\n\t
});
\n\t
var getTargetName = function (type) {
\n\t
switch (type) {
\n\t
case GarbageTypes.recoverableWaste:
\n\t
return '可回收物';
\n\t
case GarbageTypes.harmfulWaste:
\n\t
return '有害垃圾';
\n\t
case GarbageTypes.wetWaste:
\n\t
return '湿垃圾';
\n\t
case GarbageTypes.dryWaste:
\n\t
return '其他垃圾';
\n\t
}
\n\t
};
\n\t
//# sourceMappingURL=transStores.js.map
\n\n\t
var checkHit = (function (view, rect) {
\n\t
var x = view.x, y = view.y;
\n\t
var _a = view.texture, width = _a.width, height = _a.height;
\n\t
if (x > rect.x && y > rect.y && (x + width) < (rect.x + rect.width) && (y + height) < (rect.y + rect.height)) {
\n\t
return true;
\n\t
}
\n\t
return false;
\n\t
});
\n\t
//# sourceMappingURL=checkHit.js.map
\n\n\t
var removeChild = (function (d) {
\n\t
if (d && d.parent) {
\n\t
d.parent.removeChild(d);
\n\t
}
\n\t
});
\n\t
//# sourceMappingURL=removeChild.js.map
\n\n\t
var removeEle = (function (e, arr) {
\n\t
var index = arr.indexOf(e);
\n\t
if (index >= 0) {
\n\t
arr.splice(index, 1);
\n\t
}
\n\t
});
\n\t
//# sourceMappingURL=removeEle.js.map
\n\n\t
var shuffle = (function (arr) {
\n\t
var _a;
\n\t
var i = arr.length;
\n\t
while (i) {
\n\t
var j = Math.floor(Math.random() * i--);
\n\t
_a = [arr[i], arr[j]], arr[j] = _a[0], arr[i] = _a[1];
\n\t
}
\n\t
return arr;
\n\t
});
\n\n\t
var WrongTips = (function (_super) {
\n\t
tslib.__extends(WrongTips, _super);
\n\t
function WrongTips() {
\n\t
var _this = _super.call(this) || this;
\n\t
_this.img = new engine.Image();
\n\t
_this.img.texture = getTextureByName('wrongTips');
\n\t
_this.addChild(_this.img);
\n\t
_this.img.anchorX = 88 / 2;
\n\t
_this.img.anchorY = 85 / 2;
\n\t
_this.visible = false;
\n\t
return _this;
\n\t
}
\n\t
WrongTips.prototype.play = function (rect) {
\n\t
this.visible = true;
\n\t
var dur = 70;
\n\t
var stren = 20;
\n\t
engine.Tween.get(this.img).set({ x: 0, y: 0, scaleX: 1, scaleY: 1, alpha: 1 })
\n\t
.to({ x: stren }, dur)
\n\t
.to({ x: 0 }, dur)
\n\t
.to({ x: -stren }, dur)
\n\t
.to({ x: 0 }, dur)
\n\t
.wait(200)
\n\t
.to({ alpha: 0 }, 300);
\n\t
this.x = rect.x + 180;
\n\t
this.y = rect.y;
\n\t
};
\n\t
return WrongTips;
\n\t
}(engine.Sprite));
\n\t
var getTargetRect = function (targetType, gameview) {
\n\t
switch (targetType) {
\n\t
case GarbageTypes.dryWaste:
\n\t
return gameview.dryWaste;
\n\t
case GarbageTypes.wetWaste:
\n\t
return gameview.wetWaste;
\n\t
case GarbageTypes.harmfulWaste:
\n\t
return gameview.harmfulWaste;
\n\t
case GarbageTypes.recoverableWaste:
\n\t
return gameview.recoverableWaste;
\n\t
}
\n\t
};
\n\t
//# sourceMappingURL=WrongTips.js.map
\n\n\t
var Conveyors = (function (_super) {
\n\t
tslib.__extends(Conveyors, _super);
\n\t
function Conveyors(p) {
\n\t
var _this = _super.call(this) || this;
\n\t
_this.conveyorsPool = [];
\n\t
_this.GarbageConfig = GarbageConfig.config;
\n\t
_this.datas = [];
\n\t
_this.wrapper = p;
\n\t
return _this;
\n\t
}
\n\t
Conveyors.prototype.initData = function (conveyor0, conveyor1) {
\n\t
this.conveyor0 = conveyor0;
\n\t
this.conveyor1 = conveyor1;
\n\t
};
\n\t
Conveyors.prototype.setDefault = function () {
\n\t
this.score = 0;
\n\t
this.conveyorsPool.push(this.conveyor0);
\n\t
this.conveyorsPool.push(this.conveyor1);
\n\t
var allConfigs = shuffle(this.GarbageConfig.concat([]));
\n\t
for (var i = 0; i < GarbageConfig.config.length; i++) {
\n\t
allConfigs[i].idx = i;
\n\t
allConfigs[i].isRight = false;
\n\t
allConfigs[i].isMistake = false;
\n\t
allConfigs[i].isOnStage = false;
\n\t
this.datas.push(allConfigs[i]);
\n\t
}
\n\t
for (var i = 0; i < 5; i++) {
\n\t
var data = this.datas[i];
\n\t
var view = new engine.Sprite(getTextureByName(data.source));
\n\t
view.isWrong = false;
\n\t
view.isRight = false;
\n\t
data.isOnStage = true;
\n\t
view.type = data.type;
\n\t
view.name = data.name;
\n\t
view.anchorX = data.width / 2;
\n\t
view.anchorY = data.height;
\n\t
view.x = -data.width / 2;
\n\t
view.y = -data.height + 40;
\n\t
this.conveyor1[
\"
idx
\"
+ i].addChild(view);
\n\t
view.addEventListener(engine.MouseEvent.MOUSE_DOWN, this.onDown_garbage, this);
\n\t
}
\n\t
};
\n\t
Conveyors.prototype.startConveyors = function () {
\n\t
this.setDefault();
\n\t
engine.gameStage.addEventListener(engine.Event.ENTER_FRAME, this.onEnterFrame, this);
\n\t
};
\n\t
Conveyors.prototype.onEnterFrame = function (ENTER_FRAME, onEnterFrame, arg2) {
\n\t
if (this.score == (props.maxScore || 100)) {
\n\t
this.gameOver();
\n\t
this.wrapper.stop();
\n\t
}
\n\t
this.conveyorsPool.forEach(function (conveyor) {
\n\t
conveyor.x -= props.speed || 3;
\n\t
});
\n\t
if (this.conveyorsPool[this.conveyorsPool.length - 1].x <= 764) {
\n\t
var conveyor = new Conveyor();
\n\t
conveyor.x = this.conveyorsPool[this.conveyorsPool.length - 1].x + 764;
\n\t
this.wrapper.addChild(conveyor);
\n\t
this.conveyorsPool.push(conveyor);
\n\t
}
\n\t
else {
\n\t
var dataList = [];
\n\t
for (var n = 0; n < this.datas.length; n++) {
\n\t
var dataItem = this.datas[n];
\n\t
if (!dataItem.isRight && !dataItem.isOnStage) {
\n\t
dataList.push(dataItem);
\n\t
}
\n\t
}
\n\t
var lastConveyor = this.conveyorsPool[this.conveyorsPool.length - 1];
\n\t
for (var m = 0; m < 5; m++) {
\n\t
if (!lastConveyor[
\"
idx
\"
+ m].children[0]) {
\n\t
var data = dataList.shift();
\n\t
if (data) {
\n\t
data.isOnStage = true;
\n\t
var view = new engine.Sprite(getTextureByName(data.source));
\n\t
view.isWrong = false;
\n\t
view.isRight = false;
\n\t
view.type = data.type;
\n\t
view.name = data.name;
\n\t
view.anchorX = data.width / 2;
\n\t
view.anchorY = data.height;
\n\t
view.x = -data.width / 2;
\n\t
view.y = -data.height + 40;
\n\t
lastConveyor[
\"
idx
\"
+ m].addChild(view);
\n\t
view.addEventListener(engine.MouseEvent.MOUSE_DOWN, this.onDown_garbage, this);
\n\t
}
\n\t
else {
\n\t
break;
\n\t
}
\n\t
}
\n\t
}
\n\t
}
\n\t
if (this.conveyorsPool[0].x < -750) {
\n\t
for (var k = 0; k < this.datas.length; k++) {
\n\t
var dataItem = this.datas[k];
\n\t
var idx4 = this.conveyorsPool[0][
\"
idx
\"
+ 4];
\n\t
if (idx4.children[0]) {
\n\t
if (dataItem.name == idx4.children[0].name) {
\n\t
dataItem.isOnStage = false;
\n\t
removeEle(dataItem, this.datas);
\n\t
this.datas.push(dataItem);
\n\t
idx4.removeChild(idx4.children[0]);
\n\t
break;
\n\t
}
\n\t
}
\n\t
}
\n\t
this.conveyorsPool.shift();
\n\t
}
\n\t
else if (this.conveyorsPool[0].x < -600) {
\n\t
for (var k = 0; k < this.datas.length; k++) {
\n\t
var dataItem = this.datas[k];
\n\t
var idx3 = this.conveyorsPool[0][
\"
idx
\"
+ 3];
\n\t
if (idx3.children[0]) {
\n\t
if (dataItem.name == idx3.children[0].name) {
\n\t
dataItem.isOnStage = false;
\n\t
removeEle(dataItem, this.datas);
\n\t
this.datas.push(dataItem);
\n\t
idx3.removeChild(idx3.children[0]);
\n\t
break;
\n\t
}
\n\t
}
\n\t
}
\n\t
}
\n\t
else if (this.conveyorsPool[0].x < -450) {
\n\t
for (var k = 0; k < this.datas.length; k++) {
\n\t
var dataItem = this.datas[k];
\n\t
var idx2 = this.conveyorsPool[0][
\"
idx
\"
+ 2];
\n\t
if (idx2.children[0]) {
\n\t
if (dataItem.name == idx2.children[0].name) {
\n\t
dataItem.isOnStage = false;
\n\t
removeEle(dataItem, this.datas);
\n\t
this.datas.push(dataItem);
\n\t
idx2.removeChild(idx2.children[0]);
\n\t
break;
\n\t
}
\n\t
}
\n\t
}
\n\t
}
\n\t
else if (this.conveyorsPool[0].x < -300) {
\n\t
for (var k = 0; k < this.datas.length; k++) {
\n\t
var dataItem = this.datas[k];
\n\t
var idx1 = this.conveyorsPool[0][
\"
idx
\"
+ 1];
\n\t
if (idx1.children[0]) {
\n\t
if (dataItem.name == idx1.children[0].name) {
\n\t
dataItem.isOnStage = false;
\n\t
removeEle(dataItem, this.datas);
\n\t
this.datas.push(dataItem);
\n\t
idx1.removeChild(idx1.children[0]);
\n\t
break;
\n\t
}
\n\t
}
\n\t
}
\n\t
}
\n\t
else if (this.conveyorsPool[0].x < -150) {
\n\t
for (var k = 0; k < this.datas.length; k++) {
\n\t
var dataItem = this.datas[k];
\n\t
var idx0 = this.conveyorsPool[0][
\"
idx
\"
+ 0];
\n\t
if (idx0.children[0]) {
\n\t
if (dataItem.name == idx0.children[0].name) {
\n\t
dataItem.isOnStage = false;
\n\t
removeEle(dataItem, this.datas);
\n\t
this.datas.push(dataItem);
\n\t
idx0.removeChild(idx0.children[0]);
\n\t
break;
\n\t
}
\n\t
}
\n\t
}
\n\t
}
\n\t
};
\n\t
Conveyors.prototype.addscore = function () {
\n\t
this.score += (props.onceScore || 2);
\n\t
engine.globalEvent.dispatchEvent('recycling-score-update', {
\n\t
score: this.score
\n\t
});
\n\t
};
\n\t
Conveyors.prototype.gameOver = function () {
\n\t
engine.gameStage.removeEventListener(engine.Event.ENTER_FRAME, this.onEnterFrame, this);
\n\t
engine.globalEvent.dispatchEvent('recycling-game-end', transStores(this.stores));
\n\t
};
\n\t
Conveyors.prototype.onDown_garbage = function (e) {
\n\t
if (this._currentDragView) {
\n\t
removeChild(this._currentDragView);
\n\t
}
\n\t
var target = e.target;
\n\t
var view = new engine.Sprite(target.texture);
\n\t
this._currentDragView = view;
\n\t
this._currentTarget = target;
\n\t
target.scaleX = target.scaleY = 0;
\n\t
this.wrapper.addChild(view);
\n\t
view.x = e.stageX - target.texture.width / 2;
\n\t
view.y = e.stageY - target.texture.height / 2;
\n\t
view.type = target['type'];
\n\t
view.name = target['name'];
\n\t
this.wrapper.addEventListener(engine.MouseEvent.MOUSE_UP, this.onStageMouseUp, this);
\n\t
this.wrapper.addEventListener(engine.MouseEvent.MOUSE_MOVE, this.onStageMouseMove, this);
\n\t
};
\n\t
Conveyors.prototype.onStageMouseMove = function (e) {
\n\t
var view = this._currentDragView;
\n\t
view.x = e.stageX - view.texture.width / 2;
\n\t
view.y = e.stageY - view.texture.height / 2;
\n\t
};
\n\t
Conveyors.prototype.onStageMouseUp = function (e) {
\n\t
var _this = this;
\n\t
this.wrapper.removeEventListener(engine.MouseEvent.MOUSE_UP, this.onStageMouseUp, this);
\n\t
this.wrapper.removeEventListener(engine.MouseEvent.MOUSE_MOVE, this.onStageMouseMove, this);
\n\t
if (!this._currentDragView)
\n\t
return;
\n\t
var result = this.checkHitRect();
\n\t
if (result) {
\n\t
if (result == this._currentDragView['type']) {
\n\t
this.addscore();
\n\t
this.wrapper.rightTips.play(getTargetRect(result, this.wrapper));
\n\t
}
\n\t
else {
\n\t
engine.Tween.get(this._currentTarget).to({ scaleX: 1, scaleY: 1 }, 300).call(function () { });
\n\t
this.wrapper.wrongTips.play(getTargetRect(result, this.wrapper));
\n\t
}
\n\t
this.stores.push({ targetType: result, itemType: this._currentDragView['type'], itemName: this._currentDragView['name'] });
\n\t
}
\n\t
else {
\n\t
engine.Tween.get(this._currentTarget).to({ scaleX: 1, scaleY: 1 }, 300).call(function () { });
\n\t
}
\n\t
this._currentDragView.anchorX = this._currentDragView.texture.width / 2;
\n\t
this._currentDragView.anchorY = this._currentDragView.texture.height / 2;
\n\t
engine.Tween.get(this._currentDragView).to({ scaleX: 0, scaleY: 0 }, 300).call(function () {
\n\t
removeChild(_this._currentDragView);
\n\t
});
\n\t
};
\n\t
Conveyors.prototype.clear = function () {
\n\t
this.conveyor0.x = 0;
\n\t
this.conveyor1.x = 764;
\n\t
this.conveyorsPool.forEach(function (i) {
\n\t
i.clear();
\n\t
});
\n\t
this.conveyorsPool = [];
\n\t
this.datas = [];
\n\t
this.stores = [];
\n\t
};
\n\t
Conveyors.prototype.timeout = function () {
\n\t
if (this._currentDragView) {
\n\t
removeChild(this._currentDragView);
\n\t
}
\n\t
this.wrapper.removeEventListener(engine.MouseEvent.MOUSE_UP, this.onStageMouseUp, this);
\n\t
this.wrapper.removeEventListener(engine.MouseEvent.MOUSE_MOVE, this.onStageMouseMove, this);
\n\t
this.gameOver();
\n\t
};
\n\t
Conveyors.prototype.checkHitRect = function () {
\n\t
if (checkHit(this._currentDragView, this.wrapper.wetWaste)) {
\n\t
return GarbageTypes.wetWaste;
\n\t
}
\n\t
if (checkHit(this._currentDragView, this.wrapper.harmfulWaste)) {
\n\t
return GarbageTypes.harmfulWaste;
\n\t
}
\n\t
if (checkHit(this._currentDragView, this.wrapper.dryWaste)) {
\n\t
return GarbageTypes.dryWaste;
\n\t
}
\n\t
if (checkHit(this._currentDragView, this.wrapper.recoverableWaste)) {
\n\t
return GarbageTypes.recoverableWaste;
\n\t
}
\n\t
return null;
\n\t
};
\n\t
return Conveyors;
\n\t
}(engine.Sprite));
\n\n\t
var uiConfig = (function () {
\n\t
return [
\n\t
{
\n\t
id: 'playBg',
\n\t
texture: 'playBg'
\n\t
},
\n\t
{
\n\t
id: 'idler0',
\n\t
texture: 'idlerWheel',
\n\t
pos: [75, 1038],
\n\t
anchor: [20, 21.5]
\n\t
},
\n\t
{
\n\t
id: 'idler1',
\n\t
texture: 'idlerWheel',
\n\t
pos: [175, 1038],
\n\t
anchor: [20, 21.5]
\n\t
},
\n\t
{
\n\t
id: 'idler2',
\n\t
texture: 'idlerWheel',
\n\t
pos: [275, 1038],
\n\t
anchor: [20, 21.5]
\n\t
},
\n\t
{
\n\t
id: 'idler3',
\n\t
texture: 'idlerWheel',
\n\t
pos: [375, 1038],
\n\t
anchor: [20, 21.5]
\n\t
},
\n\t
{
\n\t
id: 'idler4',
\n\t
texture: 'idlerWheel',
\n\t
pos: [475, 1038],
\n\t
anchor: [20, 21.5]
\n\t
},
\n\t
{
\n\t
id: 'idler5',
\n\t
texture: 'idlerWheel',
\n\t
pos: [575, 1038],
\n\t
anchor: [20, 21.5]
\n\t
},
\n\t
{
\n\t
id: 'idler6',
\n\t
texture: 'idlerWheel',
\n\t
pos: [675, 1038],
\n\t
anchor: [20, 21.5]
\n\t
},
\n\t
];
\n\t
});
\n\t
//# sourceMappingURL=uiConfig.js.map
\n\n\t
var getGuideInfo = (function () {
\n\t
if (!window.localStorage) {
\n\t
return 0;
\n\t
}
\n\t
return localStorage.getItem('recyclingGuide');
\n\t
});
\n\t
var setGuide = function () {
\n\t
if (window.localStorage)
\n\t
localStorage.setItem('recyclingGuide', '1');
\n\t
};
\n\t
//# sourceMappingURL=getGuideInfo.js.map
\n\n\t
var createBg = (function (a) {
\n\t
if (a === void 0) { a = 1; }
\n\t
var rect = new engine.Graphics();
\n\t
rect.beginFill(0);
\n\t
rect.drawRect(0, 0, 750, 1624);
\n\t
rect.endFill();
\n\t
rect.alpha = a;
\n\t
return rect;
\n\t
});
\n\t
//# sourceMappingURL=createBg.js.map
\n\n\t
var createImg = (function (texture) {
\n\t
return new engine.Sprite(getTextureByName(texture));
\n\t
});
\n\t
//# sourceMappingURL=createImg.js.map
\n\n\t
var CountDownGroup = (function (_super) {
\n\t
tslib.__extends(CountDownGroup, _super);
\n\t
function CountDownGroup() {
\n\t
var _this = _super.call(this) || this;
\n\t
_this.addChild(createBg(.6));
\n\t
_this.num1 = createImg('num1');
\n\t
_this.num2 = createImg('num2');
\n\t
_this.num3 = createImg('num3');
\n\t
_this.go = createImg('go');
\n\t
_this.go.anchorX = 240;
\n\t
_this.go.anchorY = 171.5;
\n\t
_this.num1.anchorX = 125.5;
\n\t
_this.num1.anchorY = 189;
\n\t
_this.num2.anchorX = 149.5;
\n\t
_this.num2.anchorY = 191.5;
\n\t
_this.num3.anchorX = 148.5;
\n\t
_this.num3.anchorY = 191.5;
\n\t
_this.go.x = 750 / 2 - 240;
\n\t
_this.go.y = 525 - 171.5;
\n\t
_this.num1.x = 750 / 2 - 125.5;
\n\t
_this.num1.y = 529 - 189;
\n\t
_this.num2.x = 750 / 2 - 149.5;
\n\t
_this.num2.y = 526 - 191.5;
\n\t
_this.num3.x = 750 / 2 - 148.5;
\n\t
_this.num3.y = 525 - 191.5;
\n\t
_this.addChild(_this.num1);
\n\t
_this.addChild(_this.num2);
\n\t
_this.addChild(_this.num3);
\n\t
_this.addChild(_this.go);
\n\t
_this.visible = false;
\n\t
_this.reset();
\n\t
return _this;
\n\t
}
\n\t
CountDownGroup.prototype.reset = function () {
\n\t
this.go.alpha = this.num1.alpha = this.num2.alpha = this.num3.alpha = 0;
\n\t
this.go.scaleX = this.num1.scaleX = this.num2.scaleX = this.num3.scaleX = 3;
\n\t
this.go.scaleY = this.num1.scaleY = this.num2.scaleY = this.num3.scaleY = 3;
\n\t
};
\n\t
CountDownGroup.prototype.startCountDown = function () {
\n\t
return tslib.__awaiter(this, void 0, void 0, function () {
\n\t
var _this = this;
\n\t
return tslib.__generator(this, function (_a) {
\n\t
return [2, new Promise(function (r) {
\n\t
_this.reset();
\n\t
_this.visible = true;
\n\t
_this.num3.alpha = 1;
\n\t
var n3 = engine.Tween.get(_this.num3);
\n\t
n3.to({ scaleX: 0.8, scaleY: 0.8 }, 200).to({ scaleX: 1, scaleY: 1 }, 100).wait(500).to({ scaleX: 0, scaleY: 0 }, 200).call(function () {
\n\t
_this.num2.alpha = 1;
\n\t
var n2 = engine.Tween.get(_this.num2);
\n\t
n2.to({ scaleX: 0.8, scaleY: 0.8 }, 200).to({ scaleX: 1, scaleY: 1 }, 100).wait(500).to({ scaleX: 0, scaleY: 0 }, 200).call(function () {
\n\t
_this.num1.alpha = 1;
\n\t
var n1 = engine.Tween.get(_this.num1);
\n\t
n1.to({ scaleX: 0.8, scaleY: 0.8 }, 200).to({ scaleX: 1, scaleY: 1 }, 100).wait(500).to({ scaleX: 0, scaleY: 0 }, 200).call(function () {
\n\t
_this.go.alpha = 1;
\n\t
var go = engine.Tween.get(_this.go);
\n\t
go.to({ scaleX: 0.8, scaleY: 0.8 }, 200).to({ scaleX: 1, scaleY: 1 }, 100).wait(500).call(function () {
\n\t
_this.visible = false;
\n\t
r();
\n\t
});
\n\t
});
\n\t
});
\n\t
});
\n\t
})];
\n\t
});
\n\t
});
\n\t
};
\n\t
return CountDownGroup;
\n\t
}(engine.Sprite));
\n\t
//# sourceMappingURL=CountDownGroup.js.map
\n\n\t
var GuideView = (function (_super) {
\n\t
tslib.__extends(GuideView, _super);
\n\t
function GuideView() {
\n\t
var _this = _super.call(this) || this;
\n\t
_this.initUI();
\n\t
_this.visible = false;
\n\t
return _this;
\n\t
}
\n\t
GuideView.prototype.initUI = function () {
\n\t
this.addChild(createBg(.6));
\n\t
this.guideBg = createImg('guideBg');
\n\t
this.addChild(this.guideBg);
\n\t
this.guideEle = createImg('guideEle');
\n\t
this.addChild(this.guideEle);
\n\t
this.guideBg.x = 393;
\n\t
this.guideBg.y = 552;
\n\t
this.guideEle.x = 361;
\n\t
this.guideEle.y = 877;
\n\t
this.guideEle.mouseEnabled = this.guideEle.mouseChildren = true;
\n\t
var svga = createSvga(
\"
guideTips
\"
);
\n\t
this.svga = svga;
\n\t
this.addChild(svga);
\n\t
svga.gotoAndStop(1);
\n\t
svga.mouseEnabled = svga.mouseChildren = false;
\n\t
};
\n\t
GuideView.prototype.checkHit = function (x, y, w, h) {
\n\t
var rect = new engine.Rectangle(393, 552, 281, 320);
\n\t
if (x > rect.x && y > rect.y && (x + w) < (rect.x + rect.width) && (y + h) < (rect.y + rect.height)) {
\n\t
return true;
\n\t
}
\n\t
return false;
\n\t
};
\n\t
GuideView.prototype.startGuide = function () {
\n\t
return tslib.__awaiter(this, void 0, void 0, function () {
\n\t
var _this = this;
\n\t
return tslib.__generator(this, function (_a) {
\n\t
return [2, new Promise(function (r) {
\n\t
_this.visible = true;
\n\t
_this.svga.gotoAndStop(1);
\n\t
_this.svga.play(false, true);
\n\t
_this.guideEle.scaleX = 1;
\n\t
_this.guideEle.scaleY = 1;
\n\t
var offset = [0, 0];
\n\t
var guideOver = function () {
\n\t
_this.guideEle.removeEventListener(engine.MouseEvent.MOUSE_DOWN, ondown, _this);
\n\t
engine.Tween.get(_this.guideEle).to({ scaleX: 0, scaleY: 0 }, 300).call(function () {
\n\t
_this.visible = false;
\n\t
r();
\n\t
});
\n\t
};
\n\t
var onUp = function (e) {
\n\t
_this.stage.removeEventListener(engine.MouseEvent.MOUSE_MOVE, onMove, _this);
\n\t
if (_this.checkHit(_this.guideEle.x, _this.guideEle.y, _this.guideEle.width, _this.guideEle.height)) {
\n\t
guideOver();
\n\t
}
\n\t
else {
\n\t
_this.svga.visible = true;
\n\t
_this.guideEle.x = 361;
\n\t
_this.guideEle.y = 877;
\n\t
}
\n\t
};
\n\t
var onMove = function (e) {
\n\t
_this.guideEle.x = e.stageX - offset[0];
\n\t
_this.guideEle.y = e.stageY - offset[1];
\n\t
};
\n\t
var ondown = function (e) {
\n\t
offset = [e.localX, e.localY];
\n\t
_this.svga.visible = false;
\n\t
_this.stage.once(engine.MouseEvent.MOUSE_UP, onUp, _this);
\n\t
_this.stage.addEventListener(engine.MouseEvent.MOUSE_MOVE, onMove, _this);
\n\t
};
\n\t
_this.guideEle.addEventListener(engine.MouseEvent.MOUSE_DOWN, ondown, _this);
\n\t
})];
\n\t
});
\n\t
});
\n\t
};
\n\t
return GuideView;
\n\t
}(engine.Sprite));
\n\t
//# sourceMappingURL=guideView.js.map
\n\n\t
var RightTips = (function (_super) {
\n\t
tslib.__extends(RightTips, _super);
\n\t
function RightTips() {
\n\t
var _this = _super.call(this) || this;
\n\t
_this.SCORE = props.onceScore || 2;
\n\t
_this.img = new engine.Image();
\n\t
_this.img.texture = getTextureByName('rightTips');
\n\t
_this.addChild(_this.img);
\n\t
_this.img.anchorX = 88 / 2;
\n\t
_this.img.anchorY = 85 / 2;
\n\t
_this.visible = false;
\n\t
_this.txt = new engine.TextField();
\n\t
_this.addChild(_this.txt);
\n\t
_this.txt.text = '+' + _this.SCORE;
\n\t
_this.txt.size = 60;
\n\t
_this.txt.fillColor = '#437726';
\n\t
engine.playSound;
\n\t
return _this;
\n\t
}
\n\t
RightTips.prototype.play = function (rect) {
\n\t
this.visible = true;
\n\t
this.txt.x = 100;
\n\t
engine.Tween.get(this.txt).set({ y: 60, alpha: 1 })
\n\t
.to({ y: -50 }, 500)
\n\t
.to({ alpha: 0 });
\n\t
engine.Tween.get(this.img).set({ x: 0, y: 0, scaleX: 0, scaleY: 0, alpha: 1 })
\n\t
.to({ scaleX: 1, scaleY: 1 }, 200, engine.Ease.getBackOut(1))
\n\t
.wait(200)
\n\t
.to({ alpha: 0 }, 300);
\n\t
this.x = rect.x + 180;
\n\t
this.y = rect.y;
\n\t
};
\n\t
return RightTips;
\n\t
}(engine.Sprite));
\n\t
//# sourceMappingURL=RightTips.js.map
\n\n\t
var GameView = (function (_super) {
\n\t
tslib.__extends(GameView, _super);
\n\t
function GameView() {
\n\t
var _this = _super.call(this) || this;
\n\t
_this._timeCounter = 0;
\n\t
_this.once(engine.Event.ADDED_TO_STAGE, _this.setup, _this);
\n\t
return _this;
\n\t
}
\n\t
GameView.prototype.configUI = function () {
\n\t
var uiMap = {};
\n\t
this.uiMap = uiMap;
\n\t
var config = uiConfig();
\n\t
for (var _i = 0, config_1 = config; _i < config_1.length; _i++) {
\n\t
var item = config_1[_i];
\n\t
var id = item.id, texture = item.texture, pos = item.pos, anchor = item.anchor;
\n\t
var sp = new engine.Sprite(getTextureByName(texture));
\n\t
this.addChild(sp);
\n\t
uiMap[id] = sp;
\n\t
if (anchor) {
\n\t
sp.anchorX = anchor[0];
\n\t
sp.anchorY = anchor[1];
\n\t
}
\n\t
if (pos) {
\n\t
sp.x = pos[0];
\n\t
sp.y = pos[1];
\n\t
if (anchor) {
\n\t
sp.x = pos[0] - sp.anchorX;
\n\t
sp.y = pos[1] - sp.anchorY;
\n\t
}
\n\t
}
\n\t
}
\n\t
this.configConveyors();
\n\t
this.createRects();
\n\t
this.countdown = new CountDownGroup();
\n\t
this.addChild(this.countdown);
\n\t
this.guide = new GuideView();
\n\t
this.addChild(this.guide);
\n\t
this.wrongTips = new WrongTips();
\n\t
this.rightTips = new RightTips();
\n\t
this.addChild(this.wrongTips);
\n\t
this.addChild(this.rightTips);
\n\t
};
\n\t
GameView.prototype.createRects = function () {
\n\t
this.wetWaste = this.createRect(74, 552, 301, 293, 0xffffff);
\n\t
this.harmfulWaste = this.createRect(75, 247, 300, 293, 0xff0000);
\n\t
this.dryWaste = this.createRect(389, 249, 286, 291, 0x000000);
\n\t
this.recoverableWaste = this.createRect(389, 551, 287, 292, 0x0000ff);
\n\t
};
\n\t
GameView.prototype.createRect = function (x, y, w, h, c) {
\n\t
var rect = new engine.Rectangle(x, y, w, h);
\n\t
var sp = new engine.Sprite();
\n\t
this.addChild(sp);
\n\t
sp.x = x;
\n\t
sp.y = y;
\n\t
var g = new engine.Graphics;
\n\t
g.alpha = 0.0;
\n\t
g.beginFill(c);
\n\t
g.drawRect(0, 0, w, h);
\n\t
g.endFill();
\n\t
sp.addChild(g);
\n\t
return rect;
\n\t
};
\n\t
GameView.prototype.configConveyors = function () {
\n\t
var conveyor0 = new Conveyor();
\n\t
var conveyor1 = new Conveyor();
\n\t
this.addChild(conveyor0);
\n\t
this.addChild(conveyor1);
\n\t
conveyor0.x = 0;
\n\t
conveyor1.x = 764;
\n\t
this.conveyors = new Conveyors(this);
\n\t
this.conveyors.initData(conveyor0, conveyor1);
\n\t
};
\n\t
GameView.prototype.playAni = function () {
\n\t
var _this = this;
\n\t
var idlerWheels = ['idler0', 'idler1', 'idler2', 'idler3', 'idler4', 'idler5', 'idler6'];
\n\t
idlerWheels = idlerWheels.map(function (i) { return _this.uiMap[i]; });
\n\t
idlerWheels.forEach(function (i) {
\n\t
engine.Tween.get(i, { loop: true }).to({ rotation: -360 }, 1000);
\n\t
});
\n\t
};
\n\t
GameView.prototype.stopAni = function () {
\n\t
var _this = this;
\n\t
var idlerWheels = ['idler0', 'idler1', 'idler2', 'idler3', 'idler4', 'idler5', 'idler6'];
\n\t
idlerWheels = idlerWheels.map(function (i) { return _this.uiMap[i]; });
\n\t
idlerWheels.forEach(function (i) {
\n\t
engine.Tween.removeTweens(i);
\n\t
});
\n\t
};
\n\t
GameView.prototype.start = function () {
\n\t
return tslib.__awaiter(this, void 0, void 0, function () {
\n\t
var _this = this;
\n\t
return tslib.__generator(this, function (_a) {
\n\t
switch (_a.label) {
\n\t
case 0:
\n\t
console.log('on start');
\n\t
this._timeCounter = 0;
\n\t
if (!!getGuideInfo()) return [3, 2];
\n\t
return [4, this.guide.startGuide()];
\n\t
case 1:
\n\t
_a.sent();
\n\t
setGuide();
\n\t
_a.label = 2;
\n\t
case 2:
\n\t
this.conveyors.clear();
\n\t
return [4, this.countdown.startCountDown()];
\n\t
case 3:
\n\t
_a.sent();
\n\t
this.startGame();
\n\t
engine.globalEvent.dispatchEvent('recycling-time-update', {
\n\t
second: this.getSecond(),
\n\t
});
\n\t
this._timer = setInterval(function () {
\n\t
_this.onTimer();
\n\t
}, 1000);
\n\t
return [2];
\n\t
}
\n\t
});
\n\t
});
\n\t
};
\n\t
GameView.prototype.startGame = function () {
\n\t
this.playAni();
\n\t
this.conveyors.startConveyors();
\n\t
};
\n\t
GameView.prototype.stopGame = function () {
\n\t
this.stopAni();
\n\t
};
\n\t
GameView.prototype.getSecond = function () {
\n\t
return props.time - this._timeCounter;
\n\t
};
\n\t
GameView.prototype.onTimer = function () {
\n\t
this._timeCounter++;
\n\t
engine.globalEvent.dispatchEvent('recycling-time-update', {
\n\t
second: this.getSecond(),
\n\t
});
\n\t
if (this.getSecond() == 0) {
\n\t
this.stop();
\n\t
this.conveyors.timeout();
\n\t
}
\n\t
};
\n\t
GameView.prototype.stop = function () {
\n\t
clearInterval(this._timer);
\n\t
this.stopGame();
\n\t
};
\n\t
GameView.prototype.setup = function () {
\n\t
console.log('onSteup', props);
\n\t
this.configUI();
\n\t
};
\n\t
GameView.prototype.onDown = function (e) {
\n\t
};
\n\t
GameView.prototype.stageOnUp = function (e) {
\n\t
};
\n\t
GameView.prototype.onSuccess = function () {
\n\t
};
\n\t
GameView.prototype.onMove = function (e) {
\n\t
};
\n\t
return GameView;
\n\t
}(engine.Container));
\n\t
//# sourceMappingURL=GameView.js.map
\n\n\t
var GameWrapper = (function (_super) {
\n\t
tslib.__extends(GameWrapper, _super);
\n\t
function GameWrapper() {
\n\t
var _this = _super.call(this) || this;
\n\t
engine.globalEvent.addEventListener('recycling-start', _this.start, _this);
\n\t
engine.globalEvent.addEventListener('recycling-stop', _this.stop, _this);
\n\t
var gameView = _this._gameView = new GameView();
\n\t
_this.addChild(gameView);
\n\t
return _this;
\n\t
}
\n\t
GameWrapper.prototype.start = function (event) {
\n\t
injectProps(event.data);
\n\t
this._gameView.start();
\n\t
};
\n\t
GameWrapper.prototype.stop = function (event) {
\n\t
this._gameView.stop();
\n\t
};
\n\t
return GameWrapper;
\n\t
}(engine.Container));
\n\t
//# sourceMappingURL=GameWrapper.js.map
\n\n\t
function index (props) {
\n\t
prepareProps();
\n\t
injectProps(props);
\n\t
var instance = new GameWrapper();
\n\t
return instance;
\n\t
}
\n\t
//# sourceMappingURL=index.js.map
\n\n\t
return index;
\n\n
})))
;
\n
"
}
src/custom/recycling/debug/app.js
View file @
5e341b08
...
...
@@ -46,7 +46,7 @@ function launchWithCustomModule(customModule) {
},
100
);
setTimeout
(()
=>
{
engine
.
globalEvent
.
dispatchEvent
(
'recycling-start'
,
{
time
:
200
,
maxScore
:
222
});
engine
.
globalEvent
.
dispatchEvent
(
'recycling-start'
,
{
time
:
200
,
maxScore
:
222
,
speed
:
3
});
const
d
=
engine
.
gameStage
.
sceneContainer
.
getChildAt
(
0
);
},
200
);
...
...
src/custom/recycling/debug/main.js
View file @
5e341b08
"use strict"
;
var
tslib
=
require
(
"tslib"
);
function
getTexture
(
e
){
return
engine
.
Texture
.
from
(
getAssetByUUID
(
e
).
uuid
)}
function
getTextureByName
(
e
){
return
getTexture
(
engine
.
getAssetByName
(
e
).
uuid
)}
function
createSvga
(
e
,
t
){
var
i
=
new
svga
.
Svga
;
return
i
.
source
=
"asset://"
+
engine
.
getAssetByName
(
e
).
uuid
,
i
}
var
props
=
{};
function
prepareProps
(){
var
e
=
getProps
();
engine
.
injectProp
(
props
,
e
)}
function
injectProps
(
e
){
engine
.
injectProp
(
props
,
e
)}
var
GarbageTypes
,
Conveyor
=
function
(
i
){
function
e
(){
var
e
=
i
.
call
(
this
)
||
this
;
e
.
y
=
904.21
;
var
t
=
new
engine
.
Sprite
(
getTextureByName
(
"conveyor"
));
return
e
.
addChild
(
t
),
e
.
idx0
=
e
.
createItem
(
75
,
50
),
e
.
idx1
=
e
.
createItem
(
225
,
50
),
e
.
idx2
=
e
.
createItem
(
375
,
50
),
e
.
idx3
=
e
.
createItem
(
525
,
50
),
e
.
idx4
=
e
.
createItem
(
675
,
50
),
e
}
return
tslib
.
__extends
(
e
,
i
),
e
.
prototype
.
clear
=
function
(){
this
.
clearItem
(
this
.
idx0
),
this
.
clearItem
(
this
.
idx1
),
this
.
clearItem
(
this
.
idx2
),
this
.
clearItem
(
this
.
idx3
),
this
.
clearItem
(
this
.
idx4
)},
e
.
prototype
.
clearItem
=
function
(
e
){
0
<
e
.
children
.
length
&&
e
.
removeChildAt
(
0
)},
e
.
prototype
.
createItem
=
function
(
e
,
t
){
var
i
=
new
engine
.
Sprite
;
return
this
.
addChild
(
i
),
i
.
x
=
e
,
i
.
y
=
t
,
i
},
e
}(
engine
.
Sprite
);
!
function
(
e
){
e
.
recoverableWaste
=
"recoverableWaste"
,
e
.
harmfulWaste
=
"harmfulWaste"
,
e
.
wetWaste
=
"wetWaste"
,
e
.
dryWaste
=
"dryWaste"
}(
GarbageTypes
=
GarbageTypes
||
{});
var
GarbageConfig
=
function
(){
function
e
(){}
return
e
.
config
=
[{
name
:
"电池"
,
source
:
"g00"
,
type
:
GarbageTypes
.
harmfulWaste
,
width
:
51
,
height
:
123
},{
name
:
"温度计"
,
source
:
"g01"
,
type
:
GarbageTypes
.
harmfulWaste
,
width
:
65
,
height
:
130
},{
name
:
"鱼刺"
,
source
:
"g02"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
104
,
height
:
82
},{
name
:
"龙虾"
,
source
:
"g03"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
129
,
height
:
122
},{
name
:
"西瓜"
,
source
:
"g04"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
134
,
height
:
111
},{
name
:
"旧玩具"
,
source
:
"g05"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
72
,
height
:
135
},{
name
:
"口红"
,
source
:
"g06"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
49
,
height
:
134
},{
name
:
"面包"
,
source
:
"g07"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
96
,
height
:
128
},{
name
:
"绿植"
,
source
:
"g08"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
81
,
height
:
131
},{
name
:
"保温瓶"
,
source
:
"g09"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
66
,
height
:
137
},{
name
:
"破衣服"
,
source
:
"g10"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
91
,
height
:
121
},{
name
:
"茶叶渣"
,
source
:
"g11"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
108
,
height
:
125
},{
name
:
"湿巾"
,
source
:
"g12"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
106
,
height
:
109
},{
name
:
"过期药膏"
,
source
:
"g13"
,
type
:
GarbageTypes
.
harmfulWaste
,
width
:
107
,
height
:
130
},{
name
:
"用完的洗发水瓶"
,
source
:
"g14"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
153
,
height
:
148
},{
name
:
"婴儿纸尿裤"
,
source
:
"g15"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
108
,
height
:
123
},{
name
:
"香水瓶"
,
source
:
"g16"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
65
,
height
:
127
},{
name
:
"花甲壳"
,
source
:
"g17"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
99
,
height
:
115
},{
name
:
"过期调味料"
,
source
:
"g18"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
109
,
height
:
130
},{
name
:
"地毯"
,
source
:
"g19"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
145
,
height
:
119
},{
name
:
"甘蔗渣"
,
source
:
"g20"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
100
,
height
:
116
},{
name
:
"玻璃渣"
,
source
:
"g21"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
95
,
height
:
122
},{
name
:
"番茄酱"
,
source
:
"g22"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
82
,
height
:
125
},{
name
:
"酒精棉"
,
source
:
"g23"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
64
,
height
:
124
},{
name
:
"指甲油瓶子"
,
source
:
"g24"
,
type
:
GarbageTypes
.
harmfulWaste
,
width
:
109
,
height
:
125
},{
name
:
"肉骨头"
,
source
:
"g25"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
67
,
height
:
123
},{
name
:
"嚼过的口香糖"
,
source
:
"g26"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
135
,
height
:
116
},{
name
:
"充电插头"
,
source
:
"g27"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
86
,
height
:
128
},{
name
:
"旧报纸"
,
source
:
"g28"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
68
,
height
:
124
},{
name
:
"烟头"
,
source
:
"g29"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
108
,
height
:
145
},{
name
:
"奶茶塑料杯"
,
source
:
"g30"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
109
,
height
:
143
},{
name
:
"瓜子壳"
,
source
:
"g31"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
87
,
height
:
121
},{
name
:
"橘子皮"
,
source
:
"g32"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
78
,
height
:
120
},{
name
:
"气球"
,
source
:
"g33"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
78
,
height
:
121
},{
name
:
"树叶"
,
source
:
"g34"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
75
,
height
:
117
},{
name
:
"感冒药"
,
source
:
"g35"
,
type
:
GarbageTypes
.
harmfulWaste
,
width
:
92
,
height
:
121
},{
name
:
"电话机"
,
source
:
"g36"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
63
,
height
:
121
},{
name
:
"奶酪"
,
source
:
"g37"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
90
,
height
:
116
},{
name
:
"啤酒瓶"
,
source
:
"g38"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
64
,
height
:
123
},{
name
:
"薯片包装"
,
source
:
"g39"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
134
,
height
:
123
},{
name
:
"过期保健品"
,
source
:
"g40"
,
type
:
GarbageTypes
.
harmfulWaste
,
width
:
108
,
height
:
125
},{
name
:
"雪糕包装袋"
,
source
:
"g41"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
109
,
height
:
128
},{
name
:
"废油漆"
,
source
:
"g42"
,
type
:
GarbageTypes
.
harmfulWaste
,
width
:
98
,
height
:
122
},{
name
:
"食品罐头"
,
source
:
"g43"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
94
,
height
:
117
},{
name
:
"陶瓷碗"
,
source
:
"g44"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
105
,
height
:
122
},{
name
:
"蚊香"
,
source
:
"g45"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
69
,
height
:
146
},{
name
:
"电脑机箱"
,
source
:
"g46"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
84
,
height
:
124
},{
name
:
"鲜花"
,
source
:
"g47"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
62
,
height
:
122
},{
name
:
"宠物粮食"
,
source
:
"g48"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
87
,
height
:
121
},{
name
:
"银行卡"
,
source
:
"g49"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
115
,
height
:
123
}],
e
}(),
transStores
=
function
(
e
){
var
a
=
[];
e
.
forEach
(
function
(
e
){
!
function
(
e
){
for
(
var
t
=
0
,
i
=
a
;
t
<
i
.
length
;
t
++
){
var
r
=
i
[
t
];
if
(
e
.
targetType
==
r
.
targetType
&&
e
.
itemType
==
r
.
itemType
&&
e
.
itemName
==
r
.
itemName
)
return
!
0
}
return
!
1
}(
e
)
&&
a
.
push
(
e
)}),
e
=
a
,
a
=
[];
var
n
=
[];
return
e
.
forEach
(
function
(
e
){
!
function
(
e
){
for
(
var
t
=
0
,
i
=
a
;
t
<
i
.
length
;
t
++
){
var
r
=
i
[
t
];
if
(
e
.
itemName
==
r
.
itemName
)
return
n
.
push
(
r
.
itemName
),
!
0
}
return
!
1
}(
e
)
&&
a
.
push
(
e
)}),(
e
=
a
).
forEach
(
function
(
e
){
-
1
!=
n
.
indexOf
(
e
.
itemName
)
&&
(
e
.
targetType
=
e
.
itemType
)}),
e
.
map
(
function
(
e
){
return
{
targetName
:
getTargetName
(
e
.
targetType
),
isCorrect
:
e
.
targetType
==
e
.
itemType
,
itemName
:
e
.
itemName
}})},
getTargetName
=
function
(
e
){
switch
(
e
){
case
GarbageTypes
.
recoverableWaste
:
return
"可回收物"
;
case
GarbageTypes
.
harmfulWaste
:
return
"有害垃圾"
;
case
GarbageTypes
.
wetWaste
:
return
"湿垃圾"
;
case
GarbageTypes
.
dryWaste
:
return
"其他垃圾"
}},
checkHit
=
function
(
e
,
t
){
var
i
=
e
.
x
,
r
=
e
.
y
,
a
=
e
.
texture
,
n
=
a
.
width
,
s
=
a
.
height
;
return
i
>
t
.
x
&&
r
>
t
.
y
&&
i
+
n
<
t
.
x
+
t
.
width
&&
r
+
s
<
t
.
y
+
t
.
height
},
removeChild
=
function
(
e
){
e
&&
e
.
parent
&&
e
.
parent
.
removeChild
(
e
)},
removeEle
=
function
(
e
,
t
){
var
i
=
t
.
indexOf
(
e
);
0
<=
i
&&
t
.
splice
(
i
,
1
)},
shuffle
=
function
(
e
){
for
(
var
t
,
i
=
e
.
length
;
i
;){
var
r
=
Math
.
floor
(
Math
.
random
()
*
i
--
);
t
=
[
e
[
i
],
e
[
r
]],
e
[
r
]
=
t
[
0
],
e
[
i
]
=
t
[
1
]}
return
e
},
WrongTips
=
function
(
t
){
function
e
(){
var
e
=
t
.
call
(
this
)
||
this
;
return
e
.
img
=
new
engine
.
Image
,
e
.
img
.
texture
=
getTextureByName
(
"wrongTips"
),
e
.
addChild
(
e
.
img
),
e
.
img
.
anchorX
=
44
,
e
.
img
.
anchorY
=
42.5
,
e
.
visible
=!
1
,
e
}
return
tslib
.
__extends
(
e
,
t
),
e
.
prototype
.
play
=
function
(
e
){
this
.
visible
=!
0
;
engine
.
Tween
.
get
(
this
.
img
).
set
({
x
:
0
,
y
:
0
,
scaleX
:
1
,
scaleY
:
1
,
alpha
:
1
}).
to
({
x
:
20
},
70
).
to
({
x
:
0
},
70
).
to
({
x
:
-
20
},
70
).
to
({
x
:
0
},
70
).
wait
(
200
).
to
({
alpha
:
0
},
300
),
this
.
x
=
e
.
x
+
180
,
this
.
y
=
e
.
y
},
e
}(
engine
.
Sprite
),
getTargetRect
=
function
(
e
,
t
){
switch
(
e
){
case
GarbageTypes
.
dryWaste
:
return
t
.
dryWaste
;
case
GarbageTypes
.
wetWaste
:
return
t
.
wetWaste
;
case
GarbageTypes
.
harmfulWaste
:
return
t
.
harmfulWaste
;
case
GarbageTypes
.
recoverableWaste
:
return
t
.
recoverableWaste
}},
Conveyors
=
function
(
i
){
function
e
(
e
){
var
t
=
i
.
call
(
this
)
||
this
;
return
t
.
conveyorsPool
=
[],
t
.
GarbageConfig
=
GarbageConfig
.
config
,
t
.
datas
=
[],
t
.
wrapper
=
e
,
t
}
return
tslib
.
__extends
(
e
,
i
),
e
.
prototype
.
initData
=
function
(
e
,
t
){
this
.
conveyor0
=
e
,
this
.
conveyor1
=
t
},
e
.
prototype
.
setDefault
=
function
(){
this
.
score
=
0
,
this
.
conveyorsPool
.
push
(
this
.
conveyor0
),
this
.
conveyorsPool
.
push
(
this
.
conveyor1
);
for
(
var
e
=
shuffle
(
this
.
GarbageConfig
.
concat
([])),
t
=
0
;
t
<
GarbageConfig
.
config
.
length
;
t
++
)
e
[
t
].
idx
=
t
,
e
[
t
].
isRight
=!
1
,
e
[
t
].
isMistake
=!
1
,
e
[
t
].
isOnStage
=!
1
,
this
.
datas
.
push
(
e
[
t
]);
for
(
t
=
0
;
t
<
5
;
t
++
){
var
i
=
this
.
datas
[
t
],
r
=
new
engine
.
Sprite
(
getTextureByName
(
i
.
source
));
r
.
isWrong
=!
1
,
r
.
isRight
=!
1
,
i
.
isOnStage
=!
0
,
r
.
type
=
i
.
type
,
r
.
name
=
i
.
name
,
r
.
anchorX
=
i
.
width
/
2
,
r
.
anchorY
=
i
.
height
,
r
.
x
=-
i
.
width
/
2
,
r
.
y
=
40
-
i
.
height
,
this
.
conveyor1
[
"idx"
+
t
].
addChild
(
r
),
r
.
addEventListener
(
engine
.
MouseEvent
.
MOUSE_DOWN
,
this
.
onDown_garbage
,
this
)}},
e
.
prototype
.
startConveyors
=
function
(){
this
.
setDefault
(),
engine
.
gameStage
.
addEventListener
(
engine
.
Event
.
ENTER_FRAME
,
this
.
onEnterFrame
,
this
)},
e
.
prototype
.
onEnterFrame
=
function
(
e
,
t
,
i
){
if
(
this
.
score
==
(
props
.
maxScore
||
100
)
&&
(
this
.
gameOver
(),
this
.
wrapper
.
stop
()),
this
.
conveyorsPool
.
forEach
(
function
(
e
){
e
.
x
-=
props
.
speed
||
3
}),
this
.
conveyorsPool
[
this
.
conveyorsPool
.
length
-
1
].
x
<=
764
){
var
r
=
new
Conveyor
;
r
.
x
=
this
.
conveyorsPool
[
this
.
conveyorsPool
.
length
-
1
].
x
+
764
,
this
.
wrapper
.
addChild
(
r
),
this
.
conveyorsPool
.
push
(
r
)}
else
{
for
(
var
a
=
[],
n
=
0
;
n
<
this
.
datas
.
length
;
n
++
){(
u
=
this
.
datas
[
n
]).
isRight
||
u
.
isOnStage
||
a
.
push
(
u
)}
for
(
var
s
=
this
.
conveyorsPool
[
this
.
conveyorsPool
.
length
-
1
],
o
=
0
;
o
<
5
;
o
++
)
if
(
!
s
[
"idx"
+
o
].
children
[
0
]){
var
h
=
a
.
shift
();
if
(
!
h
)
break
;
h
.
isOnStage
=!
0
;
var
g
=
new
engine
.
Sprite
(
getTextureByName
(
h
.
source
));
g
.
isWrong
=!
1
,
g
.
isRight
=!
1
,
g
.
type
=
h
.
type
,
g
.
name
=
h
.
name
,
g
.
anchorX
=
h
.
width
/
2
,
g
.
anchorY
=
h
.
height
,
g
.
x
=-
h
.
width
/
2
,
g
.
y
=
40
-
h
.
height
,
s
[
"idx"
+
o
].
addChild
(
g
),
g
.
addEventListener
(
engine
.
MouseEvent
.
MOUSE_DOWN
,
this
.
onDown_garbage
,
this
)}}
if
(
this
.
conveyorsPool
[
0
].
x
<-
750
){
for
(
var
c
=
0
;
c
<
this
.
datas
.
length
;
c
++
){
var
u
=
this
.
datas
[
c
],
l
=
this
.
conveyorsPool
[
0
].
idx4
;
if
(
l
.
children
[
0
]
&&
u
.
name
==
l
.
children
[
0
].
name
){
u
.
isOnStage
=!
1
,
removeEle
(
u
,
this
.
datas
),
this
.
datas
.
push
(
u
),
l
.
removeChild
(
l
.
children
[
0
]);
break
}}
this
.
conveyorsPool
.
shift
()}
else
if
(
this
.
conveyorsPool
[
0
].
x
<-
600
)
for
(
c
=
0
;
c
<
this
.
datas
.
length
;
c
++
){
u
=
this
.
datas
[
c
];
var
p
=
this
.
conveyorsPool
[
0
].
idx3
;
if
(
p
.
children
[
0
]
&&
u
.
name
==
p
.
children
[
0
].
name
){
u
.
isOnStage
=!
1
,
removeEle
(
u
,
this
.
datas
),
this
.
datas
.
push
(
u
),
p
.
removeChild
(
p
.
children
[
0
]);
break
}}
else
if
(
this
.
conveyorsPool
[
0
].
x
<-
450
)
for
(
c
=
0
;
c
<
this
.
datas
.
length
;
c
++
){
u
=
this
.
datas
[
c
];
var
d
=
this
.
conveyorsPool
[
0
].
idx2
;
if
(
d
.
children
[
0
]
&&
u
.
name
==
d
.
children
[
0
].
name
){
u
.
isOnStage
=!
1
,
removeEle
(
u
,
this
.
datas
),
this
.
datas
.
push
(
u
),
d
.
removeChild
(
d
.
children
[
0
]);
break
}}
else
if
(
this
.
conveyorsPool
[
0
].
x
<-
300
)
for
(
c
=
0
;
c
<
this
.
datas
.
length
;
c
++
){
u
=
this
.
datas
[
c
];
var
y
=
this
.
conveyorsPool
[
0
].
idx1
;
if
(
y
.
children
[
0
]
&&
u
.
name
==
y
.
children
[
0
].
name
){
u
.
isOnStage
=!
1
,
removeEle
(
u
,
this
.
datas
),
this
.
datas
.
push
(
u
),
y
.
removeChild
(
y
.
children
[
0
]);
break
}}
else
if
(
this
.
conveyorsPool
[
0
].
x
<-
150
)
for
(
c
=
0
;
c
<
this
.
datas
.
length
;
c
++
){
u
=
this
.
datas
[
c
];
var
m
=
this
.
conveyorsPool
[
0
].
idx0
;
if
(
m
.
children
[
0
]
&&
u
.
name
==
m
.
children
[
0
].
name
){
u
.
isOnStage
=!
1
,
removeEle
(
u
,
this
.
datas
),
this
.
datas
.
push
(
u
),
m
.
removeChild
(
m
.
children
[
0
]);
break
}}},
e
.
prototype
.
addscore
=
function
(){
this
.
score
+=
props
.
onceScore
||
2
,
engine
.
globalEvent
.
dispatchEvent
(
"recycling-score-update"
,{
score
:
this
.
score
})},
e
.
prototype
.
gameOver
=
function
(){
engine
.
gameStage
.
removeEventListener
(
engine
.
Event
.
ENTER_FRAME
,
this
.
onEnterFrame
,
this
),
engine
.
globalEvent
.
dispatchEvent
(
"recycling-game-end"
,
transStores
(
this
.
stores
))},
e
.
prototype
.
onDown_garbage
=
function
(
e
){
this
.
_currentDragView
&&
removeChild
(
this
.
_currentDragView
);
var
t
=
e
.
target
,
i
=
new
engine
.
Sprite
(
t
.
texture
);
this
.
_currentDragView
=
i
,(
this
.
_currentTarget
=
t
).
scaleX
=
t
.
scaleY
=
0
,
this
.
wrapper
.
addChild
(
i
),
i
.
x
=
e
.
stageX
-
t
.
texture
.
width
/
2
,
i
.
y
=
e
.
stageY
-
t
.
texture
.
height
/
2
,
i
.
type
=
t
.
type
,
i
.
name
=
t
.
name
,
this
.
wrapper
.
addEventListener
(
engine
.
MouseEvent
.
MOUSE_UP
,
this
.
onStageMouseUp
,
this
),
this
.
wrapper
.
addEventListener
(
engine
.
MouseEvent
.
MOUSE_MOVE
,
this
.
onStageMouseMove
,
this
)},
e
.
prototype
.
onStageMouseMove
=
function
(
e
){
var
t
=
this
.
_currentDragView
;
t
.
x
=
e
.
stageX
-
t
.
texture
.
width
/
2
,
t
.
y
=
e
.
stageY
-
t
.
texture
.
height
/
2
},
e
.
prototype
.
onStageMouseUp
=
function
(
e
){
var
t
=
this
;
if
(
this
.
wrapper
.
removeEventListener
(
engine
.
MouseEvent
.
MOUSE_UP
,
this
.
onStageMouseUp
,
this
),
this
.
wrapper
.
removeEventListener
(
engine
.
MouseEvent
.
MOUSE_MOVE
,
this
.
onStageMouseMove
,
this
),
this
.
_currentDragView
){
var
i
=
this
.
checkHitRect
();
i
?(
i
==
this
.
_currentDragView
.
type
?(
this
.
addscore
(),
this
.
wrapper
.
rightTips
.
play
(
getTargetRect
(
i
,
this
.
wrapper
))):(
engine
.
Tween
.
get
(
this
.
_currentTarget
).
to
({
scaleX
:
1
,
scaleY
:
1
},
300
).
call
(
function
(){}),
this
.
wrapper
.
wrongTips
.
play
(
getTargetRect
(
i
,
this
.
wrapper
))),
this
.
stores
.
push
({
targetType
:
i
,
itemType
:
this
.
_currentDragView
.
type
,
itemName
:
this
.
_currentDragView
.
name
})):
engine
.
Tween
.
get
(
this
.
_currentTarget
).
to
({
scaleX
:
1
,
scaleY
:
1
},
300
).
call
(
function
(){}),
this
.
_currentDragView
.
anchorX
=
this
.
_currentDragView
.
texture
.
width
/
2
,
this
.
_currentDragView
.
anchorY
=
this
.
_currentDragView
.
texture
.
height
/
2
,
engine
.
Tween
.
get
(
this
.
_currentDragView
).
to
({
scaleX
:
0
,
scaleY
:
0
},
300
).
call
(
function
(){
removeChild
(
t
.
_currentDragView
)})}},
e
.
prototype
.
clear
=
function
(){
this
.
conveyor0
.
x
=
0
,
this
.
conveyor1
.
x
=
764
,
this
.
conveyorsPool
.
forEach
(
function
(
e
){
e
.
clear
()}),
this
.
conveyorsPool
=
[],
this
.
datas
=
[],
this
.
stores
=
[]},
e
.
prototype
.
timeout
=
function
(){
this
.
_currentDragView
&&
removeChild
(
this
.
_currentDragView
),
this
.
wrapper
.
removeEventListener
(
engine
.
MouseEvent
.
MOUSE_UP
,
this
.
onStageMouseUp
,
this
),
this
.
wrapper
.
removeEventListener
(
engine
.
MouseEvent
.
MOUSE_MOVE
,
this
.
onStageMouseMove
,
this
),
this
.
gameOver
()},
e
.
prototype
.
checkHitRect
=
function
(){
return
checkHit
(
this
.
_currentDragView
,
this
.
wrapper
.
wetWaste
)?
GarbageTypes
.
wetWaste
:
checkHit
(
this
.
_currentDragView
,
this
.
wrapper
.
harmfulWaste
)?
GarbageTypes
.
harmfulWaste
:
checkHit
(
this
.
_currentDragView
,
this
.
wrapper
.
dryWaste
)?
GarbageTypes
.
dryWaste
:
checkHit
(
this
.
_currentDragView
,
this
.
wrapper
.
recoverableWaste
)?
GarbageTypes
.
recoverableWaste
:
null
},
e
}(
engine
.
Sprite
),
uiConfig
=
function
(){
return
[{
id
:
"playBg"
,
texture
:
"playBg"
},{
id
:
"idler0"
,
texture
:
"idlerWheel"
,
pos
:[
75
,
1038
],
anchor
:[
20
,
21.5
]},{
id
:
"idler1"
,
texture
:
"idlerWheel"
,
pos
:[
175
,
1038
],
anchor
:[
20
,
21.5
]},{
id
:
"idler2"
,
texture
:
"idlerWheel"
,
pos
:[
275
,
1038
],
anchor
:[
20
,
21.5
]},{
id
:
"idler3"
,
texture
:
"idlerWheel"
,
pos
:[
375
,
1038
],
anchor
:[
20
,
21.5
]},{
id
:
"idler4"
,
texture
:
"idlerWheel"
,
pos
:[
475
,
1038
],
anchor
:[
20
,
21.5
]},{
id
:
"idler5"
,
texture
:
"idlerWheel"
,
pos
:[
575
,
1038
],
anchor
:[
20
,
21.5
]},{
id
:
"idler6"
,
texture
:
"idlerWheel"
,
pos
:[
675
,
1038
],
anchor
:[
20
,
21.5
]}]},
getGuideInfo
=
function
(){
return
window
.
localStorage
?
localStorage
.
getItem
(
"recyclingGuide"
):
0
},
setGuide
=
function
(){
window
.
localStorage
&&
localStorage
.
setItem
(
"recyclingGuide"
,
"1"
)},
createBg
=
function
(
e
){
void
0
===
e
&&
(
e
=
1
);
var
t
=
new
engine
.
Graphics
;
return
t
.
beginFill
(
0
),
t
.
drawRect
(
0
,
0
,
750
,
1624
),
t
.
endFill
(),
t
.
alpha
=
e
,
t
},
createImg
=
function
(
e
){
return
new
engine
.
Sprite
(
getTextureByName
(
e
))},
CountDownGroup
=
function
(
t
){
function
e
(){
var
e
=
t
.
call
(
this
)
||
this
;
return
e
.
addChild
(
createBg
(.
6
)),
e
.
num1
=
createImg
(
"num1"
),
e
.
num2
=
createImg
(
"num2"
),
e
.
num3
=
createImg
(
"num3"
),
e
.
go
=
createImg
(
"go"
),
e
.
go
.
anchorX
=
240
,
e
.
go
.
anchorY
=
171.5
,
e
.
num1
.
anchorX
=
125.5
,
e
.
num1
.
anchorY
=
189
,
e
.
num2
.
anchorX
=
149.5
,
e
.
num2
.
anchorY
=
191.5
,
e
.
num3
.
anchorX
=
148.5
,
e
.
num3
.
anchorY
=
191.5
,
e
.
go
.
x
=
135
,
e
.
go
.
y
=
353.5
,
e
.
num1
.
x
=
249.5
,
e
.
num1
.
y
=
340
,
e
.
num2
.
x
=
225.5
,
e
.
num2
.
y
=
334.5
,
e
.
num3
.
x
=
226.5
,
e
.
num3
.
y
=
333.5
,
e
.
addChild
(
e
.
num1
),
e
.
addChild
(
e
.
num2
),
e
.
addChild
(
e
.
num3
),
e
.
addChild
(
e
.
go
),
e
.
visible
=!
1
,
e
.
reset
(),
e
}
return
tslib
.
__extends
(
e
,
t
),
e
.
prototype
.
reset
=
function
(){
this
.
go
.
alpha
=
this
.
num1
.
alpha
=
this
.
num2
.
alpha
=
this
.
num3
.
alpha
=
0
,
this
.
go
.
scaleX
=
this
.
num1
.
scaleX
=
this
.
num2
.
scaleX
=
this
.
num3
.
scaleX
=
3
,
this
.
go
.
scaleY
=
this
.
num1
.
scaleY
=
this
.
num2
.
scaleY
=
this
.
num3
.
scaleY
=
3
},
e
.
prototype
.
startCountDown
=
function
(){
return
tslib
.
__awaiter
(
this
,
void
0
,
void
0
,
function
(){
var
t
=
this
;
return
tslib
.
__generator
(
this
,
function
(
e
){
return
[
2
,
new
Promise
(
function
(
e
){
t
.
reset
(),
t
.
visible
=!
0
,
t
.
num3
.
alpha
=
1
,
engine
.
Tween
.
get
(
t
.
num3
).
to
({
scaleX
:.
8
,
scaleY
:.
8
},
200
).
to
({
scaleX
:
1
,
scaleY
:
1
},
100
).
wait
(
500
).
to
({
scaleX
:
0
,
scaleY
:
0
},
200
).
call
(
function
(){
t
.
num2
.
alpha
=
1
,
engine
.
Tween
.
get
(
t
.
num2
).
to
({
scaleX
:.
8
,
scaleY
:.
8
},
200
).
to
({
scaleX
:
1
,
scaleY
:
1
},
100
).
wait
(
500
).
to
({
scaleX
:
0
,
scaleY
:
0
},
200
).
call
(
function
(){
t
.
num1
.
alpha
=
1
,
engine
.
Tween
.
get
(
t
.
num1
).
to
({
scaleX
:.
8
,
scaleY
:.
8
},
200
).
to
({
scaleX
:
1
,
scaleY
:
1
},
100
).
wait
(
500
).
to
({
scaleX
:
0
,
scaleY
:
0
},
200
).
call
(
function
(){
t
.
go
.
alpha
=
1
,
engine
.
Tween
.
get
(
t
.
go
).
to
({
scaleX
:.
8
,
scaleY
:.
8
},
200
).
to
({
scaleX
:
1
,
scaleY
:
1
},
100
).
wait
(
500
).
call
(
function
(){
t
.
visible
=!
1
,
e
()})})})})})]})})},
e
}(
engine
.
Sprite
),
GuideView
=
function
(
t
){
function
e
(){
var
e
=
t
.
call
(
this
)
||
this
;
return
e
.
initUI
(),
e
.
visible
=!
1
,
e
}
return
tslib
.
__extends
(
e
,
t
),
e
.
prototype
.
initUI
=
function
(){
this
.
addChild
(
createBg
(.
6
)),
this
.
guideBg
=
createImg
(
"guideBg"
),
this
.
addChild
(
this
.
guideBg
),
this
.
guideEle
=
createImg
(
"guideEle"
),
this
.
addChild
(
this
.
guideEle
),
this
.
guideBg
.
x
=
393
,
this
.
guideBg
.
y
=
552
,
this
.
guideEle
.
x
=
361
,
this
.
guideEle
.
y
=
877
,
this
.
guideEle
.
mouseEnabled
=
this
.
guideEle
.
mouseChildren
=!
0
;
var
e
=
createSvga
(
"guideTips"
);
this
.
svga
=
e
,
this
.
addChild
(
e
),
e
.
gotoAndStop
(
1
),
e
.
mouseEnabled
=
e
.
mouseChildren
=!
1
},
e
.
prototype
.
checkHit
=
function
(
e
,
t
,
i
,
r
){
var
a
=
new
engine
.
Rectangle
(
393
,
552
,
281
,
320
);
return
e
>
a
.
x
&&
t
>
a
.
y
&&
e
+
i
<
a
.
x
+
a
.
width
&&
t
+
r
<
a
.
y
+
a
.
height
},
e
.
prototype
.
startGuide
=
function
(){
return
tslib
.
__awaiter
(
this
,
void
0
,
void
0
,
function
(){
var
s
=
this
;
return
tslib
.
__generator
(
this
,
function
(
e
){
return
[
2
,
new
Promise
(
function
(
t
){
s
.
visible
=!
0
,
s
.
svga
.
gotoAndStop
(
1
),
s
.
svga
.
play
(
!
1
,
!
0
),
s
.
guideEle
.
scaleX
=
1
,
s
.
guideEle
.
scaleY
=
1
;
function
i
(
e
){
s
.
stage
.
removeEventListener
(
engine
.
MouseEvent
.
MOUSE_MOVE
,
a
,
s
),
s
.
checkHit
(
s
.
guideEle
.
x
,
s
.
guideEle
.
y
,
s
.
guideEle
.
width
,
s
.
guideEle
.
height
)?(
s
.
guideEle
.
removeEventListener
(
engine
.
MouseEvent
.
MOUSE_DOWN
,
n
,
s
),
engine
.
Tween
.
get
(
s
.
guideEle
).
to
({
scaleX
:
0
,
scaleY
:
0
},
300
).
call
(
function
(){
s
.
visible
=!
1
,
t
()})):(
s
.
svga
.
visible
=!
0
,
s
.
guideEle
.
x
=
361
,
s
.
guideEle
.
y
=
877
)}
var
r
=
[
0
,
0
],
a
=
function
(
e
){
s
.
guideEle
.
x
=
e
.
stageX
-
r
[
0
],
s
.
guideEle
.
y
=
e
.
stageY
-
r
[
1
]},
n
=
function
(
e
){
r
=
[
e
.
localX
,
e
.
localY
],
s
.
svga
.
visible
=!
1
,
s
.
stage
.
once
(
engine
.
MouseEvent
.
MOUSE_UP
,
i
,
s
),
s
.
stage
.
addEventListener
(
engine
.
MouseEvent
.
MOUSE_MOVE
,
a
,
s
)};
s
.
guideEle
.
addEventListener
(
engine
.
MouseEvent
.
MOUSE_DOWN
,
n
,
s
)})]})})},
e
}(
engine
.
Sprite
),
RightTips
=
function
(
t
){
function
e
(){
var
e
=
t
.
call
(
this
)
||
this
;
return
e
.
SCORE
=
props
.
onceScore
||
2
,
e
.
img
=
new
engine
.
Image
,
e
.
img
.
texture
=
getTextureByName
(
"rightTips"
),
e
.
addChild
(
e
.
img
),
e
.
img
.
anchorX
=
44
,
e
.
img
.
anchorY
=
42.5
,
e
.
visible
=!
1
,
e
.
txt
=
new
engine
.
TextField
,
e
.
addChild
(
e
.
txt
),
e
.
txt
.
text
=
"+"
+
e
.
SCORE
,
e
.
txt
.
size
=
60
,
e
.
txt
.
fillColor
=
"#437726"
,
engine
.
playSound
,
e
}
return
tslib
.
__extends
(
e
,
t
),
e
.
prototype
.
play
=
function
(
e
){
this
.
visible
=!
0
,
this
.
txt
.
x
=
100
,
engine
.
Tween
.
get
(
this
.
txt
).
set
({
y
:
60
,
alpha
:
1
}).
to
({
y
:
-
50
},
500
).
to
({
alpha
:
0
}),
engine
.
Tween
.
get
(
this
.
img
).
set
({
x
:
0
,
y
:
0
,
scaleX
:
0
,
scaleY
:
0
,
alpha
:
1
}).
to
({
scaleX
:
1
,
scaleY
:
1
},
200
,
engine
.
Ease
.
getBackOut
(
1
)).
wait
(
200
).
to
({
alpha
:
0
},
300
),
this
.
x
=
e
.
x
+
180
,
this
.
y
=
e
.
y
},
e
}(
engine
.
Sprite
),
GameView
=
function
(
t
){
function
e
(){
var
e
=
t
.
call
(
this
)
||
this
;
return
e
.
_timeCounter
=
0
,
e
.
once
(
engine
.
Event
.
ADDED_TO_STAGE
,
e
.
setup
,
e
),
e
}
return
tslib
.
__extends
(
e
,
t
),
e
.
prototype
.
configUI
=
function
(){
var
e
=
{};
this
.
uiMap
=
e
;
for
(
var
t
=
0
,
i
=
uiConfig
();
t
<
i
.
length
;
t
++
){
var
r
=
i
[
t
],
a
=
r
.
id
,
n
=
r
.
texture
,
s
=
r
.
pos
,
o
=
r
.
anchor
,
h
=
new
engine
.
Sprite
(
getTextureByName
(
n
));
this
.
addChild
(
h
),
e
[
a
]
=
h
,
o
&&
(
h
.
anchorX
=
o
[
0
],
h
.
anchorY
=
o
[
1
]),
s
&&
(
h
.
x
=
s
[
0
],
h
.
y
=
s
[
1
],
o
&&
(
h
.
x
=
s
[
0
]
-
h
.
anchorX
,
h
.
y
=
s
[
1
]
-
h
.
anchorY
))}
this
.
configConveyors
(),
this
.
createRects
(),
this
.
countdown
=
new
CountDownGroup
,
this
.
addChild
(
this
.
countdown
),
this
.
guide
=
new
GuideView
,
this
.
addChild
(
this
.
guide
),
this
.
wrongTips
=
new
WrongTips
,
this
.
rightTips
=
new
RightTips
,
this
.
addChild
(
this
.
wrongTips
),
this
.
addChild
(
this
.
rightTips
)},
e
.
prototype
.
createRects
=
function
(){
this
.
wetWaste
=
this
.
createRect
(
74
,
552
,
301
,
293
,
16777215
),
this
.
harmfulWaste
=
this
.
createRect
(
75
,
247
,
300
,
293
,
16711680
),
this
.
dryWaste
=
this
.
createRect
(
389
,
249
,
286
,
291
,
0
),
this
.
recoverableWaste
=
this
.
createRect
(
389
,
551
,
287
,
292
,
255
)},
e
.
prototype
.
createRect
=
function
(
e
,
t
,
i
,
r
,
a
){
var
n
=
new
engine
.
Rectangle
(
e
,
t
,
i
,
r
),
s
=
new
engine
.
Sprite
;
this
.
addChild
(
s
),
s
.
x
=
e
,
s
.
y
=
t
;
var
o
=
new
engine
.
Graphics
;
return
o
.
alpha
=
0
,
o
.
beginFill
(
a
),
o
.
drawRect
(
0
,
0
,
i
,
r
),
o
.
endFill
(),
s
.
addChild
(
o
),
n
},
e
.
prototype
.
configConveyors
=
function
(){
var
e
=
new
Conveyor
,
t
=
new
Conveyor
;
this
.
addChild
(
e
),
this
.
addChild
(
t
),
e
.
x
=
0
,
t
.
x
=
764
,
this
.
conveyors
=
new
Conveyors
(
this
),
this
.
conveyors
.
initData
(
e
,
t
)},
e
.
prototype
.
playAni
=
function
(){
var
t
=
this
,
e
=
[
"idler0"
,
"idler1"
,
"idler2"
,
"idler3"
,
"idler4"
,
"idler5"
,
"idler6"
];(
e
=
e
.
map
(
function
(
e
){
return
t
.
uiMap
[
e
]})).
forEach
(
function
(
e
){
engine
.
Tween
.
get
(
e
,{
loop
:
!
0
}).
to
({
rotation
:
-
360
},
1
e3
)})},
e
.
prototype
.
stopAni
=
function
(){
var
t
=
this
,
e
=
[
"idler0"
,
"idler1"
,
"idler2"
,
"idler3"
,
"idler4"
,
"idler5"
,
"idler6"
];(
e
=
e
.
map
(
function
(
e
){
return
t
.
uiMap
[
e
]})).
forEach
(
function
(
e
){
engine
.
Tween
.
removeTweens
(
e
)})},
e
.
prototype
.
start
=
function
(){
return
tslib
.
__awaiter
(
this
,
void
0
,
void
0
,
function
(){
var
t
=
this
;
return
tslib
.
__generator
(
this
,
function
(
e
){
switch
(
e
.
label
){
case
0
:
return
console
.
log
(
"on start"
),
this
.
_timeCounter
=
0
,
getGuideInfo
()?[
3
,
2
]:[
4
,
this
.
guide
.
startGuide
()];
case
1
:
e
.
sent
(),
setGuide
(),
e
.
label
=
2
;
case
2
:
return
this
.
conveyors
.
clear
(),[
4
,
this
.
countdown
.
startCountDown
()];
case
3
:
return
e
.
sent
(),
this
.
startGame
(),
engine
.
globalEvent
.
dispatchEvent
(
"recycling-time-update"
,{
second
:
this
.
getSecond
()}),
this
.
_timer
=
setInterval
(
function
(){
t
.
onTimer
()},
1
e3
),[
2
]}})})},
e
.
prototype
.
startGame
=
function
(){
this
.
playAni
(),
this
.
conveyors
.
startConveyors
()},
e
.
prototype
.
stopGame
=
function
(){
this
.
stopAni
()},
e
.
prototype
.
getSecond
=
function
(){
return
props
.
time
-
this
.
_timeCounter
},
e
.
prototype
.
onTimer
=
function
(){
this
.
_timeCounter
++
,
engine
.
globalEvent
.
dispatchEvent
(
"recycling-time-update"
,{
second
:
this
.
getSecond
()}),
0
==
this
.
getSecond
()
&&
(
this
.
stop
(),
this
.
conveyors
.
timeout
())},
e
.
prototype
.
stop
=
function
(){
clearInterval
(
this
.
_timer
),
this
.
stopGame
()},
e
.
prototype
.
setup
=
function
(){
console
.
log
(
"onSteup"
,
props
),
this
.
configUI
()},
e
.
prototype
.
onDown
=
function
(
e
){},
e
.
prototype
.
stageOnUp
=
function
(
e
){},
e
.
prototype
.
onSuccess
=
function
(){},
e
.
prototype
.
onMove
=
function
(
e
){},
e
}(
engine
.
Container
),
GameWrapper
=
function
(
i
){
function
e
(){
var
e
=
i
.
call
(
this
)
||
this
;
engine
.
globalEvent
.
addEventListener
(
"recycling-start"
,
e
.
start
,
e
),
engine
.
globalEvent
.
addEventListener
(
"recycling-stop"
,
e
.
stop
,
e
);
var
t
=
e
.
_gameView
=
new
GameView
;
return
e
.
addChild
(
t
),
e
}
return
tslib
.
__extends
(
e
,
i
),
e
.
prototype
.
start
=
function
(
e
){
injectProps
(
e
.
data
),
this
.
_gameView
.
start
()},
e
.
prototype
.
stop
=
function
(
e
){
this
.
_gameView
.
stop
()},
e
}(
engine
.
Container
);
function
index
(
e
){
return
prepareProps
(),
injectProps
(
e
),
new
GameWrapper
}
module
.
exports
=
index
;
(
function
(
global
,
factory
)
{
typeof
exports
===
'object'
&&
typeof
module
!==
'undefined'
?
module
.
exports
=
factory
(
require
(
'tslib'
))
:
typeof
define
===
'function'
&&
define
.
amd
?
define
([
'tslib'
],
factory
)
:
(
global
=
global
||
self
,
global
.
recycling
=
factory
(
global
.
tslib
));
}(
this
,
(
function
(
tslib
)
{
'use strict'
;
function
getTexture
(
uuid
)
{
return
engine
.
Texture
.
from
(
getAssetByUUID
(
uuid
).
uuid
);
}
function
getTextureByName
(
name
)
{
return
getTexture
(
engine
.
getAssetByName
(
name
).
uuid
);
}
function
createSvga
(
name
,
anchorName
)
{
var
inst
=
new
svga
.
Svga
();
inst
.
source
=
'asset://'
+
engine
.
getAssetByName
(
name
).
uuid
;
return
inst
;
}
//# sourceMappingURL=utils.js.map
var
props
=
{};
function
prepareProps
()
{
var
metaProps
=
getProps
();
engine
.
injectProp
(
props
,
metaProps
);
}
function
injectProps
(
p
)
{
engine
.
injectProp
(
props
,
p
);
}
//# sourceMappingURL=props.js.map
var
Conveyor
=
(
function
(
_super
)
{
tslib
.
__extends
(
Conveyor
,
_super
);
function
Conveyor
()
{
var
_this
=
_super
.
call
(
this
)
||
this
;
_this
.
y
=
904.21
;
var
sp
=
new
engine
.
Sprite
(
getTextureByName
(
'conveyor'
));
_this
.
addChild
(
sp
);
_this
.
idx0
=
_this
.
createItem
(
75
,
50
);
_this
.
idx1
=
_this
.
createItem
(
225
,
50
);
_this
.
idx2
=
_this
.
createItem
(
375
,
50
);
_this
.
idx3
=
_this
.
createItem
(
525
,
50
);
_this
.
idx4
=
_this
.
createItem
(
675
,
50
);
return
_this
;
}
Conveyor
.
prototype
.
clear
=
function
()
{
this
.
clearItem
(
this
.
idx0
);
this
.
clearItem
(
this
.
idx1
);
this
.
clearItem
(
this
.
idx2
);
this
.
clearItem
(
this
.
idx3
);
this
.
clearItem
(
this
.
idx4
);
};
Conveyor
.
prototype
.
clearItem
=
function
(
idx
)
{
if
(
idx
.
children
.
length
>
0
)
idx
.
removeChildAt
(
0
);
};
Conveyor
.
prototype
.
createItem
=
function
(
x
,
y
)
{
var
sp
=
new
engine
.
Sprite
();
this
.
addChild
(
sp
);
sp
.
x
=
x
;
sp
.
y
=
y
;
return
sp
;
};
return
Conveyor
;
}(
engine
.
Sprite
));
//# sourceMappingURL=Conveyor.js.map
var
GarbageTypes
;
(
function
(
GarbageTypes
)
{
GarbageTypes
[
"recoverableWaste"
]
=
"recoverableWaste"
;
GarbageTypes
[
"harmfulWaste"
]
=
"harmfulWaste"
;
GarbageTypes
[
"wetWaste"
]
=
"wetWaste"
;
GarbageTypes
[
"dryWaste"
]
=
"dryWaste"
;
})(
GarbageTypes
||
(
GarbageTypes
=
{}));
//# sourceMappingURL=GarbageTypes.js.map
var
GarbageConfig
=
(
function
()
{
function
GarbageConfig
()
{
}
GarbageConfig
.
config
=
[
{
name
:
"保鲜盒"
,
source
:
"g00"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
129
,
height
:
111
},
{
name
:
"报纸"
,
source
:
"g01"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
138
,
height
:
144
},
{
name
:
"贝壳"
,
source
:
"g02"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
79
,
height
:
117
},
{
name
:
"冰箱"
,
source
:
"g03"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
63
,
height
:
151
},
{
name
:
"菜梗菜叶"
,
source
:
"g04"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
144
,
height
:
98
},
{
name
:
"残枝落叶"
,
source
:
"g05"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
120
,
height
:
99
},
{
name
:
"茶叶渣"
,
source
:
"g06"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
86
,
height
:
96
},
{
name
:
"尘土"
,
source
:
"g07"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
109
,
height
:
114
},
{
name
:
"创可贴"
,
source
:
"g08"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
112
,
height
:
90
},
{
name
:
"大骨头"
,
source
:
"g09"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
89
,
height
:
101
},
{
name
:
"灯泡"
,
source
:
"g10"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
84
,
height
:
104
},
{
name
:
"电池"
,
source
:
"g11"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
89
,
height
:
131
},
{
name
:
"方便面盒"
,
source
:
"g12"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
89
,
height
:
168
},
{
name
:
"废弃食用油脂"
,
source
:
"g13"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
131
,
height
:
164
},
{
name
:
"骨骼内脏"
,
source
:
"g14"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
104
,
height
:
82
},
{
name
:
"锅具"
,
source
:
"g15"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
119
,
height
:
149
},
{
name
:
"果核"
,
source
:
"g16"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
99
,
height
:
95
},
{
name
:
"果皮"
,
source
:
"g17"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
115
,
height
:
127
},
{
name
:
"化妆品"
,
source
:
"g18"
,
type
:
GarbageTypes
.
harmfulWaste
,
width
:
67
,
height
:
151
},
{
name
:
"鸡蛋壳"
,
source
:
"g19"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
99
,
height
:
107
},
{
name
:
"剪刀"
,
source
:
"g20"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
96
,
height
:
127
},
{
name
:
"胶带"
,
source
:
"g21"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
87
,
height
:
113
},
{
name
:
"榴莲壳"
,
source
:
"g22"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
136
,
height
:
116
},
{
name
:
"毛巾"
,
source
:
"g23"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
108
,
height
:
96
},
{
name
:
"纽扣电池"
,
source
:
"g24"
,
type
:
GarbageTypes
.
harmfulWaste
,
width
:
87
,
height
:
89
},
{
name
:
"破旧陶瓷罐"
,
source
:
"g25"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
110
,
height
:
125
},
{
name
:
"杀虫剂"
,
source
:
"g26"
,
type
:
GarbageTypes
.
harmfulWaste
,
width
:
64
,
height
:
160
},
{
name
:
"剩菜剩饭"
,
source
:
"g27"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
128
,
height
:
96
},
{
name
:
"手机"
,
source
:
"g28"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
82
,
height
:
142
},
{
name
:
"书本"
,
source
:
"g29"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
106
,
height
:
132
},
{
name
:
"水杯"
,
source
:
"g30"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
62
,
height
:
119
},
{
name
:
"水银温度计"
,
source
:
"g31"
,
type
:
GarbageTypes
.
harmfulWaste
,
width
:
109
,
height
:
162
},
{
name
:
"水银血压计"
,
source
:
"g32"
,
type
:
GarbageTypes
.
harmfulWaste
,
width
:
115
,
height
:
147
},
{
name
:
"塑料桶"
,
source
:
"g33"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
92
,
height
:
131
},
{
name
:
"卫生纸"
,
source
:
"g34"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
92
,
height
:
132
},
{
name
:
"污染织物"
,
source
:
"g35"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
128
,
height
:
139
},
{
name
:
"污染纸张"
,
source
:
"g36"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
96
,
height
:
136
},
{
name
:
"洗衣机"
,
source
:
"g37"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
87
,
height
:
157
},
{
name
:
"烟蒂"
,
source
:
"g38"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
87
,
height
:
124
},
{
name
:
"药品"
,
source
:
"g39"
,
type
:
GarbageTypes
.
harmfulWaste
,
width
:
109
,
height
:
131
},
{
name
:
"药品包装"
,
source
:
"g40"
,
type
:
GarbageTypes
.
harmfulWaste
,
width
:
108
,
height
:
125
},
{
name
:
"椰子壳"
,
source
:
"g41"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
104
,
height
:
119
},
{
name
:
"衣服"
,
source
:
"g42"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
83
,
height
:
137
},
{
name
:
"衣架"
,
source
:
"g43"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
132
,
height
:
125
},
{
name
:
"易拉罐"
,
source
:
"g44"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
65
,
height
:
133
},
{
name
:
"荧光灯"
,
source
:
"g45"
,
type
:
GarbageTypes
.
harmfulWaste
,
width
:
90
,
height
:
118
},
{
name
:
"油漆桶"
,
source
:
"g46"
,
type
:
GarbageTypes
.
harmfulWaste
,
width
:
65
,
height
:
143
},
{
name
:
"纸杯"
,
source
:
"g47"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
76
,
height
:
116
},
{
name
:
"纸尿裤"
,
source
:
"g48"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
93
,
height
:
138
},
{
name
:
"纸箱"
,
source
:
"g49"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
112
,
height
:
118
},
{
name
:
"指甲油"
,
source
:
"g50"
,
type
:
GarbageTypes
.
harmfulWaste
,
width
:
64
,
height
:
138
},
];
return
GarbageConfig
;
}());
//# sourceMappingURL=GarbageConfig.js.map
var
transStores
=
(
function
(
list
)
{
var
tmp
=
[];
var
contains
=
function
(
val
)
{
for
(
var
_i
=
0
,
tmp_1
=
tmp
;
_i
<
tmp_1
.
length
;
_i
++
)
{
var
i
=
tmp_1
[
_i
];
if
(
val
.
targetType
==
i
.
targetType
&&
val
.
itemType
==
i
.
itemType
&&
val
.
itemName
==
i
.
itemName
)
return
true
;
}
return
false
;
};
list
.
forEach
(
function
(
i
)
{
if
(
!
contains
(
i
))
tmp
.
push
(
i
);
});
list
=
tmp
;
tmp
=
[];
var
nameList
=
[];
var
contains2
=
function
(
val
)
{
for
(
var
_i
=
0
,
tmp_2
=
tmp
;
_i
<
tmp_2
.
length
;
_i
++
)
{
var
i
=
tmp_2
[
_i
];
if
(
val
.
itemName
==
i
.
itemName
)
{
nameList
.
push
(
i
.
itemName
);
return
true
;
}
}
return
false
;
};
list
.
forEach
(
function
(
i
)
{
if
(
!
contains2
(
i
))
tmp
.
push
(
i
);
});
list
=
tmp
;
list
.
forEach
(
function
(
i
)
{
if
(
nameList
.
indexOf
(
i
.
itemName
)
!=
-
1
)
{
i
.
targetType
=
i
.
itemType
;
}
});
return
list
.
map
(
function
(
i
)
{
return
{
'targetName'
:
getTargetName
(
i
.
targetType
),
'isCorrect'
:
i
.
targetType
==
i
.
itemType
,
'itemName'
:
i
.
itemName
};
});
});
var
getTargetName
=
function
(
type
)
{
switch
(
type
)
{
case
GarbageTypes
.
recoverableWaste
:
return
'可回收物'
;
case
GarbageTypes
.
harmfulWaste
:
return
'有害垃圾'
;
case
GarbageTypes
.
wetWaste
:
return
'湿垃圾'
;
case
GarbageTypes
.
dryWaste
:
return
'其他垃圾'
;
}
};
//# sourceMappingURL=transStores.js.map
var
checkHit
=
(
function
(
view
,
rect
)
{
var
x
=
view
.
x
,
y
=
view
.
y
;
var
_a
=
view
.
texture
,
width
=
_a
.
width
,
height
=
_a
.
height
;
if
(
x
>
rect
.
x
&&
y
>
rect
.
y
&&
(
x
+
width
)
<
(
rect
.
x
+
rect
.
width
)
&&
(
y
+
height
)
<
(
rect
.
y
+
rect
.
height
))
{
return
true
;
}
return
false
;
});
//# sourceMappingURL=checkHit.js.map
var
removeChild
=
(
function
(
d
)
{
if
(
d
&&
d
.
parent
)
{
d
.
parent
.
removeChild
(
d
);
}
});
//# sourceMappingURL=removeChild.js.map
var
removeEle
=
(
function
(
e
,
arr
)
{
var
index
=
arr
.
indexOf
(
e
);
if
(
index
>=
0
)
{
arr
.
splice
(
index
,
1
);
}
});
//# sourceMappingURL=removeEle.js.map
var
shuffle
=
(
function
(
arr
)
{
var
_a
;
var
i
=
arr
.
length
;
while
(
i
)
{
var
j
=
Math
.
floor
(
Math
.
random
()
*
i
--
);
_a
=
[
arr
[
i
],
arr
[
j
]],
arr
[
j
]
=
_a
[
0
],
arr
[
i
]
=
_a
[
1
];
}
return
arr
;
});
var
WrongTips
=
(
function
(
_super
)
{
tslib
.
__extends
(
WrongTips
,
_super
);
function
WrongTips
()
{
var
_this
=
_super
.
call
(
this
)
||
this
;
_this
.
img
=
new
engine
.
Image
();
_this
.
img
.
texture
=
getTextureByName
(
'wrongTips'
);
_this
.
addChild
(
_this
.
img
);
_this
.
img
.
anchorX
=
88
/
2
;
_this
.
img
.
anchorY
=
85
/
2
;
_this
.
visible
=
false
;
return
_this
;
}
WrongTips
.
prototype
.
play
=
function
(
rect
)
{
this
.
visible
=
true
;
var
dur
=
70
;
var
stren
=
20
;
engine
.
Tween
.
get
(
this
.
img
).
set
({
x
:
0
,
y
:
0
,
scaleX
:
1
,
scaleY
:
1
,
alpha
:
1
})
.
to
({
x
:
stren
},
dur
)
.
to
({
x
:
0
},
dur
)
.
to
({
x
:
-
stren
},
dur
)
.
to
({
x
:
0
},
dur
)
.
wait
(
200
)
.
to
({
alpha
:
0
},
300
);
this
.
x
=
rect
.
x
+
180
;
this
.
y
=
rect
.
y
;
};
return
WrongTips
;
}(
engine
.
Sprite
));
var
getTargetRect
=
function
(
targetType
,
gameview
)
{
switch
(
targetType
)
{
case
GarbageTypes
.
dryWaste
:
return
gameview
.
dryWaste
;
case
GarbageTypes
.
wetWaste
:
return
gameview
.
wetWaste
;
case
GarbageTypes
.
harmfulWaste
:
return
gameview
.
harmfulWaste
;
case
GarbageTypes
.
recoverableWaste
:
return
gameview
.
recoverableWaste
;
}
};
//# sourceMappingURL=WrongTips.js.map
var
Conveyors
=
(
function
(
_super
)
{
tslib
.
__extends
(
Conveyors
,
_super
);
function
Conveyors
(
p
)
{
var
_this
=
_super
.
call
(
this
)
||
this
;
_this
.
conveyorsPool
=
[];
_this
.
GarbageConfig
=
GarbageConfig
.
config
;
_this
.
datas
=
[];
_this
.
wrapper
=
p
;
return
_this
;
}
Conveyors
.
prototype
.
initData
=
function
(
conveyor0
,
conveyor1
)
{
this
.
conveyor0
=
conveyor0
;
this
.
conveyor1
=
conveyor1
;
};
Conveyors
.
prototype
.
setDefault
=
function
()
{
this
.
score
=
0
;
this
.
conveyorsPool
.
push
(
this
.
conveyor0
);
this
.
conveyorsPool
.
push
(
this
.
conveyor1
);
var
allConfigs
=
shuffle
(
this
.
GarbageConfig
.
concat
([]));
for
(
var
i
=
0
;
i
<
GarbageConfig
.
config
.
length
;
i
++
)
{
allConfigs
[
i
].
idx
=
i
;
allConfigs
[
i
].
isRight
=
false
;
allConfigs
[
i
].
isMistake
=
false
;
allConfigs
[
i
].
isOnStage
=
false
;
this
.
datas
.
push
(
allConfigs
[
i
]);
}
for
(
var
i
=
0
;
i
<
5
;
i
++
)
{
var
data
=
this
.
datas
[
i
];
var
view
=
new
engine
.
Sprite
(
getTextureByName
(
data
.
source
));
view
.
isWrong
=
false
;
view
.
isRight
=
false
;
data
.
isOnStage
=
true
;
view
.
type
=
data
.
type
;
view
.
name
=
data
.
name
;
view
.
anchorX
=
data
.
width
/
2
;
view
.
anchorY
=
data
.
height
;
view
.
x
=
-
data
.
width
/
2
;
view
.
y
=
-
data
.
height
+
40
;
this
.
conveyor1
[
"idx"
+
i
].
addChild
(
view
);
view
.
addEventListener
(
engine
.
MouseEvent
.
MOUSE_DOWN
,
this
.
onDown_garbage
,
this
);
}
};
Conveyors
.
prototype
.
startConveyors
=
function
()
{
this
.
setDefault
();
engine
.
gameStage
.
addEventListener
(
engine
.
Event
.
ENTER_FRAME
,
this
.
onEnterFrame
,
this
);
};
Conveyors
.
prototype
.
onEnterFrame
=
function
(
ENTER_FRAME
,
onEnterFrame
,
arg2
)
{
if
(
this
.
score
==
(
props
.
maxScore
||
100
))
{
this
.
gameOver
();
this
.
wrapper
.
stop
();
}
this
.
conveyorsPool
.
forEach
(
function
(
conveyor
)
{
conveyor
.
x
-=
props
.
speed
||
3
;
});
if
(
this
.
conveyorsPool
[
this
.
conveyorsPool
.
length
-
1
].
x
<=
764
)
{
var
conveyor
=
new
Conveyor
();
conveyor
.
x
=
this
.
conveyorsPool
[
this
.
conveyorsPool
.
length
-
1
].
x
+
764
;
this
.
wrapper
.
addChild
(
conveyor
);
this
.
conveyorsPool
.
push
(
conveyor
);
}
else
{
var
dataList
=
[];
for
(
var
n
=
0
;
n
<
this
.
datas
.
length
;
n
++
)
{
var
dataItem
=
this
.
datas
[
n
];
if
(
!
dataItem
.
isRight
&&
!
dataItem
.
isOnStage
)
{
dataList
.
push
(
dataItem
);
}
}
var
lastConveyor
=
this
.
conveyorsPool
[
this
.
conveyorsPool
.
length
-
1
];
for
(
var
m
=
0
;
m
<
5
;
m
++
)
{
if
(
!
lastConveyor
[
"idx"
+
m
].
children
[
0
])
{
var
data
=
dataList
.
shift
();
if
(
data
)
{
data
.
isOnStage
=
true
;
var
view
=
new
engine
.
Sprite
(
getTextureByName
(
data
.
source
));
view
.
isWrong
=
false
;
view
.
isRight
=
false
;
view
.
type
=
data
.
type
;
view
.
name
=
data
.
name
;
view
.
anchorX
=
data
.
width
/
2
;
view
.
anchorY
=
data
.
height
;
view
.
x
=
-
data
.
width
/
2
;
view
.
y
=
-
data
.
height
+
40
;
lastConveyor
[
"idx"
+
m
].
addChild
(
view
);
view
.
addEventListener
(
engine
.
MouseEvent
.
MOUSE_DOWN
,
this
.
onDown_garbage
,
this
);
}
else
{
break
;
}
}
}
}
if
(
this
.
conveyorsPool
[
0
].
x
<
-
750
)
{
for
(
var
k
=
0
;
k
<
this
.
datas
.
length
;
k
++
)
{
var
dataItem
=
this
.
datas
[
k
];
var
idx4
=
this
.
conveyorsPool
[
0
][
"idx"
+
4
];
if
(
idx4
.
children
[
0
])
{
if
(
dataItem
.
name
==
idx4
.
children
[
0
].
name
)
{
dataItem
.
isOnStage
=
false
;
removeEle
(
dataItem
,
this
.
datas
);
this
.
datas
.
push
(
dataItem
);
idx4
.
removeChild
(
idx4
.
children
[
0
]);
break
;
}
}
}
this
.
conveyorsPool
.
shift
();
}
else
if
(
this
.
conveyorsPool
[
0
].
x
<
-
600
)
{
for
(
var
k
=
0
;
k
<
this
.
datas
.
length
;
k
++
)
{
var
dataItem
=
this
.
datas
[
k
];
var
idx3
=
this
.
conveyorsPool
[
0
][
"idx"
+
3
];
if
(
idx3
.
children
[
0
])
{
if
(
dataItem
.
name
==
idx3
.
children
[
0
].
name
)
{
dataItem
.
isOnStage
=
false
;
removeEle
(
dataItem
,
this
.
datas
);
this
.
datas
.
push
(
dataItem
);
idx3
.
removeChild
(
idx3
.
children
[
0
]);
break
;
}
}
}
}
else
if
(
this
.
conveyorsPool
[
0
].
x
<
-
450
)
{
for
(
var
k
=
0
;
k
<
this
.
datas
.
length
;
k
++
)
{
var
dataItem
=
this
.
datas
[
k
];
var
idx2
=
this
.
conveyorsPool
[
0
][
"idx"
+
2
];
if
(
idx2
.
children
[
0
])
{
if
(
dataItem
.
name
==
idx2
.
children
[
0
].
name
)
{
dataItem
.
isOnStage
=
false
;
removeEle
(
dataItem
,
this
.
datas
);
this
.
datas
.
push
(
dataItem
);
idx2
.
removeChild
(
idx2
.
children
[
0
]);
break
;
}
}
}
}
else
if
(
this
.
conveyorsPool
[
0
].
x
<
-
300
)
{
for
(
var
k
=
0
;
k
<
this
.
datas
.
length
;
k
++
)
{
var
dataItem
=
this
.
datas
[
k
];
var
idx1
=
this
.
conveyorsPool
[
0
][
"idx"
+
1
];
if
(
idx1
.
children
[
0
])
{
if
(
dataItem
.
name
==
idx1
.
children
[
0
].
name
)
{
dataItem
.
isOnStage
=
false
;
removeEle
(
dataItem
,
this
.
datas
);
this
.
datas
.
push
(
dataItem
);
idx1
.
removeChild
(
idx1
.
children
[
0
]);
break
;
}
}
}
}
else
if
(
this
.
conveyorsPool
[
0
].
x
<
-
150
)
{
for
(
var
k
=
0
;
k
<
this
.
datas
.
length
;
k
++
)
{
var
dataItem
=
this
.
datas
[
k
];
var
idx0
=
this
.
conveyorsPool
[
0
][
"idx"
+
0
];
if
(
idx0
.
children
[
0
])
{
if
(
dataItem
.
name
==
idx0
.
children
[
0
].
name
)
{
dataItem
.
isOnStage
=
false
;
removeEle
(
dataItem
,
this
.
datas
);
this
.
datas
.
push
(
dataItem
);
idx0
.
removeChild
(
idx0
.
children
[
0
]);
break
;
}
}
}
}
};
Conveyors
.
prototype
.
addscore
=
function
()
{
this
.
score
+=
(
props
.
onceScore
||
2
);
engine
.
globalEvent
.
dispatchEvent
(
'recycling-score-update'
,
{
score
:
this
.
score
});
};
Conveyors
.
prototype
.
gameOver
=
function
()
{
engine
.
gameStage
.
removeEventListener
(
engine
.
Event
.
ENTER_FRAME
,
this
.
onEnterFrame
,
this
);
engine
.
globalEvent
.
dispatchEvent
(
'recycling-game-end'
,
transStores
(
this
.
stores
));
};
Conveyors
.
prototype
.
onDown_garbage
=
function
(
e
)
{
if
(
this
.
_currentDragView
)
{
removeChild
(
this
.
_currentDragView
);
}
var
target
=
e
.
target
;
var
view
=
new
engine
.
Sprite
(
target
.
texture
);
this
.
_currentDragView
=
view
;
this
.
_currentTarget
=
target
;
target
.
scaleX
=
target
.
scaleY
=
0
;
this
.
wrapper
.
addChild
(
view
);
view
.
x
=
e
.
stageX
-
target
.
texture
.
width
/
2
;
view
.
y
=
e
.
stageY
-
target
.
texture
.
height
/
2
;
view
.
type
=
target
[
'type'
];
view
.
name
=
target
[
'name'
];
this
.
wrapper
.
addEventListener
(
engine
.
MouseEvent
.
MOUSE_UP
,
this
.
onStageMouseUp
,
this
);
this
.
wrapper
.
addEventListener
(
engine
.
MouseEvent
.
MOUSE_MOVE
,
this
.
onStageMouseMove
,
this
);
};
Conveyors
.
prototype
.
onStageMouseMove
=
function
(
e
)
{
var
view
=
this
.
_currentDragView
;
view
.
x
=
e
.
stageX
-
view
.
texture
.
width
/
2
;
view
.
y
=
e
.
stageY
-
view
.
texture
.
height
/
2
;
};
Conveyors
.
prototype
.
onStageMouseUp
=
function
(
e
)
{
var
_this
=
this
;
this
.
wrapper
.
removeEventListener
(
engine
.
MouseEvent
.
MOUSE_UP
,
this
.
onStageMouseUp
,
this
);
this
.
wrapper
.
removeEventListener
(
engine
.
MouseEvent
.
MOUSE_MOVE
,
this
.
onStageMouseMove
,
this
);
if
(
!
this
.
_currentDragView
)
return
;
var
result
=
this
.
checkHitRect
();
if
(
result
)
{
if
(
result
==
this
.
_currentDragView
[
'type'
])
{
this
.
addscore
();
this
.
wrapper
.
rightTips
.
play
(
getTargetRect
(
result
,
this
.
wrapper
));
}
else
{
engine
.
Tween
.
get
(
this
.
_currentTarget
).
to
({
scaleX
:
1
,
scaleY
:
1
},
300
).
call
(
function
()
{
});
this
.
wrapper
.
wrongTips
.
play
(
getTargetRect
(
result
,
this
.
wrapper
));
}
this
.
stores
.
push
({
targetType
:
result
,
itemType
:
this
.
_currentDragView
[
'type'
],
itemName
:
this
.
_currentDragView
[
'name'
]
});
}
else
{
engine
.
Tween
.
get
(
this
.
_currentTarget
).
to
({
scaleX
:
1
,
scaleY
:
1
},
300
).
call
(
function
()
{
});
}
this
.
_currentDragView
.
anchorX
=
this
.
_currentDragView
.
texture
.
width
/
2
;
this
.
_currentDragView
.
anchorY
=
this
.
_currentDragView
.
texture
.
height
/
2
;
engine
.
Tween
.
get
(
this
.
_currentDragView
).
to
({
scaleX
:
0
,
scaleY
:
0
},
300
).
call
(
function
()
{
removeChild
(
_this
.
_currentDragView
);
});
};
Conveyors
.
prototype
.
clear
=
function
()
{
this
.
conveyor0
.
x
=
0
;
this
.
conveyor1
.
x
=
764
;
this
.
conveyorsPool
.
forEach
(
function
(
i
)
{
i
.
clear
();
});
this
.
conveyorsPool
=
[];
this
.
datas
=
[];
this
.
stores
=
[];
};
Conveyors
.
prototype
.
timeout
=
function
()
{
if
(
this
.
_currentDragView
)
{
removeChild
(
this
.
_currentDragView
);
}
this
.
wrapper
.
removeEventListener
(
engine
.
MouseEvent
.
MOUSE_UP
,
this
.
onStageMouseUp
,
this
);
this
.
wrapper
.
removeEventListener
(
engine
.
MouseEvent
.
MOUSE_MOVE
,
this
.
onStageMouseMove
,
this
);
this
.
gameOver
();
};
Conveyors
.
prototype
.
checkHitRect
=
function
()
{
if
(
checkHit
(
this
.
_currentDragView
,
this
.
wrapper
.
wetWaste
))
{
return
GarbageTypes
.
wetWaste
;
}
if
(
checkHit
(
this
.
_currentDragView
,
this
.
wrapper
.
harmfulWaste
))
{
return
GarbageTypes
.
harmfulWaste
;
}
if
(
checkHit
(
this
.
_currentDragView
,
this
.
wrapper
.
dryWaste
))
{
return
GarbageTypes
.
dryWaste
;
}
if
(
checkHit
(
this
.
_currentDragView
,
this
.
wrapper
.
recoverableWaste
))
{
return
GarbageTypes
.
recoverableWaste
;
}
return
null
;
};
return
Conveyors
;
}(
engine
.
Sprite
));
var
uiConfig
=
(
function
()
{
return
[
{
id
:
'playBg'
,
texture
:
'playBg'
},
{
id
:
'idler0'
,
texture
:
'idlerWheel'
,
pos
:
[
75
,
1038
],
anchor
:
[
20
,
21.5
]
},
{
id
:
'idler1'
,
texture
:
'idlerWheel'
,
pos
:
[
175
,
1038
],
anchor
:
[
20
,
21.5
]
},
{
id
:
'idler2'
,
texture
:
'idlerWheel'
,
pos
:
[
275
,
1038
],
anchor
:
[
20
,
21.5
]
},
{
id
:
'idler3'
,
texture
:
'idlerWheel'
,
pos
:
[
375
,
1038
],
anchor
:
[
20
,
21.5
]
},
{
id
:
'idler4'
,
texture
:
'idlerWheel'
,
pos
:
[
475
,
1038
],
anchor
:
[
20
,
21.5
]
},
{
id
:
'idler5'
,
texture
:
'idlerWheel'
,
pos
:
[
575
,
1038
],
anchor
:
[
20
,
21.5
]
},
{
id
:
'idler6'
,
texture
:
'idlerWheel'
,
pos
:
[
675
,
1038
],
anchor
:
[
20
,
21.5
]
},
];
});
//# sourceMappingURL=uiConfig.js.map
var
getGuideInfo
=
(
function
()
{
if
(
!
window
.
localStorage
)
{
return
0
;
}
return
localStorage
.
getItem
(
'recyclingGuide'
);
});
var
setGuide
=
function
()
{
if
(
window
.
localStorage
)
localStorage
.
setItem
(
'recyclingGuide'
,
'1'
);
};
//# sourceMappingURL=getGuideInfo.js.map
var
createBg
=
(
function
(
a
)
{
if
(
a
===
void
0
)
{
a
=
1
;
}
var
rect
=
new
engine
.
Graphics
();
rect
.
beginFill
(
0
);
rect
.
drawRect
(
0
,
0
,
750
,
1624
);
rect
.
endFill
();
rect
.
alpha
=
a
;
return
rect
;
});
//# sourceMappingURL=createBg.js.map
var
createImg
=
(
function
(
texture
)
{
return
new
engine
.
Sprite
(
getTextureByName
(
texture
));
});
//# sourceMappingURL=createImg.js.map
var
CountDownGroup
=
(
function
(
_super
)
{
tslib
.
__extends
(
CountDownGroup
,
_super
);
function
CountDownGroup
()
{
var
_this
=
_super
.
call
(
this
)
||
this
;
_this
.
addChild
(
createBg
(.
6
));
_this
.
num1
=
createImg
(
'num1'
);
_this
.
num2
=
createImg
(
'num2'
);
_this
.
num3
=
createImg
(
'num3'
);
_this
.
go
=
createImg
(
'go'
);
_this
.
go
.
anchorX
=
240
;
_this
.
go
.
anchorY
=
171.5
;
_this
.
num1
.
anchorX
=
125.5
;
_this
.
num1
.
anchorY
=
189
;
_this
.
num2
.
anchorX
=
149.5
;
_this
.
num2
.
anchorY
=
191.5
;
_this
.
num3
.
anchorX
=
148.5
;
_this
.
num3
.
anchorY
=
191.5
;
_this
.
go
.
x
=
750
/
2
-
240
;
_this
.
go
.
y
=
525
-
171.5
;
_this
.
num1
.
x
=
750
/
2
-
125.5
;
_this
.
num1
.
y
=
529
-
189
;
_this
.
num2
.
x
=
750
/
2
-
149.5
;
_this
.
num2
.
y
=
526
-
191.5
;
_this
.
num3
.
x
=
750
/
2
-
148.5
;
_this
.
num3
.
y
=
525
-
191.5
;
_this
.
addChild
(
_this
.
num1
);
_this
.
addChild
(
_this
.
num2
);
_this
.
addChild
(
_this
.
num3
);
_this
.
addChild
(
_this
.
go
);
_this
.
visible
=
false
;
_this
.
reset
();
return
_this
;
}
CountDownGroup
.
prototype
.
reset
=
function
()
{
this
.
go
.
alpha
=
this
.
num1
.
alpha
=
this
.
num2
.
alpha
=
this
.
num3
.
alpha
=
0
;
this
.
go
.
scaleX
=
this
.
num1
.
scaleX
=
this
.
num2
.
scaleX
=
this
.
num3
.
scaleX
=
3
;
this
.
go
.
scaleY
=
this
.
num1
.
scaleY
=
this
.
num2
.
scaleY
=
this
.
num3
.
scaleY
=
3
;
};
CountDownGroup
.
prototype
.
startCountDown
=
function
()
{
return
tslib
.
__awaiter
(
this
,
void
0
,
void
0
,
function
()
{
var
_this
=
this
;
return
tslib
.
__generator
(
this
,
function
(
_a
)
{
return
[
2
,
new
Promise
(
function
(
r
)
{
_this
.
reset
();
_this
.
visible
=
true
;
_this
.
num3
.
alpha
=
1
;
var
n3
=
engine
.
Tween
.
get
(
_this
.
num3
);
n3
.
to
({
scaleX
:
0.8
,
scaleY
:
0.8
},
200
).
to
({
scaleX
:
1
,
scaleY
:
1
},
100
).
wait
(
500
).
to
({
scaleX
:
0
,
scaleY
:
0
},
200
).
call
(
function
()
{
_this
.
num2
.
alpha
=
1
;
var
n2
=
engine
.
Tween
.
get
(
_this
.
num2
);
n2
.
to
({
scaleX
:
0.8
,
scaleY
:
0.8
},
200
).
to
({
scaleX
:
1
,
scaleY
:
1
},
100
).
wait
(
500
).
to
({
scaleX
:
0
,
scaleY
:
0
},
200
).
call
(
function
()
{
_this
.
num1
.
alpha
=
1
;
var
n1
=
engine
.
Tween
.
get
(
_this
.
num1
);
n1
.
to
({
scaleX
:
0.8
,
scaleY
:
0.8
},
200
).
to
({
scaleX
:
1
,
scaleY
:
1
},
100
).
wait
(
500
).
to
({
scaleX
:
0
,
scaleY
:
0
},
200
).
call
(
function
()
{
_this
.
go
.
alpha
=
1
;
var
go
=
engine
.
Tween
.
get
(
_this
.
go
);
go
.
to
({
scaleX
:
0.8
,
scaleY
:
0.8
},
200
).
to
({
scaleX
:
1
,
scaleY
:
1
},
100
).
wait
(
500
).
call
(
function
()
{
_this
.
visible
=
false
;
r
();
});
});
});
});
})];
});
});
};
return
CountDownGroup
;
}(
engine
.
Sprite
));
//# sourceMappingURL=CountDownGroup.js.map
var
GuideView
=
(
function
(
_super
)
{
tslib
.
__extends
(
GuideView
,
_super
);
function
GuideView
()
{
var
_this
=
_super
.
call
(
this
)
||
this
;
_this
.
initUI
();
_this
.
visible
=
false
;
return
_this
;
}
GuideView
.
prototype
.
initUI
=
function
()
{
this
.
addChild
(
createBg
(.
6
));
this
.
guideBg
=
createImg
(
'guideBg'
);
this
.
addChild
(
this
.
guideBg
);
this
.
guideEle
=
createImg
(
'guideEle'
);
this
.
addChild
(
this
.
guideEle
);
this
.
guideBg
.
x
=
393
;
this
.
guideBg
.
y
=
552
;
this
.
guideEle
.
x
=
361
;
this
.
guideEle
.
y
=
877
;
this
.
guideEle
.
mouseEnabled
=
this
.
guideEle
.
mouseChildren
=
true
;
var
svga
=
createSvga
(
"guideTips"
);
this
.
svga
=
svga
;
this
.
addChild
(
svga
);
svga
.
gotoAndStop
(
1
);
svga
.
mouseEnabled
=
svga
.
mouseChildren
=
false
;
};
GuideView
.
prototype
.
checkHit
=
function
(
x
,
y
,
w
,
h
)
{
var
rect
=
new
engine
.
Rectangle
(
393
,
552
,
281
,
320
);
if
(
x
>
rect
.
x
&&
y
>
rect
.
y
&&
(
x
+
w
)
<
(
rect
.
x
+
rect
.
width
)
&&
(
y
+
h
)
<
(
rect
.
y
+
rect
.
height
))
{
return
true
;
}
return
false
;
};
GuideView
.
prototype
.
startGuide
=
function
()
{
return
tslib
.
__awaiter
(
this
,
void
0
,
void
0
,
function
()
{
var
_this
=
this
;
return
tslib
.
__generator
(
this
,
function
(
_a
)
{
return
[
2
,
new
Promise
(
function
(
r
)
{
_this
.
visible
=
true
;
_this
.
svga
.
gotoAndStop
(
1
);
_this
.
svga
.
play
(
false
,
true
);
_this
.
guideEle
.
scaleX
=
1
;
_this
.
guideEle
.
scaleY
=
1
;
var
offset
=
[
0
,
0
];
var
guideOver
=
function
()
{
_this
.
guideEle
.
removeEventListener
(
engine
.
MouseEvent
.
MOUSE_DOWN
,
ondown
,
_this
);
engine
.
Tween
.
get
(
_this
.
guideEle
).
to
({
scaleX
:
0
,
scaleY
:
0
},
300
).
call
(
function
()
{
_this
.
visible
=
false
;
r
();
});
};
var
onUp
=
function
(
e
)
{
_this
.
stage
.
removeEventListener
(
engine
.
MouseEvent
.
MOUSE_MOVE
,
onMove
,
_this
);
if
(
_this
.
checkHit
(
_this
.
guideEle
.
x
,
_this
.
guideEle
.
y
,
_this
.
guideEle
.
width
,
_this
.
guideEle
.
height
))
{
guideOver
();
}
else
{
_this
.
svga
.
visible
=
true
;
_this
.
guideEle
.
x
=
361
;
_this
.
guideEle
.
y
=
877
;
}
};
var
onMove
=
function
(
e
)
{
_this
.
guideEle
.
x
=
e
.
stageX
-
offset
[
0
];
_this
.
guideEle
.
y
=
e
.
stageY
-
offset
[
1
];
};
var
ondown
=
function
(
e
)
{
offset
=
[
e
.
localX
,
e
.
localY
];
_this
.
svga
.
visible
=
false
;
_this
.
stage
.
once
(
engine
.
MouseEvent
.
MOUSE_UP
,
onUp
,
_this
);
_this
.
stage
.
addEventListener
(
engine
.
MouseEvent
.
MOUSE_MOVE
,
onMove
,
_this
);
};
_this
.
guideEle
.
addEventListener
(
engine
.
MouseEvent
.
MOUSE_DOWN
,
ondown
,
_this
);
})];
});
});
};
return
GuideView
;
}(
engine
.
Sprite
));
//# sourceMappingURL=guideView.js.map
var
RightTips
=
(
function
(
_super
)
{
tslib
.
__extends
(
RightTips
,
_super
);
function
RightTips
()
{
var
_this
=
_super
.
call
(
this
)
||
this
;
_this
.
SCORE
=
props
.
onceScore
||
2
;
_this
.
img
=
new
engine
.
Image
();
_this
.
img
.
texture
=
getTextureByName
(
'rightTips'
);
_this
.
addChild
(
_this
.
img
);
_this
.
img
.
anchorX
=
88
/
2
;
_this
.
img
.
anchorY
=
85
/
2
;
_this
.
visible
=
false
;
_this
.
txt
=
new
engine
.
TextField
();
_this
.
addChild
(
_this
.
txt
);
_this
.
txt
.
text
=
'+'
+
_this
.
SCORE
;
_this
.
txt
.
size
=
60
;
_this
.
txt
.
fillColor
=
'#437726'
;
engine
.
playSound
;
return
_this
;
}
RightTips
.
prototype
.
play
=
function
(
rect
)
{
this
.
visible
=
true
;
this
.
txt
.
x
=
100
;
engine
.
Tween
.
get
(
this
.
txt
).
set
({
y
:
60
,
alpha
:
1
})
.
to
({
y
:
-
50
},
500
)
.
to
({
alpha
:
0
});
engine
.
Tween
.
get
(
this
.
img
).
set
({
x
:
0
,
y
:
0
,
scaleX
:
0
,
scaleY
:
0
,
alpha
:
1
})
.
to
({
scaleX
:
1
,
scaleY
:
1
},
200
,
engine
.
Ease
.
getBackOut
(
1
))
.
wait
(
200
)
.
to
({
alpha
:
0
},
300
);
this
.
x
=
rect
.
x
+
180
;
this
.
y
=
rect
.
y
;
};
return
RightTips
;
}(
engine
.
Sprite
));
//# sourceMappingURL=RightTips.js.map
var
GameView
=
(
function
(
_super
)
{
tslib
.
__extends
(
GameView
,
_super
);
function
GameView
()
{
var
_this
=
_super
.
call
(
this
)
||
this
;
_this
.
_timeCounter
=
0
;
_this
.
once
(
engine
.
Event
.
ADDED_TO_STAGE
,
_this
.
setup
,
_this
);
return
_this
;
}
GameView
.
prototype
.
configUI
=
function
()
{
var
uiMap
=
{};
this
.
uiMap
=
uiMap
;
var
config
=
uiConfig
();
for
(
var
_i
=
0
,
config_1
=
config
;
_i
<
config_1
.
length
;
_i
++
)
{
var
item
=
config_1
[
_i
];
var
id
=
item
.
id
,
texture
=
item
.
texture
,
pos
=
item
.
pos
,
anchor
=
item
.
anchor
;
var
sp
=
new
engine
.
Sprite
(
getTextureByName
(
texture
));
this
.
addChild
(
sp
);
uiMap
[
id
]
=
sp
;
if
(
anchor
)
{
sp
.
anchorX
=
anchor
[
0
];
sp
.
anchorY
=
anchor
[
1
];
}
if
(
pos
)
{
sp
.
x
=
pos
[
0
];
sp
.
y
=
pos
[
1
];
if
(
anchor
)
{
sp
.
x
=
pos
[
0
]
-
sp
.
anchorX
;
sp
.
y
=
pos
[
1
]
-
sp
.
anchorY
;
}
}
}
this
.
configConveyors
();
this
.
createRects
();
this
.
countdown
=
new
CountDownGroup
();
this
.
addChild
(
this
.
countdown
);
this
.
guide
=
new
GuideView
();
this
.
addChild
(
this
.
guide
);
this
.
wrongTips
=
new
WrongTips
();
this
.
rightTips
=
new
RightTips
();
this
.
addChild
(
this
.
wrongTips
);
this
.
addChild
(
this
.
rightTips
);
};
GameView
.
prototype
.
createRects
=
function
()
{
this
.
wetWaste
=
this
.
createRect
(
74
,
552
,
301
,
293
,
0xffffff
);
this
.
harmfulWaste
=
this
.
createRect
(
75
,
247
,
300
,
293
,
0xff0000
);
this
.
dryWaste
=
this
.
createRect
(
389
,
249
,
286
,
291
,
0x000000
);
this
.
recoverableWaste
=
this
.
createRect
(
389
,
551
,
287
,
292
,
0x0000ff
);
};
GameView
.
prototype
.
createRect
=
function
(
x
,
y
,
w
,
h
,
c
)
{
var
rect
=
new
engine
.
Rectangle
(
x
,
y
,
w
,
h
);
var
sp
=
new
engine
.
Sprite
();
this
.
addChild
(
sp
);
sp
.
x
=
x
;
sp
.
y
=
y
;
var
g
=
new
engine
.
Graphics
;
g
.
alpha
=
0.0
;
g
.
beginFill
(
c
);
g
.
drawRect
(
0
,
0
,
w
,
h
);
g
.
endFill
();
sp
.
addChild
(
g
);
return
rect
;
};
GameView
.
prototype
.
configConveyors
=
function
()
{
var
conveyor0
=
new
Conveyor
();
var
conveyor1
=
new
Conveyor
();
this
.
addChild
(
conveyor0
);
this
.
addChild
(
conveyor1
);
conveyor0
.
x
=
0
;
conveyor1
.
x
=
764
;
this
.
conveyors
=
new
Conveyors
(
this
);
this
.
conveyors
.
initData
(
conveyor0
,
conveyor1
);
};
GameView
.
prototype
.
playAni
=
function
()
{
var
_this
=
this
;
var
idlerWheels
=
[
'idler0'
,
'idler1'
,
'idler2'
,
'idler3'
,
'idler4'
,
'idler5'
,
'idler6'
];
idlerWheels
=
idlerWheels
.
map
(
function
(
i
)
{
return
_this
.
uiMap
[
i
];
});
idlerWheels
.
forEach
(
function
(
i
)
{
engine
.
Tween
.
get
(
i
,
{
loop
:
true
}).
to
({
rotation
:
-
360
},
1000
);
});
};
GameView
.
prototype
.
stopAni
=
function
()
{
var
_this
=
this
;
var
idlerWheels
=
[
'idler0'
,
'idler1'
,
'idler2'
,
'idler3'
,
'idler4'
,
'idler5'
,
'idler6'
];
idlerWheels
=
idlerWheels
.
map
(
function
(
i
)
{
return
_this
.
uiMap
[
i
];
});
idlerWheels
.
forEach
(
function
(
i
)
{
engine
.
Tween
.
removeTweens
(
i
);
});
};
GameView
.
prototype
.
start
=
function
()
{
return
tslib
.
__awaiter
(
this
,
void
0
,
void
0
,
function
()
{
var
_this
=
this
;
return
tslib
.
__generator
(
this
,
function
(
_a
)
{
switch
(
_a
.
label
)
{
case
0
:
console
.
log
(
'on start'
);
this
.
_timeCounter
=
0
;
if
(
!!
getGuideInfo
())
return
[
3
,
2
];
return
[
4
,
this
.
guide
.
startGuide
()];
case
1
:
_a
.
sent
();
setGuide
();
_a
.
label
=
2
;
case
2
:
this
.
conveyors
.
clear
();
return
[
4
,
this
.
countdown
.
startCountDown
()];
case
3
:
_a
.
sent
();
this
.
startGame
();
engine
.
globalEvent
.
dispatchEvent
(
'recycling-time-update'
,
{
second
:
this
.
getSecond
(),
});
this
.
_timer
=
setInterval
(
function
()
{
_this
.
onTimer
();
},
1000
);
return
[
2
];
}
});
});
};
GameView
.
prototype
.
startGame
=
function
()
{
this
.
playAni
();
this
.
conveyors
.
startConveyors
();
};
GameView
.
prototype
.
stopGame
=
function
()
{
this
.
stopAni
();
};
GameView
.
prototype
.
getSecond
=
function
()
{
return
props
.
time
-
this
.
_timeCounter
;
};
GameView
.
prototype
.
onTimer
=
function
()
{
this
.
_timeCounter
++
;
engine
.
globalEvent
.
dispatchEvent
(
'recycling-time-update'
,
{
second
:
this
.
getSecond
(),
});
if
(
this
.
getSecond
()
==
0
)
{
this
.
stop
();
this
.
conveyors
.
timeout
();
}
};
GameView
.
prototype
.
stop
=
function
()
{
clearInterval
(
this
.
_timer
);
this
.
stopGame
();
};
GameView
.
prototype
.
setup
=
function
()
{
console
.
log
(
'onSteup'
,
props
);
this
.
configUI
();
};
GameView
.
prototype
.
onDown
=
function
(
e
)
{
};
GameView
.
prototype
.
stageOnUp
=
function
(
e
)
{
};
GameView
.
prototype
.
onSuccess
=
function
()
{
};
GameView
.
prototype
.
onMove
=
function
(
e
)
{
};
return
GameView
;
}(
engine
.
Container
));
//# sourceMappingURL=GameView.js.map
var
GameWrapper
=
(
function
(
_super
)
{
tslib
.
__extends
(
GameWrapper
,
_super
);
function
GameWrapper
()
{
var
_this
=
_super
.
call
(
this
)
||
this
;
engine
.
globalEvent
.
addEventListener
(
'recycling-start'
,
_this
.
start
,
_this
);
engine
.
globalEvent
.
addEventListener
(
'recycling-stop'
,
_this
.
stop
,
_this
);
var
gameView
=
_this
.
_gameView
=
new
GameView
();
_this
.
addChild
(
gameView
);
return
_this
;
}
GameWrapper
.
prototype
.
start
=
function
(
event
)
{
injectProps
(
event
.
data
);
this
.
_gameView
.
start
();
};
GameWrapper
.
prototype
.
stop
=
function
(
event
)
{
this
.
_gameView
.
stop
();
};
return
GameWrapper
;
}(
engine
.
Container
));
//# sourceMappingURL=GameWrapper.js.map
function
index
(
props
)
{
prepareProps
();
injectProps
(
props
);
var
instance
=
new
GameWrapper
();
return
instance
;
}
//# sourceMappingURL=index.js.map
return
index
;
})));
//# sourceMappingURL=main.js.map
\ No newline at end of file
src/custom/recycling/debug/main.js.map
View file @
5e341b08
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/custom/recycling/meta.json
View file @
5e341b08
...
...
@@ -80,306 +80,313 @@
"uuid"
:
"196d410b-a645-4956-9ef1-d6f30be7c1fd"
,
"ext"
:
".png"
},
{
"name"
:
"g50"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/99a2ed7d25039e005312eed19f56ad1b451564eb.png"
,
"uuid"
:
"fe97cd48-720b-4412-9bcf-0bdd3a8e96a1"
,
"ext"
:
".png"
},
{
"name"
:
"g49"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
e408d950683da66d0a9b82de86c2a8cf532482ad
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
5564ae74afe698c969f4fe292087bb10d0b21687
.png"
,
"uuid"
:
"fe97cd48-720b-4412-9bcf-0bdd3a8e96a1"
,
"ext"
:
".png"
},
{
"name"
:
"g48"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
c13f4675de5e711bdcf2f1c5b2f7d45dd2f92aac
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
159b05de98c981b940c94e090d28a4885c421235
.png"
,
"uuid"
:
"e1aedf7c-4352-4583-9df2-d2a6aea163dd"
,
"ext"
:
".png"
},
{
"name"
:
"g47"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
48f3774efcbf5f9ef0e5141f12b9ff07f5019bbc
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
7c48a3b8ca06833310640718d8b8812c6e584c0d
.png"
,
"uuid"
:
"402f8717-a023-4625-9daf-4e8f7964e7a2"
,
"ext"
:
".png"
},
{
"name"
:
"g46"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
e2ad0647d07daf99ecc7606a6e0832cfc7f7a8f8
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
534cef6d7a73022dac36a8f917aaba59138ab5d3
.png"
,
"uuid"
:
"9445c37d-e81c-4d36-a211-eed7a97eea4d"
,
"ext"
:
".png"
},
{
"name"
:
"g45"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
8aa58ad538a67a539176479e072769de0efea638
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
360c8b26d732c3952621a4949a81329aad2bdf82
.png"
,
"uuid"
:
"10e25631-ea9d-4dd3-8bef-4c340068c81a"
,
"ext"
:
".png"
},
{
"name"
:
"g44"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
7d8526e6e57130b54290a2b64567afd27c8d8f91
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
4ad9335add89aebbfcb1e8b501ceb64d4df1a534
.png"
,
"uuid"
:
"202c0ea8-bc6b-4098-aae8-bd29cf13b35f"
,
"ext"
:
".png"
},
{
"name"
:
"g43"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
967da517b471f7ed4629bba46f8dc2ba8beb1f0d
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
2e6f5306255d434119e6dc986a9098b09426e252
.png"
,
"uuid"
:
"bb47d087-004c-4882-8d80-d172c0bff8a7"
,
"ext"
:
".png"
},
{
"name"
:
"g42"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
bf7eddba2dc2ce6ce8103175e96a348bc7e272c8
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
5d1537eccc3c3a5252990a8b20b30c357840b14d
.png"
,
"uuid"
:
"3a9c692c-2683-4ad5-a0b5-6193e5f708d1"
,
"ext"
:
".png"
},
{
"name"
:
"g41"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
767bcb92c9293d4edb60e413a11823b82ba05589
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
4ea16fb41faede6cfbb06d00cdc14899252d49fe
.png"
,
"uuid"
:
"3e6d234e-2393-4d75-9e5c-c87e9f4f4370"
,
"ext"
:
".png"
},
{
"name"
:
"g40"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
0a6276f244a36da419ca1b30180a126744e1838e
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
13ee95640c7269d89bf788cf200c734006b06329
.png"
,
"uuid"
:
"2c7df6ab-6ed5-451a-8da3-1de64e9a6518"
,
"ext"
:
".png"
},
{
"name"
:
"g39"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
b403cf582c53ea72cb48a46ae8b85c8f124d0454
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
07c67a3b9decae820fed0e1a627c9c02e4da3b6e
.png"
,
"uuid"
:
"2614eb6c-9153-4149-b8d6-ef02ac2200ae"
,
"ext"
:
".png"
},
{
"name"
:
"g38"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
b4542db81f188832e04caaf85ab17aef4d44c814
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
0b8bbf79b28f868822050f82c91092f2d12be0eb
.png"
,
"uuid"
:
"g38"
,
"ext"
:
".png"
},
{
"name"
:
"g37"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
6d3de9973a67e5ceba1400953bfb6f1c97e20697
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
54be9165464c72c73274424ba811ca297cba748c
.png"
,
"uuid"
:
"g37"
,
"ext"
:
".png"
},
{
"name"
:
"g36"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
620f1419ace61c7f32ea180a8f22cddd21f976aa
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
aae4011a2400b0f8653eb4355ec73a338a3a0d61
.png"
,
"uuid"
:
"g36"
,
"ext"
:
".png"
},
{
"name"
:
"g35"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
e8e2eae1199d60f79da5206fdbfb028db20ff76d
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
a40e4f7fc60a22562681573ba88c4dd43900461e
.png"
,
"uuid"
:
"g35"
,
"ext"
:
".png"
},
{
"name"
:
"g34"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
d9e7793207b2fcc30251d0886576d9d7fcb5e9ee
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
a25b8528764046567bddba363a0dc910d0ea7a28
.png"
,
"uuid"
:
"g34"
,
"ext"
:
".png"
},
{
"name"
:
"g33"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
3fa131f7f897c34fb379f7bf9c29747f3e69bf43
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
60689312961248d1469c63a60d67af7a53d0b659
.png"
,
"uuid"
:
"g33"
,
"ext"
:
".png"
},
{
"name"
:
"g32"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
3269880aaca62db34a6deb5199308adc0d25401
2.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
d78c7693b66d4a7716d741c37d3ed1e334265d4
2.png"
,
"uuid"
:
"g32"
,
"ext"
:
".png"
},
{
"name"
:
"g31"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
751067560cd76d7f9e5ceaa6b3f14479e55a69da
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
d16defc2eb95c09884287031e24f5ebc67c06f55
.png"
,
"uuid"
:
"g31"
,
"ext"
:
".png"
},
{
"name"
:
"g30"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/5
a3a283ecbf493d8773b31ccf2f723e91ed98d6c
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/5
50a9de40b797beb8b9504ea797004e29b415276
.png"
,
"uuid"
:
"g30"
,
"ext"
:
".png"
},
{
"name"
:
"g29"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
9b18c4e4ee1e8c841446fc595b8f0e211a454437
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
aaaf6a8c3c8e550ed34a5bcbf4881e924f9852cb
.png"
,
"uuid"
:
"g29"
,
"ext"
:
".png"
},
{
"name"
:
"g28"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
690129e1862415926738babe59f518b6b1b5cb4e
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
fce08988ad87102d726a8d3b90cef89fdc3d2d2a
.png"
,
"uuid"
:
"g28"
,
"ext"
:
".png"
},
{
"name"
:
"g27"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
17080c9fec412c3dc013fbc5c7507e5960aed1a3
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
fc9dc534b36263f05dff38ece12b8c8dfdcc4008
.png"
,
"uuid"
:
"g27"
,
"ext"
:
".png"
},
{
"name"
:
"g26"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
a34628a8370ee6b18a84e4b340ea3e199b88722d
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
e12f30a5a9035bcf9079c67ffdc0a61a4e9d2653
.png"
,
"uuid"
:
"g26"
,
"ext"
:
".png"
},
{
"name"
:
"g25"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
3fd8d25962065b95ea92d15ba8ed72650bd619f7
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
ea83372b1cc61bc68923748b9bb17cbdab9e0f84
.png"
,
"uuid"
:
"g25"
,
"ext"
:
".png"
},
{
"name"
:
"g24"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
c309687ae634221e99020cd22ffb08ffcc0d8302
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
98db6bd77d14c1ca262ce903fc3ee8f0bf34804b
.png"
,
"uuid"
:
"g24"
,
"ext"
:
".png"
},
{
"name"
:
"g23"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
c428c61edd2143dd29836545cadc5fb69035ee80
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
9d38482c8505f1483d32d8ca5960f02cbadfe044
.png"
,
"uuid"
:
"g23"
,
"ext"
:
".png"
},
{
"name"
:
"g22"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
2a147aa052d47ac0e06910e5df9ab1c932e34a92
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
6d6f4c7c6c4dd95e8cf448b3377c92ecfd462a0e
.png"
,
"uuid"
:
"g22"
,
"ext"
:
".png"
},
{
"name"
:
"g21"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
7ec81f1b13b8550effdf178101985fa31c50956a
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
5a8306bd5c826f10f785230b659df0c9eb3dbfcf
.png"
,
"uuid"
:
"g21"
,
"ext"
:
".png"
},
{
"name"
:
"g20"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
5b7500d82e6889e69fe24d605f253dfec0a42e39
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
e21d6e158e601c4677593e0779fed23cc91860e8
.png"
,
"uuid"
:
"g20"
,
"ext"
:
".png"
},
{
"name"
:
"g19"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
351ba4e8ca0c31caf69bc1b33917058e16970ef4
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
876d34e94dcc98b7d5457be79454042ec65c9fd6
.png"
,
"uuid"
:
"g19"
,
"ext"
:
".png"
},
{
"name"
:
"g18"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
29a63f67324429bcdaab1bb32bc944ff91bd47de
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
692aac3b874926dee775ffe0fd73f8c4e7e39bd3
.png"
,
"uuid"
:
"g18"
,
"ext"
:
".png"
},
{
"name"
:
"g17"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
8b65937268201d986f4307d2c50f9b7ab41eaaa2
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
ed14bd294d187104dc22ac0ecda28109a37593fa
.png"
,
"uuid"
:
"g17"
,
"ext"
:
".png"
},
{
"name"
:
"g16"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
8867de1b241ffa9f0c74a052a5b16ccc32c6fee6
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
1e21621783f6be0ba00b869e980cc3a869e53439
.png"
,
"uuid"
:
"g16"
,
"ext"
:
".png"
},
{
"name"
:
"g15"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
93973a7931aee434f47fa66630c73c77a7f6dcee
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
5fa0dc818ea9574f23adf091bdaa40d3cf6ccc11
.png"
,
"uuid"
:
"g15"
,
"ext"
:
".png"
},
{
"name"
:
"g14"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
433e648f4dbdc3d64e1661e91997f09f292cfec6
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
18d5086dbd7213a8a0ce7d8a159cba1f1e901d77
.png"
,
"uuid"
:
"g14"
,
"ext"
:
".png"
},
{
"name"
:
"g13"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
0763e6fb31df6b0c13d466592c06d040cd2f0914
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
63650960879b4d743b6954e1ec805684325af48d
.png"
,
"uuid"
:
"g13"
,
"ext"
:
".png"
},
{
"name"
:
"g12"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
6780831550258c98a024dda3dad66b38d47735c5
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
b3e66d60f64f00b248c762ce0df045eafe5f70d1
.png"
,
"uuid"
:
"g12"
,
"ext"
:
".png"
},
{
"name"
:
"g11"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
f0291b80012c07b9a6b000ae08f06117bc091ce4
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
9998bf5779dffe3097681a09ab97e7822f09ba92
.png"
,
"uuid"
:
"g11"
,
"ext"
:
".png"
},
{
"name"
:
"g10"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
ee55052e92922d7d4e8d103abc1b69f985bb32d2
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
337719d386e7979debaa3f8a58a17e416c474338
.png"
,
"uuid"
:
"g10"
,
"ext"
:
".png"
},
{
"name"
:
"g09"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
2ea8754293f74e08fe55496f7849804e6051b2ef
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
942bdcd7fd3475bc2a4af2f2b96fb1ad2ab659d9
.png"
,
"uuid"
:
"g09"
,
"ext"
:
".png"
},
{
"name"
:
"g08"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
0648601cff5448dcb1eea1db5e70f12376c695e5
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
1b8e1a03df623870576c063c04a4b8e1aef8bf72
.png"
,
"uuid"
:
"g08"
,
"ext"
:
".png"
},
{
"name"
:
"g07"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
b1a9a28a146a1ecb4dbd203fcae6c036a9acf041
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
95a5d437fe386cf9f6c52587c1d2db98f2d23f0c
.png"
,
"uuid"
:
"g07"
,
"ext"
:
".png"
},
{
"name"
:
"g06"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
db9fa8e9fbea957e9f02502d3fc7be96ad9e6edc
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
2d288b4f549d0e69c6b7fc6e863aaf10e3e2604d
.png"
,
"uuid"
:
"g06"
,
"ext"
:
".png"
},
{
"name"
:
"g05"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
f0d6ea6ba0fb0cda815910d5d2c5d7d1a0af0675
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
45c17615fdff30ed6584161a9cea26189239678e
.png"
,
"uuid"
:
"g05"
,
"ext"
:
".png"
},
{
"name"
:
"g04"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/f
b5bfe673bcadc393c15be3892e7223bf18a0a0b
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/f
fd3cffe53e031b5891bcfcfbcafa4443f6dc40e
.png"
,
"uuid"
:
"g04"
,
"ext"
:
".png"
},
{
"name"
:
"g03"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
79d84185ebddb82219e92187d11368a5c1eb650
5.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
a51f82e1a931ad7c9d5cb915c4f9b7fb3fac0de
5.png"
,
"uuid"
:
"g03"
,
"ext"
:
".png"
},
{
"name"
:
"g02"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
cf931a6dfd7d2938d31345c980b7caa22d515809
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
82699aa20a75cc5670b54a6bb4c83a8c56811fdf
.png"
,
"uuid"
:
"g02"
,
"ext"
:
".png"
},
{
"name"
:
"g01"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
0772e858d5337e5a52d17f6c6b0b9a7e79fa9c36
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
726ee984b6b56d75d2bd3d89b3c1c4714fb79314
.png"
,
"uuid"
:
"g01"
,
"ext"
:
".png"
},
{
"name"
:
"g00"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
38af7a09502570152c2f8238a93f6b35b40525d7
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
d2f1d01024247ea64cf35c610fec85f19dd89c21
.png"
,
"uuid"
:
"g00"
,
"ext"
:
".png"
}
],
"events"
:
{
"in"
:
{
...
...
src/custom/recycling/src/game/datas/GarbageConfig.ts
View file @
5e341b08
import
{
GarbageTypes
}
from
'./GarbageTypes'
;
export
default
class
GarbageConfig
{
public
static
config
:
any
[]
=
[
{
name
:
"
电池"
,
source
:
"g00"
,
type
:
GarbageTypes
.
harmfulWaste
,
width
:
51
,
height
:
123
},
{
name
:
"
温度计"
,
source
:
"g01"
,
type
:
GarbageTypes
.
harmfulWaste
,
width
:
65
,
height
:
130
},
{
name
:
"
鱼刺"
,
source
:
"g02"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
104
,
height
:
82
},
{
name
:
"
龙虾"
,
source
:
"g03"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
129
,
height
:
122
},
{
name
:
"
西瓜"
,
source
:
"g04"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
134
,
height
:
111
},
{
name
:
"
旧玩具"
,
source
:
"g05"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
72
,
height
:
135
},
{
name
:
"
口红"
,
source
:
"g06"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
49
,
height
:
134
},
{
name
:
"
面包"
,
source
:
"g07"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
96
,
height
:
128
},
{
name
:
"
绿植"
,
source
:
"g08"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
81
,
height
:
131
},
{
name
:
"
保温瓶"
,
source
:
"g09"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
66
,
height
:
137
},
{
name
:
"
破衣服"
,
source
:
"g10"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
91
,
height
:
121
},
{
name
:
"
茶叶渣"
,
source
:
"g11"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
108
,
height
:
125
},
{
name
:
"
湿巾"
,
source
:
"g12"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
106
,
height
:
109
},
{
name
:
"
过期药膏"
,
source
:
"g13"
,
type
:
GarbageTypes
.
harmfulWaste
,
width
:
107
,
height
:
130
},
{
name
:
"
用完的洗发水瓶"
,
source
:
"g14"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
153
,
height
:
148
},
{
name
:
"
婴儿纸尿裤"
,
source
:
"g15"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
108
,
height
:
123
},
{
name
:
"
香水瓶"
,
source
:
"g16"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
65
,
height
:
127
},
{
name
:
"
花甲壳"
,
source
:
"g17"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
99
,
height
:
115
},
{
name
:
"
过期调味料"
,
source
:
"g18"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
109
,
height
:
130
},
{
name
:
"
地毯"
,
source
:
"g19"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
145
,
height
:
119
},
{
name
:
"
甘蔗渣"
,
source
:
"g20"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
100
,
height
:
116
},
{
name
:
"
玻璃渣"
,
source
:
"g21"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
95
,
height
:
122
},
{
name
:
"
番茄酱"
,
source
:
"g22"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
82
,
height
:
125
},
{
name
:
"
酒精棉"
,
source
:
"g23"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
64
,
height
:
124
},
{
name
:
"
指甲油瓶子"
,
source
:
"g24"
,
type
:
GarbageTypes
.
harmfulWaste
,
width
:
109
,
height
:
125
},
{
name
:
"
肉骨头"
,
source
:
"g25"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
67
,
height
:
123
},
{
name
:
"
嚼过的口香糖"
,
source
:
"g26"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
135
,
height
:
116
},
{
name
:
"
充电插头"
,
source
:
"g27"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
86
,
height
:
128
},
{
name
:
"
旧报纸"
,
source
:
"g28"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
68
,
height
:
124
},
{
name
:
"
烟头"
,
source
:
"g29"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
108
,
height
:
145
},
{
name
:
"
奶茶塑料杯"
,
source
:
"g30"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
109
,
height
:
143
},
{
name
:
"
瓜子壳"
,
source
:
"g31"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
87
,
height
:
121
},
{
name
:
"
橘子皮"
,
source
:
"g32"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
78
,
height
:
120
},
{
name
:
"
气球"
,
source
:
"g33"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
78
,
height
:
12
1
},
{
name
:
"
树叶"
,
source
:
"g34"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
75
,
height
:
117
},
{
name
:
"
感冒药"
,
source
:
"g35"
,
type
:
GarbageTypes
.
harmfulWaste
,
width
:
92
,
height
:
121
},
{
name
:
"
电话机"
,
source
:
"g36"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
63
,
height
:
121
},
{
name
:
"
奶酪"
,
source
:
"g37"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
90
,
height
:
116
},
{
name
:
"
啤酒瓶"
,
source
:
"g38"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
64
,
height
:
123
},
{
name
:
"
薯片包装"
,
source
:
"g39"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
134
,
height
:
123
},
{
name
:
"
过期保健品
"
,
source
:
"g40"
,
type
:
GarbageTypes
.
harmfulWaste
,
width
:
108
,
height
:
125
},
{
name
:
"
雪糕包装袋"
,
source
:
"g41"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
109
,
height
:
128
},
{
name
:
"
废油漆"
,
source
:
"g42"
,
type
:
GarbageTypes
.
harmfulWaste
,
width
:
98
,
height
:
122
},
{
name
:
"
食品罐头"
,
source
:
"g43"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
94
,
height
:
117
},
{
name
:
"
陶瓷碗"
,
source
:
"g44"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
105
,
height
:
122
},
{
name
:
"
蚊香"
,
source
:
"g45"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
69
,
height
:
146
},
{
name
:
"
电脑机箱"
,
source
:
"g46"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
84
,
height
:
124
},
{
name
:
"
鲜花"
,
source
:
"g47"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
62
,
height
:
122
},
{
name
:
"
宠物粮食"
,
source
:
"g48"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
87
,
height
:
121
},
{
name
:
"
银行卡"
,
source
:
"g49"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
115
,
height
:
123
},
{
name
:
"
保鲜盒"
,
source
:
"g00"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
129
,
height
:
111
},
{
name
:
"
报纸"
,
source
:
"g01"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
138
,
height
:
144
},
{
name
:
"
贝壳"
,
source
:
"g02"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
79
,
height
:
117
},
{
name
:
"
冰箱"
,
source
:
"g03"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
63
,
height
:
151
},
{
name
:
"
菜梗菜叶"
,
source
:
"g04"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
144
,
height
:
98
},
{
name
:
"
残枝落叶"
,
source
:
"g05"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
120
,
height
:
99
},
{
name
:
"
茶叶渣"
,
source
:
"g06"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
86
,
height
:
96
},
{
name
:
"
尘土"
,
source
:
"g07"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
109
,
height
:
114
},
{
name
:
"
创可贴"
,
source
:
"g08"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
112
,
height
:
90
},
{
name
:
"
大骨头"
,
source
:
"g09"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
89
,
height
:
101
},
{
name
:
"
灯泡"
,
source
:
"g10"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
84
,
height
:
104
},
{
name
:
"
电池"
,
source
:
"g11"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
89
,
height
:
131
},
{
name
:
"
方便面盒"
,
source
:
"g12"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
89
,
height
:
168
},
{
name
:
"
废弃食用油脂"
,
source
:
"g13"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
131
,
height
:
164
},
{
name
:
"
骨骼内脏"
,
source
:
"g14"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
104
,
height
:
82
},
{
name
:
"
锅具"
,
source
:
"g15"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
119
,
height
:
149
},
{
name
:
"
果核"
,
source
:
"g16"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
99
,
height
:
95
},
{
name
:
"
果皮"
,
source
:
"g17"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
115
,
height
:
127
},
{
name
:
"
化妆品"
,
source
:
"g18"
,
type
:
GarbageTypes
.
harmfulWaste
,
width
:
67
,
height
:
151
},
{
name
:
"
鸡蛋壳"
,
source
:
"g19"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
99
,
height
:
107
},
{
name
:
"
剪刀"
,
source
:
"g20"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
96
,
height
:
127
},
{
name
:
"
胶带"
,
source
:
"g21"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
87
,
height
:
113
},
{
name
:
"
榴莲壳"
,
source
:
"g22"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
136
,
height
:
116
},
{
name
:
"
毛巾"
,
source
:
"g23"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
108
,
height
:
96
},
{
name
:
"
纽扣电池"
,
source
:
"g24"
,
type
:
GarbageTypes
.
harmfulWaste
,
width
:
87
,
height
:
89
},
{
name
:
"
破旧陶瓷罐"
,
source
:
"g25"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
110
,
height
:
125
},
{
name
:
"
杀虫剂"
,
source
:
"g26"
,
type
:
GarbageTypes
.
harmfulWaste
,
width
:
64
,
height
:
160
},
{
name
:
"
剩菜剩饭"
,
source
:
"g27"
,
type
:
GarbageTypes
.
wetWaste
,
width
:
128
,
height
:
96
},
{
name
:
"
手机"
,
source
:
"g28"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
82
,
height
:
142
},
{
name
:
"
书本"
,
source
:
"g29"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
106
,
height
:
132
},
{
name
:
"
水杯"
,
source
:
"g30"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
62
,
height
:
119
},
{
name
:
"
水银温度计"
,
source
:
"g31"
,
type
:
GarbageTypes
.
harmfulWaste
,
width
:
109
,
height
:
162
},
{
name
:
"
水银血压计"
,
source
:
"g32"
,
type
:
GarbageTypes
.
harmfulWaste
,
width
:
115
,
height
:
147
},
{
name
:
"
塑料桶"
,
source
:
"g33"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
92
,
height
:
13
1
},
{
name
:
"
卫生纸"
,
source
:
"g34"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
92
,
height
:
132
},
{
name
:
"
污染织物"
,
source
:
"g35"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
128
,
height
:
139
},
{
name
:
"
污染纸张"
,
source
:
"g36"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
96
,
height
:
136
},
{
name
:
"
洗衣机"
,
source
:
"g37"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
87
,
height
:
157
},
{
name
:
"
烟蒂"
,
source
:
"g38"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
87
,
height
:
124
},
{
name
:
"
药品"
,
source
:
"g39"
,
type
:
GarbageTypes
.
harmfulWaste
,
width
:
109
,
height
:
131
},
{
name
:
"
药品包装
"
,
source
:
"g40"
,
type
:
GarbageTypes
.
harmfulWaste
,
width
:
108
,
height
:
125
},
{
name
:
"
椰子壳"
,
source
:
"g41"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
104
,
height
:
119
},
{
name
:
"
衣服"
,
source
:
"g42"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
83
,
height
:
137
},
{
name
:
"
衣架"
,
source
:
"g43"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
132
,
height
:
125
},
{
name
:
"
易拉罐"
,
source
:
"g44"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
65
,
height
:
133
},
{
name
:
"
荧光灯"
,
source
:
"g45"
,
type
:
GarbageTypes
.
harmfulWaste
,
width
:
90
,
height
:
118
},
{
name
:
"
油漆桶"
,
source
:
"g46"
,
type
:
GarbageTypes
.
harmfulWaste
,
width
:
65
,
height
:
143
},
{
name
:
"
纸杯"
,
source
:
"g47"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
76
,
height
:
116
},
{
name
:
"
纸尿裤"
,
source
:
"g48"
,
type
:
GarbageTypes
.
dryWaste
,
width
:
93
,
height
:
138
},
{
name
:
"
纸箱"
,
source
:
"g49"
,
type
:
GarbageTypes
.
recoverableWaste
,
width
:
112
,
height
:
118
},
{
name
:
"指甲油"
,
source
:
"g50"
,
type
:
GarbageTypes
.
harmfulWaste
,
width
:
64
,
height
:
138
},
];
}
\ No newline at end of file
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment