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
7393d156
Commit
7393d156
authored
Mar 27, 2020
by
13732208043
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
最新采茶叶
parent
af3ba169
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
217 additions
and
202 deletions
+217
-202
pick-tea.json
dist/customs/pick-tea.json
+215
-0
main.js
src/custom/pick-tea/debug/main.js
+1
-82
main.js.map
src/custom/pick-tea/debug/main.js.map
+1
-1
GameView.ts
src/custom/pick-tea/src/game/GameView.ts
+0
-22
Goods.ts
src/custom/pick-tea/src/game/Goods.ts
+0
-83
object-pool-init.ts
src/custom/pick-tea/src/game/object-pool-init.ts
+0
-14
No files found.
dist/customs/pick-tea.json
0 → 100644
View file @
7393d156
This diff is collapsed.
Click to expand it.
src/custom/pick-tea/debug/main.js
View file @
7393d156
...
@@ -27,85 +27,6 @@
...
@@ -27,85 +27,6 @@
}
}
//# sourceMappingURL=utils.js.map
//# sourceMappingURL=utils.js.map
var
Goods
=
(
function
(
_super
)
{
tslib
.
__extends
(
Goods
,
_super
);
function
Goods
()
{
var
_this
=
_super
.
call
(
this
)
||
this
;
var
body
;
body
=
_this
.
_body
=
new
engine
.
Rect
();
var
rain
=
new
engine
.
Sprite
(
getTextureByName
(
'雨滴'
));
rain
[
"npcType"
]
=
"rain"
;
var
stone
=
new
engine
.
Sprite
(
getTextureByName
(
'石块'
));
stone
[
"npcType"
]
=
"stone"
;
var
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
;
return
_this
;
}
Goods
.
prototype
.
getRandomNumberByRange
=
function
(
start
,
end
)
{
return
Math
.
floor
(
Math
.
random
()
*
(
end
-
start
)
+
start
);
};
Goods
.
prototype
.
reset
=
function
()
{
this
.
visible
=
true
;
this
.
rotation
=
0
;
this
.
anchorOffsetY
=
0
;
this
.
y
=
0
;
this
.
x
=
(
750
-
120
)
*
Math
.
random
()
+
30
;
this
.
rotation
=
0
;
var
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"
);
}
};
Goods
.
prototype
.
showNpc
=
function
(
type
)
{
for
(
var
i
=
0
;
i
<
this
.
_body
.
children
.
length
;
i
++
)
{
this
.
_body
.
children
[
i
].
visible
=
false
;
this
.
_body
.
children
[
i
].
mouseEnabled
=
false
;
}
for
(
var
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
;
}
}
};
Object
.
defineProperty
(
Goods
.
prototype
,
"anchorOffsetY"
,
{
set
:
function
(
v
)
{
this
.
_body
.
y
=
v
;
},
enumerable
:
true
,
configurable
:
true
});
return
Goods
;
}(
engine
.
Container
));
//# sourceMappingURL=Goods.js.map
var
ObjectPool
=
engine
.
ObjectPool
;
var
PoolName
=
'goods'
;
ObjectPool
.
registerPool
(
PoolName
,
function
()
{
return
new
Goods
();
},
function
(
item
,
data
)
{
item
.
reset
();
});
//# sourceMappingURL=object-pool-init.js.map
var
ObjectPool$1
=
engine
.
ObjectPool
;
var
GameView
=
(
function
(
_super
)
{
var
GameView
=
(
function
(
_super
)
{
tslib
.
__extends
(
GameView
,
_super
);
tslib
.
__extends
(
GameView
,
_super
);
function
GameView
()
{
function
GameView
()
{
...
@@ -431,11 +352,9 @@
...
@@ -431,11 +352,9 @@
});
});
},
500
);
},
500
);
};
};
GameView
.
prototype
.
recycleGoods
=
function
()
{
return
;
};
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/pick-tea/debug/main.js.map
View file @
7393d156
This diff is collapsed.
Click to expand it.
src/custom/pick-tea/src/game/GameView.ts
View file @
7393d156
...
@@ -6,10 +6,7 @@ import { props } from "../props";
...
@@ -6,10 +6,7 @@ import { props } from "../props";
import
{
playSound
,
createSvga
}
from
"./utils"
;
import
{
playSound
,
createSvga
}
from
"./utils"
;
import
ObjectPool
=
engine
.
ObjectPool
;
import
ObjectPool
=
engine
.
ObjectPool
;
import
{
getTextureByName
}
from
"./utils"
;
import
{
getTextureByName
}
from
"./utils"
;
import
{
Goods
}
from
"./Goods"
;
import
{
PoolName
}
from
"./object-pool-init"
;
import
{
Tealeaf
}
from
"./Tealeaf"
;
import
{
Tealeaf
}
from
"./Tealeaf"
;
import
{
RedPackRain
}
from
"../../../redpack-rain/src/game/RedPackRain"
;
const
MAXX
=
-
8
;
const
MAXX
=
-
8
;
export
default
class
GameView
extends
engine
.
Container
{
export
default
class
GameView
extends
engine
.
Container
{
...
@@ -86,8 +83,6 @@ export default class GameView extends engine.Container {
...
@@ -86,8 +83,6 @@ export default class GameView extends engine.Container {
private
goodsItems
=
[]
private
goodsItems
=
[]
private
_goods
:
Goods
;
constructor
()
{
constructor
()
{
super
();
super
();
this
.
once
(
engine
.
Event
.
ADDED_TO_STAGE
,
this
.
setup
,
this
);
this
.
once
(
engine
.
Event
.
ADDED_TO_STAGE
,
this
.
setup
,
this
);
...
@@ -493,21 +488,4 @@ export default class GameView extends engine.Container {
...
@@ -493,21 +488,4 @@ export default class GameView extends engine.Container {
},
500
);
},
500
);
}
}
/*采茶叶活动*/
/*采茶叶活动*/
/**
* 回收对象
*/
private
recycleGoods
()
{
return
clearTimeout
(
this
.
timer
)
clearInterval
(
this
.
countdownTimer
)
for
(
let
goods
of
this
.
goodsItems
)
{
if
(
goods
)
{
this
.
removeChild
(
goods
);
ObjectPool
.
recycleObject
(
PoolName
,
goods
);
goods
.
removeEventListener
(
engine
.
Event
.
ENTER_FRAME
,
goods
[
"onGoodsEnter"
],
this
);
}
}
this
.
goodsItems
=
[]
}
}
}
src/custom/pick-tea/src/game/Goods.ts
deleted
100644 → 0
View file @
af3ba169
/**
* 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
deleted
100644 → 0
View file @
af3ba169
/**
* 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