Locational Damage - Best way to do Collisions?

0 favourites
  • 4 posts
From the Asset Store
Best car suspension with spring effect and very cool terrain generation.
  • Hi, just would like quick advice on this part of my project. I'm making this following sprite, a Deer:

    <img src="http://i.imgur.com/HVgfo2m.jpg" border="0" />

    If I'm using a single standard collision box, it would have to be about this big in order to cover the entire sprite. But it's a little too large and imprecise.

    I want it so that my Player character, shooting a Spear projectile, if it hits the 'head' of the Deer, it is automatically killed, whereas a body shot would just cause it to take damage but run off.

    So this is what I'm thinking:

    <img src="http://i.imgur.com/vhfweHO.jpg" border="0" />

    My concern is I have no idea what would be detected at the point they overlap.

    The thing is I've read up on the forum, several methods, and I'm not sure which is best.

    One has it that I could use invisible sprites pinned to image points on a single large rectangle Deer sprite to act as alternate collision boxes, and maybe have the spear detect the Nearest Imagepoint/collide-with-box and react appropriately.

    Another I read up is to use Containers. I have no idea what benefit would that give? Would that allow me to organize the collision boxes on multiple Deer, but allow me to detect if there was a 'headshot' on each individual one?

    And then there's the Collision Polygon feature.

    <img src="http://i.imgur.com/BLeB7Jl.png" border="0" />

    I haven't tested this yet. I've already set-up a simple prototype of my game using the standard boxes. But with Collision Polygon, I use the sprite directly? But I can't seem to see/preview the Collision Polygon on the layout itself, and the sprite is still selected as a giant rectangle.

    So I don't know how to get precise collision checks that Collision Polygon seems to give?

    Sorry if these questions were asked multiple times, but just that the various methods made me confused as to what the best approach was.

    There will also be a second, more massive mob I'm making that may require me to detect its legs, head, and main body. Again I'm unsure whether a large 'general' collision box is best, with invisible pinned to imagepoints collision boxes; or a Collision Polygon?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Create image points on your deer. Then create transparent sprites to use as your collision boxes and shape them as needed. Add the logic to take health, etc... from the deer depending on which one is hit... Pretty much like in the platformer tutorials but create multiple playerboxes/hitboxes and pin them to the image points that they should go to on your deer.

  • So keep the main deer sprite in the default bounding box shape; should I keep the transparent collision sprites as boxes too or collision polygons? Would it be significantly more memory intensive to have more precise transparent sprites by using the collision polygons to shape them?

    Also, I attached the transparent sprites in the events sheet right? On System start-up, etc. etc. (I saw someone post how to do this so I think I can get it).

  • you can do on visble deer set collision and all that mess because once the dear is dead you want those two hit box to disappear as well.

    You can set the hit box to set to position with another object and list the image point you want you dont need to pin it.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)