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
7b597ba5
Commit
7b597ba5
authored
Aug 04, 2020
by
lujinlei
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://gitlab2.dui88.com/laoqifeng/zeroing-libs
into dev
parents
26380604
777d61b4
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
99 additions
and
4 deletions
+99
-4
main.js.map
src/custom/dxbcyj-game/debug/main.js.map
+1
-1
GameWrapper.ts
src/custom/dxbcyj-game/src/game/GameWrapper.ts
+0
-1
main.js.map
src/custom/pick-tea/debug/main.js.map
+1
-1
GameView.ts
src/custom/pick-tea/src/game/GameView.ts
+0
-1
Goods.ts
src/custom/pick-tea/src/game/Goods.ts
+83
-0
object-pool-init.ts
src/custom/pick-tea/src/game/object-pool-init.ts
+14
-0
No files found.
src/custom/dxbcyj-game/debug/main.js.map
View file @
7b597ba5
src/custom/dxbcyj-game/src/game/GameWrapper.ts
View file @
7b597ba5
...
@@ -23,5 +23,4 @@ export class GameWrapper extends engine.Container {
...
@@ -23,5 +23,4 @@ export class GameWrapper extends engine.Container {
start
(
event
:
engine
.
Event
)
{
start
(
event
:
engine
.
Event
)
{
this
.
_gameView
.
start
(
event
.
data
.
guide
);
this
.
_gameView
.
start
(
event
.
data
.
guide
);
}
}
}
}
src/custom/pick-tea/debug/main.js.map
View file @
7b597ba5
src/custom/pick-tea/src/game/GameView.ts
View file @
7b597ba5
...
@@ -468,7 +468,6 @@ export default class GameView extends engine.Container {
...
@@ -468,7 +468,6 @@ export default class GameView extends engine.Container {
//按照采茶叶的多少来 设置茶叶是不是满的图片
//按照采茶叶的多少来 设置茶叶是不是满的图片
let
teaBucketframes
=
JSON
.
parse
(
JSON
.
stringify
(
originframes
.
frames
));
let
teaBucketframes
=
JSON
.
parse
(
JSON
.
stringify
(
originframes
.
frames
));
//let teaNumImg = this.teaHalfImg;
//let teaNumImg = this.teaHalfImg;
if
(
teaPercentage
==
1
)
{
if
(
teaPercentage
==
1
)
{
this
.
teaHalfImg
=
new
engine
.
Image
(
getTextureByName
(
'茶叶-少'
));
this
.
teaHalfImg
=
new
engine
.
Image
(
getTextureByName
(
'茶叶-少'
));
}
}
...
...
src/custom/pick-tea/src/game/Goods.ts
0 → 100644
View file @
7b597ba5
/**
* Created by rockyl on 2020-02-02.
*
* 掉落物品
*/
import
{
getTextureByName
}
from
"./utils"
;
import
{
props
}
from
"../props"
;
export
class
Goods
extends
engine
.
Container
{
private
_body
:
engine
.
Rect
private
_toY
;
constructor
()
{
super
();
let
body
body
=
this
.
_body
=
new
engine
.
Rect
()
let
rain
=
new
engine
.
Sprite
(
getTextureByName
(
'雨滴'
));
rain
[
"npcType"
]
=
"rain"
let
stone
=
new
engine
.
Sprite
(
getTextureByName
(
'石块'
));
stone
[
"npcType"
]
=
"stone"
let
boom
=
new
engine
.
Sprite
(
getTextureByName
(
'炸弹'
));
boom
[
"npcType"
]
=
"boom"
rain
.
visible
=
false
;
stone
.
visible
=
false
;
boom
.
visible
=
false
;
body
.
addChild
(
rain
)
body
.
addChild
(
stone
)
body
.
addChild
(
boom
)
this
.
addChild
(
body
);
body
.
width
=
.
0001
;
body
.
height
=
.
0001
;
body
.
mouseEnabled
=
false
;
}
getRandomNumberByRange
(
start
,
end
)
{
return
Math
.
floor
(
Math
.
random
()
*
(
end
-
start
)
+
start
)
}
reset
()
{
this
.
visible
=
true
;
this
.
rotation
=
0
;
this
.
anchorOffsetY
=
0
;
this
.
y
=
0
;
this
.
x
=
(
750
-
120
)
*
Math
.
random
()
+
30
;
this
.
rotation
=
0
;
let
random
=
Math
.
random
()
if
(
random
<
props
.
goodsProbability
[
0
]){
this
.
showNpc
(
"rain"
)
}
else
if
(
random
>=
props
.
goodsProbability
[
0
]
&&
random
<=
(
props
.
goodsProbability
[
0
]
+
props
.
goodsProbability
[
1
])){
this
.
showNpc
(
"stone"
)
}
else
if
(
random
>
(
props
.
goodsProbability
[
0
]
+
props
.
goodsProbability
[
1
])){
this
.
showNpc
(
"boom"
)
}
}
showNpc
(
type
){
for
(
let
i
=
0
;
i
<
this
.
_body
.
children
.
length
;
i
++
){
this
.
_body
.
children
[
i
].
visible
=
false
;
this
.
_body
.
children
[
i
].
mouseEnabled
=
false
;
}
for
(
let
i
=
0
;
i
<
this
.
_body
.
children
.
length
;
i
++
){
if
(
this
.
_body
.
children
[
i
][
"npcType"
]
==
type
){
this
[
"npcType"
]
=
type
this
.
_body
.
children
[
i
].
visible
=
true
;
this
.
_body
.
children
[
i
].
mouseEnabled
=
false
;
}
}
}
set
anchorOffsetY
(
v
)
{
this
.
_body
.
y
=
v
;
}
}
src/custom/pick-tea/src/game/object-pool-init.ts
0 → 100644
View file @
7b597ba5
/**
* Created by rockyl on 2020-02-03.
*/
import
{
Goods
}
from
"./Goods"
;
import
ObjectPool
=
engine
.
ObjectPool
;
export
const
PoolName
:
string
=
'goods'
;
ObjectPool
.
registerPool
(
PoolName
,
function
()
{
return
new
Goods
();
},
function
(
item
:
Goods
,
data
)
{
item
.
reset
();
});
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