2D hitboxes creation for sprites

Started by
0 comments, last by homer_3 12 years, 6 months ago
Hello Guys,

I'm new here. I searched over the web for my question but couldn't find a response, maybe i'm not using the right words. (sorry for my bad english)

I'm programming a 2D game and i would like to have some precision for collision detection between sprites. I searched about some approaches, like rectangle-rectangle collision, per-pixel collision, and for a good precision and less processing efforts end up with hitboxes.
for hitboxes i'm saying somethink like street fighter hitboxes


So, my problem is, i'm not sure exactly how this rectangles can be created and stored in a fast way. I think i will need a file correlated with the sprite sheets (possible animation), so for each frame i will have the information of the rectangles dimensions and positions relative to the sprite, and then i can test collisions against it. When a create my entity it will have a file with this shapes informations. To create this shapes i thought about some design editing tool that can create them visualy over the original sprite and export to a file with text descriptions, so my program can read them. Is there some tool like that?

i appreciate any suggestions,

thanks.
Advertisement
I'm currently working on a 2D fighter and was also wondering if a tool might already exist that would let me simply draw my hit boxes over my sprites and export the hit box data so I could import it into my game, and that way, easily and quickly create hit boxes. But I kind of had a hunch that there wasn't anything out there that was publicly/freely available that did that. Instead I just open my sprites in Paint.Net, which will show you the coords of your mouse, and I just generate my hit boxes from looking at the mouse coords of where I want the corners of my hit box. It really only takes about a little less than a minute to create each hit box.

This topic is closed to new replies.

Advertisement