Multiple Attack Entity's vs Changing Attack Entity's Hitbox


#1

I am working on a platformer fighting game, I would like to implement attack entities that check for collisions with enemies only when the attack button is pressed as mentioned above - I’m wondering if it would be more efficient to have a single attack entity for my player and just change the attack entity’s hitbox for different attacks, OR have a separate entity for each attack?

Any opinions or experiences?

Thanks,


(Jacob Albano) #2

If each hitbox will be a different size, it’s best to construct a few of them and use the appropriate one in each situation. It’s easier on the cache and the garbage collector.


#3

So a different entity for each uniquely sized hitbox?