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
08bf8fe8
Commit
08bf8fe8
authored
Jun 10, 2020
by
任建锋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复
parent
7a96d016
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
32 additions
and
27 deletions
+32
-27
food-fell2.json
dist/customs/food-fell2.json
+3
-3
load-assets.js
src/custom/food-fell2/debug/load-assets.js
+2
-14
main.js
src/custom/food-fell2/debug/main.js
+13
-4
main.js.map
src/custom/food-fell2/debug/main.js.map
+1
-1
meta.json
src/custom/food-fell2/meta.json
+2
-2
GameView.ts
src/custom/food-fell2/src/game/GameView.ts
+10
-3
utils.ts
src/custom/food-fell2/src/game/utils.ts
+1
-0
No files found.
dist/customs/food-fell2.json
View file @
08bf8fe8
This diff is collapsed.
Click to expand it.
src/custom/food-fell2/debug/load-assets.js
View file @
08bf8fe8
...
...
@@ -41,13 +41,13 @@ const assets = [
},
{
"name"
:
"水花"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/11b1f49fa3afa3a48f1dd3e3c1eb294e3fa9d886"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/11b1f49fa3afa3a48f1dd3e3c1eb294e3fa9d886
.svga
"
,
"uuid"
:
"cdd2268f-ad65-4b5e-a965-ee61b730da21"
,
"ext"
:
".svga"
},
{
"name"
:
"石头svga"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/01aa6fcb33aa8231f075257026eab2f0aeb3c27a"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/01aa6fcb33aa8231f075257026eab2f0aeb3c27a
.svga
"
,
"uuid"
:
"846a139d-0990-4db4-a323-f22379932ee4"
,
"ext"
:
".svga"
},
...
...
@@ -63,24 +63,12 @@ const assets = [
"uuid"
:
"d7a3947b-7fcb-48f2-9ddf-2f075d37a619"
,
"ext"
:
".svga"
},
// {
// "name": "炸弹",
// "url": "//yun.duiba.com.cn/aurora/assets/4dd18f0689c663bbcf710a7afc4d929084d97d36.svga",
// "uuid": "322edf39-805b-4e84-9d07-5573dfeebc0e",
// "ext": ".svga"
// },
{
"name"
:
"玩家"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/db0130d36ef79865be9c753ea0627027f16341d8.png"
,
"uuid"
:
"4931d296-4421-4a2f-8299-7bab87407c72"
,
"ext"
:
".png"
}
// {
// "name": "玩家",
// "url": "//yun.duiba.com.cn/aurora/assets/b66300c5d4f27134b0aac3dc90a3220e8ae572eb.svga",
// "uuid": "71d8dcbc-3931-471a-b585-b3ae01b25aa6",
// "ext": ".svga"
// }
];
function
loadAssets
(
customModuleAssets
,
onProgress
,
onComplete
){
...
...
src/custom/food-fell2/debug/main.js
View file @
08bf8fe8
...
...
@@ -21,11 +21,11 @@
return
getTexture
(
engine
.
getAssetByName
(
name
).
uuid
);
}
function
createSvga
(
name
,
anchorName
)
{
console
.
log
();
var
inst
=
new
svga
.
Svga
();
inst
.
source
=
'asset://'
+
engine
.
getAssetByName
(
name
).
uuid
;
return
inst
;
}
//# sourceMappingURL=utils.js.map
var
Goods
=
(
function
(
_super
)
{
tslib
.
__extends
(
Goods
,
_super
);
...
...
@@ -132,7 +132,16 @@
};
_this
.
onMoveStage
=
function
(
e
)
{
if
(
_this
.
gameIng
)
{
_this
.
player
.
x
=
_this
.
playerCatchX
+
(
e
.
localX
-
_this
.
moveCatchX
);
var
playerX
=
_this
.
playerCatchX
+
(
e
.
localX
-
_this
.
moveCatchX
);
if
(
playerX
<
0
)
{
_this
.
player
.
x
=
0
;
}
else
if
(
playerX
+
_this
.
player
.
width
>
750
)
{
_this
.
player
.
x
=
750
-
_this
.
player
.
width
;
}
else
{
_this
.
player
.
x
=
playerX
;
}
}
};
_this
.
onOutStage
=
function
(
e
)
{
...
...
@@ -254,7 +263,6 @@
console
.
log
(
"碰到雨滴"
);
_this
.
score
+=
props
.
rainScore
;
_this
.
waterSvga
.
visible
=
true
;
_this
.
waterSvga
.
x
=
goods
.
x
-
_this
.
player
.
x
;
_this
.
waterSvga
.
play
(
false
,
false
);
_this
.
waterSvga
.
once
(
engine
.
Event
.
END_FRAME
,
function
()
{
_this
.
waterSvga
.
visible
=
false
;
...
...
@@ -310,7 +318,7 @@
for
(
var
_i
=
0
,
_a
=
this
.
goodsItems
;
_i
<
_a
.
length
;
_i
++
)
{
var
goods
=
_a
[
_i
];
if
(
goods
)
{
this
.
removeChild
(
goods
);
this
.
NpcBg
.
removeChild
(
goods
);
ObjectPool$1
.
recycleObject
(
PoolName
,
goods
);
goods
.
removeEventListener
(
engine
.
Event
.
ENTER_FRAME
,
goods
[
"onGoodsEnter"
],
this
);
}
...
...
@@ -329,6 +337,7 @@
};
return
GameView
;
}(
engine
.
Container
));
//# sourceMappingURL=GameView.js.map
var
GameWrapper
=
(
function
(
_super
)
{
tslib
.
__extends
(
GameWrapper
,
_super
);
...
...
src/custom/food-fell2/debug/main.js.map
View file @
08bf8fe8
This diff is collapsed.
Click to expand it.
src/custom/food-fell2/meta.json
View file @
08bf8fe8
...
...
@@ -73,13 +73,13 @@
},
{
"name"
:
"水花"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/11b1f49fa3afa3a48f1dd3e3c1eb294e3fa9d886"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/11b1f49fa3afa3a48f1dd3e3c1eb294e3fa9d886
.svga
"
,
"uuid"
:
"cdd2268f-ad65-4b5e-a965-ee61b730da21"
,
"ext"
:
".svga"
},
{
"name"
:
"石头svga"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/01aa6fcb33aa8231f075257026eab2f0aeb3c27a"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/01aa6fcb33aa8231f075257026eab2f0aeb3c27a
.svga
"
,
"uuid"
:
"846a139d-0990-4db4-a323-f22379932ee4"
,
"ext"
:
".svga"
},
...
...
src/custom/food-fell2/src/game/GameView.ts
View file @
08bf8fe8
...
...
@@ -212,7 +212,7 @@ export default class GameView extends engine.Container {
console
.
log
(
"碰到雨滴"
)
this
.
score
+=
props
.
rainScore
this
.
waterSvga
.
visible
=
true
;
this
.
waterSvga
.
x
=
goods
.
x
-
this
.
player
.
x
;
//
this.waterSvga.x= goods.x - this.player.x;
this
.
waterSvga
.
play
(
false
,
false
)
this
.
waterSvga
.
once
(
engine
.
Event
.
END_FRAME
,
()
=>
{
this
.
waterSvga
.
visible
=
false
;
...
...
@@ -280,7 +280,7 @@ export default class GameView extends engine.Container {
clearInterval
(
this
.
countdownTimer
)
for
(
let
goods
of
this
.
goodsItems
)
{
if
(
goods
)
{
this
.
removeChild
(
goods
);
this
.
NpcBg
.
removeChild
(
goods
);
ObjectPool
.
recycleObject
(
PoolName
,
goods
);
goods
.
removeEventListener
(
engine
.
Event
.
ENTER_FRAME
,
goods
[
"onGoodsEnter"
],
this
);
}
...
...
@@ -316,7 +316,14 @@ export default class GameView extends engine.Container {
private
onMoveStage
=
(
e
)
=>
{
if
(
this
.
gameIng
)
{
this
.
player
.
x
=
this
.
playerCatchX
+
(
e
.
localX
-
this
.
moveCatchX
)
let
playerX
=
this
.
playerCatchX
+
(
e
.
localX
-
this
.
moveCatchX
)
if
(
playerX
<
0
){
this
.
player
.
x
=
0
}
else
if
(
playerX
+
this
.
player
.
width
>
750
){
this
.
player
.
x
=
750
-
this
.
player
.
width
}
else
{
this
.
player
.
x
=
playerX
}
}
}
...
...
src/custom/food-fell2/src/game/utils.ts
View file @
08bf8fe8
...
...
@@ -14,6 +14,7 @@ export function playSound(name) {
engine
.
playSound
(
engine
.
getAssetByName
(
name
).
uuid
,
{
keep
:
true
});
}
export
function
createSvga
(
name
,
anchorName
?)
{
console
.
log
()
let
inst
=
new
svga
.
Svga
();
inst
.
source
=
'asset://'
+
engine
.
getAssetByName
(
name
).
uuid
;
return
inst
;
...
...
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