Commit 2c6d0278 authored by Master Q's avatar Master Q

fixed merge

parents 67826fea e56a7ac2
......@@ -53,6 +53,7 @@ interface ParkourGameConfigInfer {
GamerAxisY: number // 玩家轴Y
GamerIndex: number // 默认玩家索引 在哪条 道上
DetermineXAxis: number // 玩家 x 方向判定移动距离
safeDistance?: number // 安全距离
}
}
......@@ -143,7 +144,7 @@ export const ParkourGameConfig: ParkourGameConfigInfer = {
{
uniqueKey: 'uniqueKey1',
Container: 'obstack1.png',
ProbabilityPort: 10000,
ProbabilityPort: 10,
collisionConfig: {
type: 'rect',
x: -50,
......@@ -153,9 +154,9 @@ export const ParkourGameConfig: ParkourGameConfigInfer = {
}
},
{
uniqueKey: 'uniqueKey2',
uniqueKey: 'uniqueKey2', // 这个是障碍物
Container: 'obstack2.png',
ProbabilityPort: 10,
ProbabilityPort: 100000,
// anchorX: 130,
// anchorY: 130,
collisionConfig: {
......@@ -183,9 +184,10 @@ export const ParkourGameConfig: ParkourGameConfigInfer = {
],
CommonConfig: {
speed: 300,
CollisionDebug: false,
CollisionDebug: true,
GamerAxisY: 1100,
GamerIndex: 1,
DetermineXAxis: 50
DetermineXAxis: 100,
safeDistance: 500
}
}
\ No newline at end of file
......@@ -80,7 +80,7 @@ export class ParkourScene extends Scene {
this.GamerIndex = ParkourGameConfig.CommonConfig.GamerIndex
GDispatcher.dispatchEvent(ParkourGameEvents.GAME_RESTART)
// GDispatcher.dispatchEvent(ParkourGameEvents.GAME_RESTART)
}
......@@ -93,13 +93,17 @@ export class ParkourScene extends Scene {
// TODO: 判断下一个障碍物 是否可以出,防止必死的情况
// 就比如下面就比较简单 下一个 item.uniqueKey 为 uniqueKey1 就回去
// 判断全部的传送带是否有 uniqueKey1 并且距离刷新点小于一定距离
// 这样就能 防止必死的情况
if (data.uniqueKey === 'uniqueKey1') {
return this.conBeltList.filter(item => {
return item.children.some((child: ConveyorBeltItem) => {
return child.y < 600 && child.uniqueKey === "uniqueKey1"
})
}).length < 2
// 这样就能 防止必死的情况'
const safeNum = ParkourGameConfig.CommonConfig.safeDistance
if (safeNum) {
if (data.uniqueKey === 'uniqueKey2') {
return this.conBeltList.filter(item => {
return item.children.some((child: ConveyorBeltItem) => {
return child.y < safeNum && child.uniqueKey === "uniqueKey2"
})
}).length < 2
}
return true
}
return true
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment