Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
DuibaGameTemplate
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
钱根
DuibaGameTemplate
Commits
48c4bca0
Commit
48c4bca0
authored
Jun 20, 2022
by
Master Q
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'parkourGame_template' into zhonghuacaixian-parkourGame-20220616
parents
562e0ab1
22f88a2f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
9 deletions
+21
-9
rollup.prod.mjs
rollup.prod.mjs
+1
-1
ParkourGameConfig.ts
src/scenes/ParkourGameConfig.ts
+2
-2
ConveyorBelt.ts
src/scenes/comp/ConveyorBelt.ts
+18
-6
No files found.
rollup.prod.mjs
View file @
48c4bca0
...
@@ -35,7 +35,7 @@ export default {
...
@@ -35,7 +35,7 @@ export default {
progress
(),
progress
(),
BannerVariable
({
BannerVariable
({
values
:
{
values
:
{
__ENV__
:
JSON
.
stringify
(
process
.
env
.
NODE_ENV
||
'p
ord
'
),
__ENV__
:
JSON
.
stringify
(
process
.
env
.
NODE_ENV
||
'p
roduction
'
),
__version__
:
JSON
.
stringify
(
version
),
__version__
:
JSON
.
stringify
(
version
),
__buildDate__
:
JSON
.
stringify
(
new
Date
()),
__buildDate__
:
JSON
.
stringify
(
new
Date
()),
}
}
...
...
src/scenes/ParkourGameConfig.ts
View file @
48c4bca0
...
@@ -213,7 +213,7 @@ export const ParkourGameConfig: ParkourGameConfigInfer = {
...
@@ -213,7 +213,7 @@ export const ParkourGameConfig: ParkourGameConfigInfer = {
{
{
uniqueKey
:
'protect'
,
uniqueKey
:
'protect'
,
Container
:
'obstack3.png'
,
Container
:
'obstack3.png'
,
ProbabilityPort
:
3
,
ProbabilityPort
:
10
,
// anchorX: 100,
// anchorX: 100,
// anchorY: 100,
// anchorY: 100,
collisionConfig
:
{
collisionConfig
:
{
...
@@ -227,7 +227,7 @@ export const ParkourGameConfig: ParkourGameConfigInfer = {
...
@@ -227,7 +227,7 @@ export const ParkourGameConfig: ParkourGameConfigInfer = {
],
],
CommonConfig
:
{
CommonConfig
:
{
speed
:
300
,
// 速度 可以通过GAME_SPEEDUP 修改
speed
:
300
,
// 速度 可以通过GAME_SPEEDUP 修改
CollisionDebug
:
fals
e
,
// 碰撞检测 debug
CollisionDebug
:
__ENV__
===
'production'
?
false
:
tru
e
,
// 碰撞检测 debug
GamerAxisY
:
1100
,
// 玩家轴Y
GamerAxisY
:
1100
,
// 玩家轴Y
GamerIndex
:
1
,
// 当前玩家索引 在哪条道
GamerIndex
:
1
,
// 当前玩家索引 在哪条道
DetermineXAxis
:
50
,
// 左右滑动判定距离
DetermineXAxis
:
50
,
// 左右滑动判定距离
...
...
src/scenes/comp/ConveyorBelt.ts
View file @
48c4bca0
...
@@ -102,7 +102,8 @@ export class ConveyorBeltItem extends FYGE.Container {
...
@@ -102,7 +102,8 @@ export class ConveyorBeltItem extends FYGE.Container {
type
ProbabilityItemType
=
{
type
ProbabilityItemType
=
{
value
:
number
value
:
number
index
:
number
index
:
number
,
ownValuue
:
number
}
}
/**
/**
...
@@ -180,12 +181,14 @@ export class ConveyorBelt extends FYGE.Container {
...
@@ -180,12 +181,14 @@ export class ConveyorBelt extends FYGE.Container {
const
_ParkourGameEleList
=
this
.
ParkourGameEleList
const
_ParkourGameEleList
=
this
.
ParkourGameEleList
const
sumProbability
=
_ParkourGameEleList
.
reduce
((
prev
,
cur
)
=>
prev
+
cur
.
ProbabilityPort
,
0
)
const
sumProbability
=
_ParkourGameEleList
.
reduce
((
prev
,
cur
)
=>
prev
+
cur
.
ProbabilityPort
,
0
)
const
_ProbabilityList
:
ProbabilityItemType
[]
=
[]
const
_ProbabilityList
:
ProbabilityItemType
[]
=
[]
_ParkourGameEleList
.
reduce
((
pre
,
curr
,
index
)
=>
{
_ParkourGameEleList
.
reduce
((
pre
,
curr
,
index
,
arr
)
=>
{
const
tp
=
curr
.
ProbabilityPort
/
sumProbability
_ProbabilityList
.
push
({
_ProbabilityList
.
push
({
value
:
pre
+
curr
.
ProbabilityPort
/
sumProbability
,
value
:
index
==
arr
.
length
-
1
?
1
:
pre
+
tp
,
index
index
,
ownValuue
:
tp
})
})
return
pre
+
curr
.
ProbabilityPort
/
sumProbability
return
pre
+
tp
},
0
)
},
0
)
this
.
ProbabilityList
=
_ProbabilityList
this
.
ProbabilityList
=
_ProbabilityList
console
.
log
(
'ProbabilityList ==== > '
,
_ProbabilityList
)
console
.
log
(
'ProbabilityList ==== > '
,
_ProbabilityList
)
...
@@ -327,9 +330,18 @@ export class ConveyorBelt extends FYGE.Container {
...
@@ -327,9 +330,18 @@ export class ConveyorBelt extends FYGE.Container {
if
(
this
.
onJudgeNextObstacle
)
{
if
(
this
.
onJudgeNextObstacle
)
{
const
b
=
this
.
onJudgeNextObstacle
(
ParkourGameEle
)
const
b
=
this
.
onJudgeNextObstacle
(
ParkourGameEle
)
if
(
!
b
)
{
if
(
!
b
)
{
const
skipPortList
=
portList
.
filter
((
item
)
=>
{
const
skipPortList
:
ProbabilityItemType
[]
=
portList
.
filter
((
item
)
=>
{
return
item
.
index
!==
index
return
item
.
index
!==
index
})
})
.
reduce
((
pre
,
cur
,
index
,
arr
)
=>
{
if
(
randomItem
.
ownValuue
===
1
)
return
[]
const
cloneCur
=
{...
cur
}
const
ownValue
=
cloneCur
.
ownValuue
/
(
1
-
randomItem
.
ownValuue
)
cloneCur
.
ownValuue
=
ownValue
cloneCur
.
value
=
index
==
arr
.
length
-
1
?
1
:
((
pre
.
length
==
0
?
0
:
pre
[
pre
.
length
-
1
].
value
)
+
cloneCur
.
ownValuue
)
return
pre
.
concat
(
cloneCur
)
},
[])
// debugger
return
this
.
onGetFinalObstacle
(
skipPortList
)
return
this
.
onGetFinalObstacle
(
skipPortList
)
}
}
}
}
...
...
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