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
a273c0cb
Commit
a273c0cb
authored
Jun 17, 2020
by
任建锋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复-1
parent
8927f1fd
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
37 additions
and
19 deletions
+37
-19
.DS_Store
dist/.DS_Store
+0
-0
dragon-boat-race.json
dist/customs/dragon-boat-race.json
+1
-1
food-fell2.json
dist/customs/food-fell2.json
+1
-1
main.js
src/custom/dragon-boat-race/debug/main.js
+5
-2
main.js.map
src/custom/dragon-boat-race/debug/main.js.map
+1
-1
GameView.ts
src/custom/dragon-boat-race/src/game/GameView.ts
+10
-1
main.js
src/custom/food-fell2/debug/main.js
+8
-9
main.js.map
src/custom/food-fell2/debug/main.js.map
+1
-1
GameView.ts
src/custom/food-fell2/src/game/GameView.ts
+10
-3
No files found.
dist/.DS_Store
View file @
a273c0cb
No preview for this file type
dist/customs/dragon-boat-race.json
View file @
a273c0cb
This diff is collapsed.
Click to expand it.
dist/customs/food-fell2.json
View file @
a273c0cb
This diff is collapsed.
Click to expand it.
src/custom/dragon-boat-race/debug/main.js
View file @
a273c0cb
...
...
@@ -25,6 +25,7 @@
inst
.
source
=
'asset://'
+
getAssetByName
(
name
).
uuid
;
return
inst
;
}
//# sourceMappingURL=utils.js.map
var
Goods
=
(
function
(
_super
)
{
tslib
.
__extends
(
Goods
,
_super
);
...
...
@@ -332,6 +333,9 @@
this
.
timer
=
setTimeout
(
function
()
{
if
(
_this
.
gameIng
)
{
_this
.
speed
+=
props
.
acceleratedSpeed
;
if
(
_this
.
speed
>
props
.
maxSpeed
)
{
_this
.
speed
=
props
.
maxSpeed
;
}
_this
.
creatNpc
();
}
_this
.
beginNpc
();
...
...
@@ -371,7 +375,7 @@
}
else
if
(
goods
[
"npcType"
]
==
"rain1"
)
{
console
.
log
(
"碰到雨滴"
);
_this
.
score
+=
props
.
rainScore
;
_this
.
score
+=
props
.
rain
2
Score
;
_this
.
setBoomPosition
(
_this
.
water2Svga
);
engine
.
Tween
.
get
(
goods
,
null
,
null
,
true
)
.
to
({
scaleX
:
0
,
scaleY
:
0
},
200
)
...
...
@@ -445,7 +449,6 @@
};
return
GameView
;
}(
engine
.
Container
));
//# sourceMappingURL=GameView.js.map
var
GameWrapper
=
(
function
(
_super
)
{
tslib
.
__extends
(
GameWrapper
,
_super
);
...
...
src/custom/dragon-boat-race/debug/main.js.map
View file @
a273c0cb
This diff is collapsed.
Click to expand it.
src/custom/dragon-boat-race/src/game/GameView.ts
View file @
a273c0cb
...
...
@@ -293,6 +293,9 @@ export default class GameView extends engine.Container {
this
.
timer
=
setTimeout
(()
=>
{
if
(
this
.
gameIng
)
{
this
.
speed
+=
props
.
acceleratedSpeed
;
if
(
this
.
speed
>
props
.
maxSpeed
){
this
.
speed
=
props
.
maxSpeed
}
this
.
creatNpc
()
}
//递归执行
...
...
@@ -344,6 +347,9 @@ export default class GameView extends engine.Container {
if
(
goods
[
"npcType"
]
==
"rain0"
)
{
console
.
log
(
"碰到雨滴"
)
this
.
score
+=
props
.
rainScore
if
(
this
.
score
<
0
){
this
.
score
=
0
;
}
this
.
setBoomPosition
(
this
.
waterSvga
)
engine
.
Tween
.
get
(
goods
,
null
,
null
,
true
)
.
to
({
scaleX
:
0
,
scaleY
:
0
},
200
)
...
...
@@ -352,7 +358,10 @@ export default class GameView extends engine.Container {
}
else
if
(
goods
[
"npcType"
]
==
"rain1"
)
{
console
.
log
(
"碰到雨滴"
)
this
.
score
+=
props
.
rainScore
this
.
score
+=
props
.
rain2Score
if
(
this
.
score
<
0
){
this
.
score
=
0
;
}
this
.
setBoomPosition
(
this
.
water2Svga
)
engine
.
Tween
.
get
(
goods
,
null
,
null
,
true
)
.
to
({
scaleX
:
0
,
scaleY
:
0
},
200
)
...
...
src/custom/food-fell2/debug/main.js
View file @
a273c0cb
...
...
@@ -12,7 +12,6 @@
function
injectProps
(
p
)
{
engine
.
injectProp
(
props
,
p
);
}
//# sourceMappingURL=props.js.map
function
getTextureByName
(
name
)
{
return
engine
.
Texture
.
from
(
getAssetByName
(
name
).
uuid
);
...
...
@@ -22,7 +21,6 @@
inst
.
source
=
'asset://'
+
getAssetByName
(
name
).
uuid
;
return
inst
;
}
//# sourceMappingURL=utils.js.map
var
Goods
=
(
function
(
_super
)
{
tslib
.
__extends
(
Goods
,
_super
);
...
...
@@ -104,7 +102,6 @@
});
return
Goods
;
}(
engine
.
Container
));
//# sourceMappingURL=Goods.js.map
var
ObjectPool
=
engine
.
ObjectPool
;
var
PoolName
=
'goods'
;
...
...
@@ -113,7 +110,6 @@
},
function
(
item
,
data
)
{
item
.
reset
();
});
//# sourceMappingURL=object-pool-init.js.map
var
ObjectPool$1
=
engine
.
ObjectPool
;
var
GameView
=
(
function
(
_super
)
{
...
...
@@ -197,6 +193,7 @@
this
.
rectBg
.
addEventListener
(
engine
.
MouseEvent
.
MOUSE_OUT
,
this
.
onOutStage
,
this
);
};
GameView
.
prototype
.
reset
=
function
()
{
this
.
score
=
0
;
this
.
recycleGoods
();
this
.
player
.
x
=
375
-
this
.
player
.
width
/
2
;
};
...
...
@@ -268,10 +265,16 @@
_this
.
waterSvga
.
once
(
engine
.
Event
.
END_FRAME
,
function
()
{
_this
.
waterSvga
.
visible
=
false
;
},
_this
);
if
(
_this
.
score
<
0
)
{
_this
.
score
=
0
;
}
}
else
if
(
goods
[
"npcType"
]
==
"stone"
)
{
console
.
log
(
"碰到石头"
);
_this
.
score
+=
props
.
stoneScore
;
if
(
_this
.
score
<
0
)
{
_this
.
score
=
0
;
}
_this
.
stoneSvga
.
visible
=
true
;
_this
.
stoneSvga
.
play
(
false
,
false
);
_this
.
stoneSvga
.
once
(
engine
.
Event
.
END_FRAME
,
function
()
{
...
...
@@ -282,13 +285,13 @@
console
.
log
(
"碰到炸弹"
);
_this
.
boomSvga
.
visible
=
true
;
_this
.
boomSvga
.
play
(
false
,
false
);
_this
.
died
();
_this
.
boomSvga
.
once
(
engine
.
Event
.
END_FRAME
,
function
()
{
_this
.
boomSvga
.
visible
=
false
;
engine
.
globalEvent
.
dispatchEvent
(
'food-fell-game-over'
,
{
score
:
_this
.
score
,
reason
:
2
});
_this
.
died
();
},
_this
);
}
engine
.
globalEvent
.
dispatchEvent
(
'food-fell-score-update'
,
{
...
...
@@ -301,7 +304,6 @@
},
this
);
};
GameView
.
prototype
.
died
=
function
()
{
this
.
score
=
0
;
this
.
pause
();
};
GameView
.
prototype
.
removeNpc
=
function
(
goods
)
{
...
...
@@ -349,7 +351,6 @@
};
return
GameView
;
}(
engine
.
Container
));
//# sourceMappingURL=GameView.js.map
var
GameWrapper
=
(
function
(
_super
)
{
tslib
.
__extends
(
GameWrapper
,
_super
);
...
...
@@ -392,7 +393,6 @@
};
return
GameWrapper
;
}(
engine
.
Container
));
//# sourceMappingURL=GameWrapper.js.map
function
index
(
props
)
{
prepareProps
();
...
...
@@ -400,7 +400,6 @@
var
instance
=
new
GameWrapper
();
return
instance
;
}
//# sourceMappingURL=index.js.map
return
index
;
...
...
src/custom/food-fell2/debug/main.js.map
View file @
a273c0cb
This diff is collapsed.
Click to expand it.
src/custom/food-fell2/src/game/GameView.ts
View file @
a273c0cb
...
...
@@ -140,6 +140,7 @@ export default class GameView extends engine.Container {
* 重置场景
*/
reset
()
{
this
.
score
=
0
this
.
recycleGoods
()
this
.
player
.
x
=
375
-
this
.
player
.
width
/
2
;
}
...
...
@@ -229,7 +230,7 @@ export default class GameView extends engine.Container {
if
(
this
.
hasHit
(
this
.
player
,
goods
))
{
if
(
goods
[
"npcType"
].
indexOf
(
"rain"
)
>
-
1
)
{
console
.
log
(
"碰到雨滴"
)
this
.
score
+=
props
.
rainScore
this
.
score
+=
props
.
rainScore
;
this
.
waterSvga
.
visible
=
true
;
// this.waterSvga.x= goods.x - this.player.x;
this
.
waterSvga
.
play
(
false
,
false
)
...
...
@@ -237,9 +238,16 @@ export default class GameView extends engine.Container {
this
.
waterSvga
.
visible
=
false
;
},
this
);
if
(
this
.
score
<
0
){
this
.
score
=
0
;
}
}
else
if
(
goods
[
"npcType"
]
==
"stone"
)
{
console
.
log
(
"碰到石头"
)
this
.
score
+=
props
.
stoneScore
if
(
this
.
score
<
0
){
this
.
score
=
0
;
}
this
.
stoneSvga
.
visible
=
true
;
this
.
stoneSvga
.
play
(
false
,
false
)
this
.
stoneSvga
.
once
(
engine
.
Event
.
END_FRAME
,
()
=>
{
...
...
@@ -249,13 +257,13 @@ export default class GameView extends engine.Container {
console
.
log
(
"碰到炸弹"
)
this
.
boomSvga
.
visible
=
true
;
this
.
boomSvga
.
play
(
false
,
false
)
this
.
died
()
this
.
boomSvga
.
once
(
engine
.
Event
.
END_FRAME
,
()
=>
{
this
.
boomSvga
.
visible
=
false
;
engine
.
globalEvent
.
dispatchEvent
(
'food-fell-game-over'
,
{
score
:
this
.
score
,
reason
:
2
});
this
.
died
()
},
this
);
}
engine
.
globalEvent
.
dispatchEvent
(
'food-fell-score-update'
,
{
...
...
@@ -273,7 +281,6 @@ export default class GameView extends engine.Container {
* 玩家死亡
*/
private
died
()
{
this
.
score
=
0
this
.
pause
()
}
...
...
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