Multiple Collision Masks

New releases and general discussions.

Post » Thu Feb 25, 2010 10:25 pm

I had an idea for construct 2 that sort of covers this. Multiple layered object. So you could do all your detectors on one object, or have, for example, armor that breaks off, or do fighting game style hitboxes. It'd be more flexible and obviously useful than just multiple collision masks.

What I do right now (as a practical, but annoying solution) is have an object. I copy the animation I want to add hitboxes to and paste it on this object. I think Go over the sprite with boxes and trim out what doesn't fit right. Then I set animation speed to 0, and give it the same animation name.

Then every frame it's position is set to that of the player, it's animation is set to that of the player and it's frame of animation is changed to that of the player.

Then you modify the original animation and do this ALL OVER AGAIN, but hey, what can you do? :|

You COULD store all attack data in a 3d array and then make a mini app for creating hitbox data. Then they're made each frame! But thats a lot of work! But thats also the 'pro' way to do anything fighting game related.
B
12
S
4
G
4
Posts: 238
Reputation: 2,426

Post » Thu Feb 25, 2010 11:09 pm

[quote="kayin":3eorqc32]What I do right now (as a practical, but annoying solution) is have an object. I copy the animation I want to add hitboxes to and paste it on this object. I think Go over the sprite with boxes and trim out what doesn't fit right. Then I set animation speed to 0, and give it the same animation name.

Then every frame it's position is set to that of the player, it's animation is set to that of the player and it's frame of animation is changed to that of the player.

Then you modify the original animation and do this ALL OVER AGAIN, but hey, what can you do? :|
[/quote:3eorqc32]
I'm not sure I follow you. Why modify the original animation?

I was thinking you'd just do this: Take your sprite animation that you want the hitbox for and copy it to another object. Trim down whatever you don't want to be part of that hitbox (or change it completely for whatever shape you want) and color the hitbox sprite a different color or outline it or something. Of course you'd cut the image down smaller to only where the hitbox is because empty canvas area still takes processing power. Create an image point on the original sprite animation for the hitbox sprite to glue itself to when it is needed. Only spawn the hitbox sprite when you need it then destroy it when the animation is finished (if it isn't supposed to be there always). Also, for example, if you have two kicking attacks, you can still just use one hitbox sprite with two animations if you don't like using lots of sprites. Depending on what you were doing, using one sprite for two attacks would not work well enough, but in that case you might want seperate sprites anyway.
B
2
S
2
G
2
Posts: 372
Reputation: 1,794

Previous

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 8 guests