Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/07/2017 in all areas

  1. You need to add box to your spriter project than check collision. var object_index = spriter_find_object(self, "box_000"); if object_index != -1 { var top_left_x = spriter_get_box_point_x(self, object_index, "TopLeft"); var top_left_y = spriter_get_box_point_y(self, object_index, "TopLeft"); var bottom_right_x = spriter_get_box_point_x(self, object_index, "BottomRight"); var bottom_right_y = spriter_get_box_point_y(self, object_index, "BottomRight"); //2D collision detection } Another way: var object_index = spriter_find_object(self, "box_000"); if object_index != -1 { var top_left_x = spriter_GetObjectInfoMeshPointX(modelIndex, instanceIndex, object_index, 0); var top_left_y = spriter_GetObjectInfoMeshPointY(modelIndex, instanceIndex, object_index, 0); var top_right_x = spriter_GetObjectInfoMeshPointX(modelIndex, instanceIndex, object_index, 1); var top_right_y = spriter_GetObjectInfoMeshPointY(modelIndex, instanceIndex, object_index, 1); var bottom_right_x = spriter_GetObjectInfoMeshPointX(modelIndex, instanceIndex, object_index, 2); var bottom_right_y = spriter_GetObjectInfoMeshPointY(modelIndex, instanceIndex, object_index, 2); var bottom_left_x = spriter_GetObjectInfoMeshPointX(modelIndex, instanceIndex, object_index, 3); var bottom_left_y = spriter_GetObjectInfoMeshPointY(modelIndex, instanceIndex, object_index, 3); //2D collision detection } or: if (spriter_get_box_collision_rectangle(self, enemy, "box_000") != undefined) { //Collision }
    1 point
×
×
  • Create New...