|
|
@@ -287,12 +287,10 @@ const tileSize = computed(() => {
|
|
|
}
|
|
|
|
|
|
// 获取地图数据中的最大坐标
|
|
|
- const maxX = Math.max(...walkablePoints.value.map(p => p.x));
|
|
|
- const maxY = Math.max(...walkablePoints.value.map(p => p.y));
|
|
|
-
|
|
|
+ let size = JSON.parse(gameState.mapConfig.tileSize);
|
|
|
// 计算基于容器的瓦片大小,确保地图完全可见
|
|
|
- const tileWidth = mapContainerDimensions.value.width / maxX;
|
|
|
- const tileHeight = mapContainerDimensions.value.height / maxY;
|
|
|
+ const tileWidth = mapContainerDimensions.value.width / size.x;
|
|
|
+ const tileHeight = mapContainerDimensions.value.height / size.y;
|
|
|
|
|
|
// 返回较小的值以确保地图完全可见
|
|
|
return Math.min(tileWidth, tileHeight);
|
|
|
@@ -753,11 +751,9 @@ async function switchMapType(type, isMapType = null) {
|
|
|
// 处理方块类型逻辑
|
|
|
await switchMapType(0);
|
|
|
|
|
|
+ console.log("滑行前位置:" + playerPosition.value.x + "," + playerPosition.value.y);
|
|
|
await slidingLogic();
|
|
|
|
|
|
- // 处理方块类型逻辑
|
|
|
- await switchMapType(1);
|
|
|
-
|
|
|
tileMap = walkablePointsMap.get(`${playerPosition.value.x},${playerPosition.value.y}`);
|
|
|
}while (tileMap.type === BLOCKLY_MAP_TYPE_DICT.ICE && !isColliding.value)
|
|
|
break;
|
|
|
@@ -1495,7 +1491,7 @@ onUnmounted(() => {
|
|
|
//border: 1px solid rgba(52, 152, 219, 0.5);
|
|
|
//box-sizing: border-box;
|
|
|
//是否显示可行路线
|
|
|
- opacity: 1;
|
|
|
+ opacity: 0;
|
|
|
}
|
|
|
|
|
|
/* 玩家样式 */
|