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
1e4a3038
Commit
1e4a3038
authored
Jun 12, 2020
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
b182001e
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
32081 additions
and
46 deletions
+32081
-46
recycling.json
dist/customs/recycling.json
+7
-1
app.js
src/custom/recycling/debug/app.js
+1
-1
engine.1de84ff79dba19e949088de63aa75af51a515e5c.js
.../debug/engine.1de84ff79dba19e949088de63aa75af51a515e5c.js
+21760
-0
index.html
src/custom/recycling/debug/index.html
+40
-42
main.js
src/custom/recycling/debug/main.js
+54
-0
main.js.map
src/custom/recycling/debug/main.js.map
+1
-1
svga.fd3923ae6e664251ca7981801a65809cc5f36bc3.js
...ng/debug/svga.fd3923ae6e664251ca7981801a65809cc5f36bc3.js
+10147
-0
meta.json
src/custom/recycling/meta.json
+6
-0
Conveyor.ts
src/custom/recycling/src/game/Conveyor.ts
+36
-0
GameView.ts
src/custom/recycling/src/game/GameView.ts
+29
-1
No files found.
dist/customs/recycling.json
View file @
1e4a3038
This diff is collapsed.
Click to expand it.
src/custom/recycling/debug/app.js
View file @
1e4a3038
...
@@ -49,7 +49,7 @@ function launchWithCustomModule(customModule) {
...
@@ -49,7 +49,7 @@ function launchWithCustomModule(customModule) {
engine
.
globalEvent
.
dispatchEvent
(
'recycling-start'
,
{});
engine
.
globalEvent
.
dispatchEvent
(
'recycling-start'
,
{});
const
d
=
engine
.
gameStage
.
sceneContainer
.
getChildAt
(
0
);
const
d
=
engine
.
gameStage
.
sceneContainer
.
getChildAt
(
0
);
},
10
00
);
},
2
00
);
});
});
engine
.
globalEvent
.
addEventListener
(
'recycling-time-update'
,
(
e
)
=>
{
engine
.
globalEvent
.
addEventListener
(
'recycling-time-update'
,
(
e
)
=>
{
// console.log(e.type, e.data);
// console.log(e.type, e.data);
...
...
src/custom/recycling/debug/engine.1de84ff79dba19e949088de63aa75af51a515e5c.js
0 → 100644
View file @
1e4a3038
This diff is collapsed.
Click to expand it.
src/custom/recycling/debug/index.html
View file @
1e4a3038
...
@@ -2,50 +2,48 @@
...
@@ -2,50 +2,48 @@
<html
lang=
"en"
>
<html
lang=
"en"
>
<head>
<head>
<meta
charset=
"UTF-8"
>
<meta
charset=
"UTF-8"
>
<title>
美食从天而降
</title>
<title>
美食从天而降
</title>
<meta
name=
"viewport"
<meta
name=
"viewport"
content=
"width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"
/>
content=
"width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"
/>
<meta
name=
"apple-mobile-web-app-capable"
content=
"yes"
/>
<meta
name=
"apple-mobile-web-app-capable"
content=
"yes"
/>
<meta
name=
"full-screen"
content=
"true"
/>
<meta
name=
"full-screen"
content=
"true"
/>
<meta
name=
"screen-orientation"
content=
"portrait"
/>
<meta
name=
"screen-orientation"
content=
"portrait"
/>
<meta
name=
"x5-fullscreen"
content=
"true"
/>
<meta
name=
"x5-fullscreen"
content=
"true"
/>
<meta
name=
"360-fullscreen"
content=
"true"
/>
<meta
name=
"360-fullscreen"
content=
"true"
/>
<style>
<style>
html
,
html
,
body
{
body
{
padding
:
0
;
padding
:
0
;
margin
:
0
;
margin
:
0
;
border
:
0
;
border
:
0
;
width
:
100%
;
height
:
100%
;
width
:
100%
;
overflow
:
hidden
;
height
:
100%
;
position
:
absolute
;
overflow
:
hidden
;
background-color
:
gray
;
position
:
absolute
;
}
background-color
:
gray
;
}
.game-container
{
.game-container
{
width
:
100%
;
width
:
100%
;
height
:
100%
;
height
:
100%
;
line-height
:
0
;
line-height
:
0
;
font-size
:
0
;
font-size
:
0
;
}
}
</style>
</style>
</head>
</head>
<body>
<body>
<div
id=
"game-container"
class=
"game-container"
></div>
<div
id=
"game-container"
class=
"game-container"
></div>
<script
crossorigin=
"anonymous"
src=
"//yun.duiba.com.cn/editor/zeroing/libs/
engine.1de84ff79dba19e949088de63aa75af51a515e5c.js"
></script>
<script
crossorigin=
"anonymous"
src=
"
engine.1de84ff79dba19e949088de63aa75af51a515e5c.js"
></script>
<script
crossorigin=
"anonymous"
src=
"//yun.duiba.com.cn/editor/zeroing/libs/
svga.fd3923ae6e664251ca7981801a65809cc5f36bc3.js"
></script>
<script
crossorigin=
"anonymous"
src=
"
svga.fd3923ae6e664251ca7981801a65809cc5f36bc3.js"
></script>
<!-- <script src="//yun.duiba.com.cn/editor/zeroing/libs/engine.ebc906f6b50b8da0a669f77027981d5f3cb560ce.js"></script> -->
<!-- <script src="//yun.duiba.com.cn/editor/zeroing/libs/engine.ebc906f6b50b8da0a669f77027981d5f3cb560ce.js"></script> -->
<!-- <script src="http://localhost:4002/debug/engine.js"></script>
<!-- <script src="http://localhost:4002/debug/engine.js"></script>
<script src="http://localhost:4003/debug/engine-svga.js"></script> -->
<script src="http://localhost:4003/debug/engine-svga.js"></script> -->
<!--<script src="//yun.duiba.com.cn/editor/zeroing/libs/engine.9a9dbfda4cb2dd5508ecddfe3d95dfd88063f7b5.js"></script>-->
<!--<script src="//yun.duiba.com.cn/editor/zeroing/libs/engine.9a9dbfda4cb2dd5508ecddfe3d95dfd88063f7b5.js"></script>-->
<script
src=
"app.js"
></script>
<script
src=
"app.js"
></script>
<script
src=
"props.js"
></script>
<script
src=
"props.js"
></script>
<script
src=
"load-assets.js"
></script>
<script
src=
"load-assets.js"
></script>
<script
src=
"main.js"
></script>
<script
src=
"main.js"
></script>
<script>
<script>
</script>
</script>
</body>
</body>
\ No newline at end of file
src/custom/recycling/debug/main.js
View file @
1e4a3038
...
@@ -74,6 +74,34 @@
...
@@ -74,6 +74,34 @@
});
});
//# sourceMappingURL=uiConfig.js.map
//# sourceMappingURL=uiConfig.js.map
var
Conveyor
=
(
function
(
_super
)
{
tslib
.
__extends
(
Conveyor
,
_super
);
function
Conveyor
()
{
var
_this
=
_super
.
call
(
this
)
||
this
;
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
.
createItem
=
function
(
x
,
y
)
{
var
sp
=
new
engine
.
Sprite
();
this
.
addChild
(
sp
);
sp
.
x
=
x
-
50
;
sp
.
y
=
y
-
50
;
var
g
=
new
engine
.
Graphics
;
g
.
beginFill
(
0xff0000
);
g
.
drawRect
(
0
,
0
,
100
,
100
);
g
.
endFill
();
sp
.
addChild
(
g
);
return
sp
;
};
return
Conveyor
;
}(
engine
.
Sprite
));
var
GameView
=
(
function
(
_super
)
{
var
GameView
=
(
function
(
_super
)
{
tslib
.
__extends
(
GameView
,
_super
);
tslib
.
__extends
(
GameView
,
_super
);
function
GameView
()
{
function
GameView
()
{
...
@@ -83,12 +111,15 @@
...
@@ -83,12 +111,15 @@
return
_this
;
return
_this
;
}
}
GameView
.
prototype
.
configUI
=
function
()
{
GameView
.
prototype
.
configUI
=
function
()
{
var
uiMap
=
{};
this
.
uiMap
=
uiMap
;
var
config
=
uiConfig
();
var
config
=
uiConfig
();
for
(
var
_i
=
0
,
config_1
=
config
;
_i
<
config_1
.
length
;
_i
++
)
{
for
(
var
_i
=
0
,
config_1
=
config
;
_i
<
config_1
.
length
;
_i
++
)
{
var
item
=
config_1
[
_i
];
var
item
=
config_1
[
_i
];
var
id
=
item
.
id
,
texture
=
item
.
texture
,
pos
=
item
.
pos
,
anchor
=
item
.
anchor
;
var
id
=
item
.
id
,
texture
=
item
.
texture
,
pos
=
item
.
pos
,
anchor
=
item
.
anchor
;
var
sp
=
new
engine
.
Sprite
(
getTextureByName
(
texture
));
var
sp
=
new
engine
.
Sprite
(
getTextureByName
(
texture
));
this
.
addChild
(
sp
);
this
.
addChild
(
sp
);
uiMap
[
id
]
=
sp
;
if
(
anchor
)
{
if
(
anchor
)
{
sp
.
anchorX
=
anchor
[
0
];
sp
.
anchorX
=
anchor
[
0
];
sp
.
anchorY
=
anchor
[
1
];
sp
.
anchorY
=
anchor
[
1
];
...
@@ -102,8 +133,30 @@
...
@@ -102,8 +133,30 @@
}
}
}
}
}
}
this
.
configConveyors
();
};
GameView
.
prototype
.
configConveyors
=
function
()
{
var
conveyor1
=
new
Conveyor
();
conveyor1
.
x
=
0
;
conveyor1
.
y
=
904.21
;
var
conveyor2
=
new
Conveyor
();
this
.
addChild
(
conveyor1
);
this
.
addChild
(
conveyor2
);
conveyor2
.
x
=
764
;
conveyor2
.
y
=
904.21
;
};
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
},
3000
);
});
};
GameView
.
prototype
.
stopAni
=
function
()
{
};
};
GameView
.
prototype
.
start
=
function
()
{
GameView
.
prototype
.
start
=
function
()
{
this
.
playAni
();
return
;
return
;
};
};
GameView
.
prototype
.
getSecond
=
function
()
{
return
0
;
};
GameView
.
prototype
.
getSecond
=
function
()
{
return
0
;
};
...
@@ -135,6 +188,7 @@
...
@@ -135,6 +188,7 @@
};
};
return
GameView
;
return
GameView
;
}(
engine
.
Container
));
}(
engine
.
Container
));
//# sourceMappingURL=GameView.js.map
var
GameWrapper
=
(
function
(
_super
)
{
var
GameWrapper
=
(
function
(
_super
)
{
tslib
.
__extends
(
GameWrapper
,
_super
);
tslib
.
__extends
(
GameWrapper
,
_super
);
...
...
src/custom/recycling/debug/main.js.map
View file @
1e4a3038
This diff is collapsed.
Click to expand it.
src/custom/recycling/debug/svga.fd3923ae6e664251ca7981801a65809cc5f36bc3.js
0 → 100644
View file @
1e4a3038
This diff is collapsed.
Click to expand it.
src/custom/recycling/meta.json
View file @
1e4a3038
...
@@ -19,6 +19,12 @@
...
@@ -19,6 +19,12 @@
"url"
:
"//yun.duiba.com.cn/aurora/assets/2a06e8c7b49d8e53955359f7a6dc5bd887978c21.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/2a06e8c7b49d8e53955359f7a6dc5bd887978c21.png"
,
"uuid"
:
"c21d9b0f-1aec-40c8-bb2b-7e674506b833"
,
"uuid"
:
"c21d9b0f-1aec-40c8-bb2b-7e674506b833"
,
"ext"
:
".png"
"ext"
:
".png"
},
{
"name"
:
"conveyor"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/0015de48d63d00dafe730b43141d747f47069237.png"
,
"uuid"
:
"4176aa04-d943-444e-beca-5ecc1313b059"
,
"ext"
:
".png"
}
}
],
],
...
...
src/custom/recycling/src/game/Conveyor.ts
0 → 100644
View file @
1e4a3038
import
{
getTextureByName
}
from
"./utils"
;
export
default
class
Conveyor
extends
engine
.
Sprite
{
idx0
:
engine
.
Sprite
;
idx1
:
engine
.
Sprite
;
idx2
:
engine
.
Sprite
;
idx3
:
engine
.
Sprite
;
idx4
:
engine
.
Sprite
;
constructor
()
{
super
();
const
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
);
}
createItem
(
x
,
y
)
{
const
sp
=
new
engine
.
Sprite
();
this
.
addChild
(
sp
);
sp
.
x
=
x
-
50
;
sp
.
y
=
y
-
50
;
const
g
=
new
engine
.
Graphics
;
g
.
beginFill
(
0xff0000
);
g
.
drawRect
(
0
,
0
,
100
,
100
);
g
.
endFill
();
sp
.
addChild
(
g
);
return
sp
}
}
\ No newline at end of file
src/custom/recycling/src/game/GameView.ts
View file @
1e4a3038
...
@@ -5,10 +5,12 @@
...
@@ -5,10 +5,12 @@
import
{
getTextureByName
}
from
"../../../recycling/src/game/utils"
;
import
{
getTextureByName
}
from
"../../../recycling/src/game/utils"
;
import
{
props
}
from
"../props"
;
import
{
props
}
from
"../props"
;
import
uiConfig
from
"./uiConfig"
;
import
uiConfig
from
"./uiConfig"
;
import
Conveyor
from
"./Conveyor"
;
export
default
class
GameView
extends
engine
.
Container
{
export
default
class
GameView
extends
engine
.
Container
{
private
_timer
;
private
_timer
;
private
_timeCounter
=
0
;
private
_timeCounter
=
0
;
uiMap
:
any
;
constructor
()
{
constructor
()
{
super
();
super
();
...
@@ -18,11 +20,13 @@ export default class GameView extends engine.Container {
...
@@ -18,11 +20,13 @@ export default class GameView extends engine.Container {
configUI
()
{
configUI
()
{
const
uiMap
:
any
=
{};
const
uiMap
:
any
=
{};
this
.
uiMap
=
uiMap
;
const
config
=
uiConfig
();
const
config
=
uiConfig
();
for
(
const
item
of
config
)
{
for
(
const
item
of
config
)
{
const
{
id
,
texture
,
pos
,
anchor
}
=
item
;
const
{
id
,
texture
,
pos
,
anchor
}
=
item
;
const
sp
=
new
engine
.
Sprite
(
getTextureByName
(
texture
));
const
sp
=
new
engine
.
Sprite
(
getTextureByName
(
texture
));
this
.
addChild
(
sp
);
this
.
addChild
(
sp
);
uiMap
[
id
]
=
sp
;
if
(
anchor
)
{
if
(
anchor
)
{
sp
.
anchorX
=
anchor
[
0
];
sp
.
anchorX
=
anchor
[
0
];
sp
.
anchorY
=
anchor
[
1
];
sp
.
anchorY
=
anchor
[
1
];
...
@@ -37,10 +41,34 @@ export default class GameView extends engine.Container {
...
@@ -37,10 +41,34 @@ export default class GameView extends engine.Container {
}
}
}
}
this
.
configConveyors
();
}
}
start
()
{
private
configConveyors
()
{
const
conveyor1
=
new
Conveyor
();
conveyor1
.
x
=
0
;
conveyor1
.
y
=
904.21
;
const
conveyor2
=
new
Conveyor
();
this
.
addChild
(
conveyor1
);
this
.
addChild
(
conveyor2
);
conveyor2
.
x
=
764
;
conveyor2
.
y
=
904.21
;
}
playAni
()
{
let
idlerWheels
=
[
'idler0'
,
'idler1'
,
'idler2'
,
'idler3'
,
'idler4'
,
'idler5'
,
'idler6'
];
idlerWheels
=
idlerWheels
.
map
(
i
=>
this
.
uiMap
[
i
]);
idlerWheels
.
forEach
(
i
=>
{
engine
.
Tween
.
get
(
i
,{
loop
:
true
}).
to
({
rotation
:
360
},
3000
);
})
}
stopAni
()
{
}
start
()
{
this
.
playAni
();
// const bg = new engine.Sprite(getTextureByName('playBg'));
// const bg = new engine.Sprite(getTextureByName('playBg'));
// this.addChild(bg);
// this.addChild(bg);
...
...
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