Jump to content

simonmatts

Members
  • Posts

    7
  • Joined

  • Last visited

Reputation Activity

  1. Like
    simonmatts reacted to GradusGL in v. 1.1.0 update Spriter 2D: Game Maker Studio extension   
    It possible to add box object to check collision! For example, you attack animation contains sword in all frames, but in game you need deal damage in fixed phase of animation. 

  2. Like
    simonmatts reacted to Gillmog in v. 1.1.0 update Spriter 2D: Game Maker Studio extension   
    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 }  

×
×
  • Create New...