How can I re-size my collision box?

I have multiple actors that have effects happen when they collide with each other. However, the collision areas around each of these actors are much too large for the image I am using with them...

I've been searching for an answer for this for several hours now and unfortunately I'm getting frustrated with myself for not being able to find it.

If the original creation of the images used is a factor then here is some info on that.


each image is created in Photoshop on a 2048x2048 plane with 300 pix./in. I deleted the background on all of the images i am using and only have one layer just to make sure there is no background unseen images.

When I apply the image into GS It SAYS the image is 2048x2048, but until I re-size it, it doesn't show the actual numbers.

Please help if you can. =[ getting very frustrated as I have been working on this for several hours now.

Best Answers

  • tatiangtatiang Posts: 11,949
    Accepted Answer
    Save your images as 72dpi (see http://www.jamie-cross.net/?portfolio=gamesalad-recipe-002-graphics-and-animation).

    Are you cropping your images so that there is no extra space around the visible area of the image?

    A circular collision actor will have a circular collision area.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • FallacyStudiosFallacyStudios Posts: 970
    Accepted Answer
    Honestly the best method in which to get highly accurate collision boxes is to make it yourself. Save your main actors X and Y coords as Game Reals. Then have the collision detection inside the actor your player collides with.

    If game.PlayerX >= self.positionX-40 AND game.PlayerX <= self.positionX+40

    Same with Y... it creates your own collision box you can control where the collision happens rather than just having it be the generic GS collision detection which collides with the outsides of your image.

Answers

  • JiggleboxJigglebox Member Posts: 63
    PS. My collision boxes appear to be about .5 in. too large.
  • JiggleboxJigglebox Member Posts: 63
    edited February 2014
    Also, in the Graphics function I assume that if i switch to a circular Collision Box, it would change the shape of the box surrounding my image but it remains a square.
  • JiggleboxJigglebox Member Posts: 63
    Save your images as 72dpi (see http://www.jamie-cross.net/?portfolio=gamesalad-recipe-002-graphics-and-animation).

    Are you cropping your images so that there is no extra space around the visible area of the image?

    A circular collision actor will have a circular collision area.


    Sorry for the late response, with the way I am saving them right now I shouldn't need to crop anything because I simply have the object with no background. I still need to save it to 72dpi but I will deff go check out Jamie's guide on this. Thank you for the answer.
  • JiggleboxJigglebox Member Posts: 63
    Honestly the best method in which to get highly accurate collision boxes is to make it yourself. Save your main actors X and Y coords as Game Reals. Then have the collision detection inside the actor your player collides with.

    If game.PlayerX >= self.positionX-40 AND game.PlayerX <= self.positionX+40

    Same with Y... it creates your own collision box you can control where the collision happens rather than just having it be the generic GS collision detection which collides with the outsides of your image.</blockquote>

    Thanks, I'll probably use this in the future but as of right now my actors are all rectangles and a circle so i don't think i have any need for this. Is there any benefit to doing this even if the actors match up perfectly already?

  • FallacyStudiosFallacyStudios Member Posts: 970
    No, no need. If you are using perfect squares, rectangles, or circles with virtually no gaps there is no need. Just change the collision to either rectangle or circle and you will be fine.

    If you however had a character that had excess room in the image that was just transparent and wanted the collisions to be more precise, this is how you would go about it.
Sign In or Register to comment.