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
87951f14
Commit
87951f14
authored
Jun 12, 2020
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
716c4811
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
19 deletions
+48
-19
recycling.json
dist/customs/recycling.json
+8
-4
app.js
src/custom/recycling/debug/app.js
+7
-4
main.js
src/custom/recycling/debug/main.js
+1
-1
main.js.map
src/custom/recycling/debug/main.js.map
+1
-1
GameView.ts
src/custom/recycling/src/game/GameView.ts
+31
-9
No files found.
dist/customs/recycling.json
View file @
87951f14
This diff is collapsed.
Click to expand it.
src/custom/recycling/debug/app.js
View file @
87951f14
...
...
@@ -51,15 +51,18 @@ function launchWithCustomModule(customModule) {
const
d
=
engine
.
gameStage
.
sceneContainer
.
getChildAt
(
0
);
},
200
);
setTimeout
(()
=>
{
engine
.
globalEvent
.
dispatchEvent
(
'recycling-start'
,
{
time
:
2
});
//
setTimeout(() => {
//
engine.globalEvent.dispatchEvent('recycling-start', { time: 2 });
const
d
=
engine
.
gameStage
.
sceneContainer
.
getChildAt
(
0
);
},
1000
*
10
);
//
const d = engine.gameStage.sceneContainer.getChildAt(0);
//
}, 1000 * 10);
});
engine
.
globalEvent
.
addEventListener
(
'recycling-time-update'
,
(
e
)
=>
{
console
.
log
(
e
.
type
,
e
.
data
);
});
engine
.
globalEvent
.
addEventListener
(
'recycling-score-update'
,
(
e
)
=>
{
console
.
log
(
e
.
type
,
e
.
data
);
});
engine
.
globalEvent
.
addEventListener
(
'recycling-game-end'
,
(
e
)
=>
{
console
.
log
(
e
.
type
,
e
.
data
);
});
...
...
src/custom/recycling/debug/main.js
View file @
87951f14
This diff is collapsed.
Click to expand it.
src/custom/recycling/debug/main.js.map
View file @
87951f14
This diff is collapsed.
Click to expand it.
src/custom/recycling/src/game/GameView.ts
View file @
87951f14
...
...
@@ -103,17 +103,22 @@ export default class GameView extends engine.Container {
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
},
3
000
);
engine
.
Tween
.
get
(
i
,
{
loop
:
true
}).
to
({
rotation
:
-
360
},
1
000
);
})
}
stopAni
()
{
let
idlerWheels
=
[
'idler0'
,
'idler1'
,
'idler2'
,
'idler3'
,
'idler4'
,
'idler5'
,
'idler6'
];
idlerWheels
=
idlerWheels
.
map
(
i
=>
this
.
uiMap
[
i
]);
idlerWheels
.
forEach
(
i
=>
{
engine
.
Tween
.
removeTweens
(
i
);
})
}
async
start
()
{
console
.
log
(
'on start'
)
this
.
_timeCounter
=
0
;
this
.
score
=
0
;
if
(
!
getGuideInfo
())
{
await
this
.
guide
.
startGuide
();
...
...
@@ -122,8 +127,7 @@ export default class GameView extends engine.Container {
await
this
.
countdown
.
startCountDown
();
this
.
playAni
();
this
.
startGame
();
engine
.
globalEvent
.
dispatchEvent
(
'recycling-time-update'
,
{
second
:
this
.
getSecond
(),
...
...
@@ -134,25 +138,43 @@ export default class GameView extends engine.Container {
},
1000
)
}
getSecond
()
{
private
startGame
()
{
this
.
playAni
();
this
.
stage
.
addEventListener
(
engine
.
MouseEvent
.
CLICK
,
this
.
xxx
,
this
);
}
private
xxx
()
{
this
.
score
++
;
engine
.
globalEvent
.
dispatchEvent
(
'recycling-score-update'
,
{
score
:
this
.
score
});
}
private
stopGame
()
{
this
.
stage
.
removeEventListener
(
engine
.
MouseEvent
.
CLICK
,
this
.
xxx
,
this
);
this
.
stopAni
();
}
getSecond
()
{
return
props
.
time
-
this
.
_timeCounter
}
}
onTimer
()
{
this
.
_timeCounter
++
;
engine
.
globalEvent
.
dispatchEvent
(
'recycling-time-update'
,
{
second
:
this
.
getSecond
(),
});
if
(
this
.
getSecond
()
==
0
)
{
this
.
stop
();
engine
.
globalEvent
.
dispatchEvent
(
'recycling-game-end'
,
{
});
engine
.
globalEvent
.
dispatchEvent
(
'recycling-game-end'
,
{});
}
}
stop
()
{
clearInterval
(
this
.
_timer
);
this
.
stopGame
();
}
setup
()
{
...
...
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