Skip to content

Commit

Permalink
Fixed boundary detector
Browse files Browse the repository at this point in the history
  • Loading branch information
JiepengTan committed Oct 18, 2024
1 parent 32628cd commit 618f454
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions core/extension/spx_physic_mgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,11 @@ GdInt SpxPhysicMgr::check_touched_camera_boundaries(GdObj obj) {
bool is_colliding_top = sprite_shape->collide(sprite_transform, horizontal_edge_shape, top_edge_transform);
bool is_colliding_bottom = sprite_shape->collide(sprite_transform, horizontal_edge_shape, bottom_edge_transform);
GdInt result = 0;
result += is_colliding_top ? 1 << BOUND_CAM_TOP : 0;
result += is_colliding_right ? 1 << BOUND_CAM_RIGHT : 0;
result += is_colliding_bottom ? 1 << BOUND_CAM_BOTTOM : 0;
result += is_colliding_left ? 1 << BOUND_CAM_LEFT : 0;
return is_colliding_left || is_colliding_right || is_colliding_top || is_colliding_bottom;
result += is_colliding_top ? BOUND_CAM_TOP : 0;
result += is_colliding_right ? BOUND_CAM_RIGHT : 0;
result += is_colliding_bottom ? BOUND_CAM_BOTTOM : 0;
result += is_colliding_left ? BOUND_CAM_LEFT : 0;
return result;
}
GdBool SpxPhysicMgr::check_touched_camera_boundary(GdObj obj, GdInt board_type) {
auto result = check_touched_camera_boundaries(obj);
Expand Down
1 change: 1 addition & 0 deletions core/extension/spx_res_mgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ GdVec2 SpxResMgr::get_image_size(GdString path) {
} else {
print_error("can not find a texture: " + path_str);
}
return GdVec2(1,1);
}
GdString SpxResMgr::read_all_text(GdString p_path) {
auto path = SpxStr(p_path);
Expand Down

0 comments on commit 618f454

Please sign in to comment.