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
Hide 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 = [
...
@@ -41,13 +41,13 @@ const assets = [
},
},
{
{
"name"
:
"水花"
,
"name"
:
"水花"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/11b1f49fa3afa3a48f1dd3e3c1eb294e3fa9d886"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/11b1f49fa3afa3a48f1dd3e3c1eb294e3fa9d886
.svga
"
,
"uuid"
:
"cdd2268f-ad65-4b5e-a965-ee61b730da21"
,
"uuid"
:
"cdd2268f-ad65-4b5e-a965-ee61b730da21"
,
"ext"
:
".svga"
"ext"
:
".svga"
},
},
{
{
"name"
:
"石头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"
,
"uuid"
:
"846a139d-0990-4db4-a323-f22379932ee4"
,
"ext"
:
".svga"
"ext"
:
".svga"
},
},
...
@@ -63,24 +63,12 @@ const assets = [
...
@@ -63,24 +63,12 @@ const assets = [
"uuid"
:
"d7a3947b-7fcb-48f2-9ddf-2f075d37a619"
,
"uuid"
:
"d7a3947b-7fcb-48f2-9ddf-2f075d37a619"
,
"ext"
:
".svga"
"ext"
:
".svga"
},
},
// {
// "name": "炸弹",
// "url": "//yun.duiba.com.cn/aurora/assets/4dd18f0689c663bbcf710a7afc4d929084d97d36.svga",
// "uuid": "322edf39-805b-4e84-9d07-5573dfeebc0e",
// "ext": ".svga"
// },
{
{
"name"
:
"玩家"
,
"name"
:
"玩家"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/db0130d36ef79865be9c753ea0627027f16341d8.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/db0130d36ef79865be9c753ea0627027f16341d8.png"
,
"uuid"
:
"4931d296-4421-4a2f-8299-7bab87407c72"
,
"uuid"
:
"4931d296-4421-4a2f-8299-7bab87407c72"
,
"ext"
:
".png"
"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
){
function
loadAssets
(
customModuleAssets
,
onProgress
,
onComplete
){
...
...
src/custom/food-fell2/debug/main.js
View file @
08bf8fe8
...
@@ -21,11 +21,11 @@
...
@@ -21,11 +21,11 @@
return
getTexture
(
engine
.
getAssetByName
(
name
).
uuid
);
return
getTexture
(
engine
.
getAssetByName
(
name
).
uuid
);
}
}
function
createSvga
(
name
,
anchorName
)
{
function
createSvga
(
name
,
anchorName
)
{
console
.
log
();
var
inst
=
new
svga
.
Svga
();
var
inst
=
new
svga
.
Svga
();
inst
.
source
=
'asset://'
+
engine
.
getAssetByName
(
name
).
uuid
;
inst
.
source
=
'asset://'
+
engine
.
getAssetByName
(
name
).
uuid
;
return
inst
;
return
inst
;
}
}
//# sourceMappingURL=utils.js.map
var
Goods
=
(
function
(
_super
)
{
var
Goods
=
(
function
(
_super
)
{
tslib
.
__extends
(
Goods
,
_super
);
tslib
.
__extends
(
Goods
,
_super
);
...
@@ -132,7 +132,16 @@
...
@@ -132,7 +132,16 @@
};
};
_this
.
onMoveStage
=
function
(
e
)
{
_this
.
onMoveStage
=
function
(
e
)
{
if
(
_this
.
gameIng
)
{
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
)
{
_this
.
onOutStage
=
function
(
e
)
{
...
@@ -254,7 +263,6 @@
...
@@ -254,7 +263,6 @@
console
.
log
(
"碰到雨滴"
);
console
.
log
(
"碰到雨滴"
);
_this
.
score
+=
props
.
rainScore
;
_this
.
score
+=
props
.
rainScore
;
_this
.
waterSvga
.
visible
=
true
;
_this
.
waterSvga
.
visible
=
true
;
_this
.
waterSvga
.
x
=
goods
.
x
-
_this
.
player
.
x
;
_this
.
waterSvga
.
play
(
false
,
false
);
_this
.
waterSvga
.
play
(
false
,
false
);
_this
.
waterSvga
.
once
(
engine
.
Event
.
END_FRAME
,
function
()
{
_this
.
waterSvga
.
once
(
engine
.
Event
.
END_FRAME
,
function
()
{
_this
.
waterSvga
.
visible
=
false
;
_this
.
waterSvga
.
visible
=
false
;
...
@@ -310,7 +318,7 @@
...
@@ -310,7 +318,7 @@
for
(
var
_i
=
0
,
_a
=
this
.
goodsItems
;
_i
<
_a
.
length
;
_i
++
)
{
for
(
var
_i
=
0
,
_a
=
this
.
goodsItems
;
_i
<
_a
.
length
;
_i
++
)
{
var
goods
=
_a
[
_i
];
var
goods
=
_a
[
_i
];
if
(
goods
)
{
if
(
goods
)
{
this
.
removeChild
(
goods
);
this
.
NpcBg
.
removeChild
(
goods
);
ObjectPool$1
.
recycleObject
(
PoolName
,
goods
);
ObjectPool$1
.
recycleObject
(
PoolName
,
goods
);
goods
.
removeEventListener
(
engine
.
Event
.
ENTER_FRAME
,
goods
[
"onGoodsEnter"
],
this
);
goods
.
removeEventListener
(
engine
.
Event
.
ENTER_FRAME
,
goods
[
"onGoodsEnter"
],
this
);
}
}
...
@@ -329,6 +337,7 @@
...
@@ -329,6 +337,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/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 @@
...
@@ -73,13 +73,13 @@
},
},
{
{
"name"
:
"水花"
,
"name"
:
"水花"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/11b1f49fa3afa3a48f1dd3e3c1eb294e3fa9d886"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/11b1f49fa3afa3a48f1dd3e3c1eb294e3fa9d886
.svga
"
,
"uuid"
:
"cdd2268f-ad65-4b5e-a965-ee61b730da21"
,
"uuid"
:
"cdd2268f-ad65-4b5e-a965-ee61b730da21"
,
"ext"
:
".svga"
"ext"
:
".svga"
},
},
{
{
"name"
:
"石头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"
,
"uuid"
:
"846a139d-0990-4db4-a323-f22379932ee4"
,
"ext"
:
".svga"
"ext"
:
".svga"
},
},
...
...
src/custom/food-fell2/src/game/GameView.ts
View file @
08bf8fe8
...
@@ -212,7 +212,7 @@ export default class GameView extends engine.Container {
...
@@ -212,7 +212,7 @@ export default class GameView extends engine.Container {
console
.
log
(
"碰到雨滴"
)
console
.
log
(
"碰到雨滴"
)
this
.
score
+=
props
.
rainScore
this
.
score
+=
props
.
rainScore
this
.
waterSvga
.
visible
=
true
;
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
.
play
(
false
,
false
)
this
.
waterSvga
.
once
(
engine
.
Event
.
END_FRAME
,
()
=>
{
this
.
waterSvga
.
once
(
engine
.
Event
.
END_FRAME
,
()
=>
{
this
.
waterSvga
.
visible
=
false
;
this
.
waterSvga
.
visible
=
false
;
...
@@ -280,7 +280,7 @@ export default class GameView extends engine.Container {
...
@@ -280,7 +280,7 @@ export default class GameView extends engine.Container {
clearInterval
(
this
.
countdownTimer
)
clearInterval
(
this
.
countdownTimer
)
for
(
let
goods
of
this
.
goodsItems
)
{
for
(
let
goods
of
this
.
goodsItems
)
{
if
(
goods
)
{
if
(
goods
)
{
this
.
removeChild
(
goods
);
this
.
NpcBg
.
removeChild
(
goods
);
ObjectPool
.
recycleObject
(
PoolName
,
goods
);
ObjectPool
.
recycleObject
(
PoolName
,
goods
);
goods
.
removeEventListener
(
engine
.
Event
.
ENTER_FRAME
,
goods
[
"onGoodsEnter"
],
this
);
goods
.
removeEventListener
(
engine
.
Event
.
ENTER_FRAME
,
goods
[
"onGoodsEnter"
],
this
);
}
}
...
@@ -316,7 +316,14 @@ export default class GameView extends engine.Container {
...
@@ -316,7 +316,14 @@ export default class GameView extends engine.Container {
private
onMoveStage
=
(
e
)
=>
{
private
onMoveStage
=
(
e
)
=>
{
if
(
this
.
gameIng
)
{
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) {
...
@@ -14,6 +14,7 @@ export function playSound(name) {
engine
.
playSound
(
engine
.
getAssetByName
(
name
).
uuid
,
{
keep
:
true
});
engine
.
playSound
(
engine
.
getAssetByName
(
name
).
uuid
,
{
keep
:
true
});
}
}
export
function
createSvga
(
name
,
anchorName
?)
{
export
function
createSvga
(
name
,
anchorName
?)
{
console
.
log
()
let
inst
=
new
svga
.
Svga
();
let
inst
=
new
svga
.
Svga
();
inst
.
source
=
'asset://'
+
engine
.
getAssetByName
(
name
).
uuid
;
inst
.
source
=
'asset://'
+
engine
.
getAssetByName
(
name
).
uuid
;
return
inst
;
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