Hi
I?m implementing a brawler, with a collision logic as this one:
raywenderlich.com/24452/how-to-make-a-side-scrolling-beat-em-up-game-like-scott-pilgrim-with-cocos2d-part-2
and I want to do this:
whenever the player (using the platformer behavior) presses a button, I want to spawn a HitBox (that will represent the fist). It?s location should be x pixels in front of the character (so it the HitBox hits the enemy, it dies).
The hit box should exist for half a second, and then disappear.
The thing is that when my player is moving, his HitBox should move with him.
How can I do that?
So far, I spawn a hitbox by the playerBox, but this leaves it floating on space on the place it was created.
I considered a main game OnEveryTick, but the HitBox should be local to the player, as the enemies will use their own HitBox.
Thanks.