Locational Damage - Best way to do Collisions?

Get help using Construct 2

Post » Thu Mar 28, 2013 6:31 am

Hi, just would like quick advice on this part of my project. I'm making this following sprite, a Deer:



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:



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.



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?Byakko2013-03-28 07:13:26
Create HTML5 games
B
10
S
1
Posts: 27
Reputation: 697

Post » Thu Mar 28, 2013 8:19 am

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.
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,418

Post » Thu Mar 28, 2013 8:28 am

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).
Create HTML5 games
B
10
S
1
Posts: 27
Reputation: 697

Post » Thu Mar 28, 2013 9:01 pm

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.
B
7
S
2
G
3
Posts: 58
Reputation: 2,284


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 0 guests