调整 LightGame 平台碰撞与门尺寸,修复测试编译
- LightPlatform / ShadowPlatform:移除单向板碰撞逻辑,改为完整 tile 碰撞体 - Door:碰撞箱从 32x64 改为 32x32,与单 tile 素材匹配 - 修复 game_engine_tests 编译:补全 LevelData 初始化字段,增加缺失的 include path
This commit is contained in:
@@ -84,7 +84,7 @@ namespace LightGame
|
||||
|
||||
case GameObjectType::Door:
|
||||
obj.collider = RenderData::BoundingBox2D(
|
||||
Math::Vector2Int(0, 0), Math::Vector2Int(ts, ts * 2));
|
||||
Math::Vector2Int(0, 0), Math::Vector2Int(ts, ts));
|
||||
obj.solid = true;
|
||||
obj.light_threshold = LightThreshold(spawn.light_min, spawn.light_max);
|
||||
obj.sprite = &spr_door_closed;
|
||||
|
||||
@@ -143,9 +143,6 @@ namespace LightGame
|
||||
continue;
|
||||
}
|
||||
|
||||
const bool is_one_way = (other.type == GameObjectType::LightPlatform ||
|
||||
other.type == GameObjectType::ShadowPlatform);
|
||||
|
||||
const RenderData::BoundingBox2D other_world = other.get_world_collider();
|
||||
world_collider = obj.get_world_collider();
|
||||
|
||||
@@ -154,21 +151,6 @@ namespace LightGame
|
||||
continue;
|
||||
}
|
||||
|
||||
if (is_one_way)
|
||||
{
|
||||
const int32_t obj_bottom = world_collider.max.y;
|
||||
const int32_t other_top = other_world.min.y;
|
||||
const int32_t prev_bottom = obj_bottom - move_y;
|
||||
|
||||
if (prev_bottom > other_top || obj.velocity.y <= 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
obj.position.y = other_top - (obj.collider.max.y - obj.collider.min.y);
|
||||
obj.velocity.y = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
const int32_t overlap_left = world_collider.max.x - other_world.min.x;
|
||||
const int32_t overlap_right = other_world.max.x - world_collider.min.x;
|
||||
|
||||
Reference in New Issue
Block a user