Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by Gamma

Hello everyone,

How do you implement a punching / kicking / physical combat moves?

My initial idea, since I am used to projectiles and shooting for games, was to make a transparent image that would be projected from the player when a certain button is clicked and since no one can see the projectile, but the animation, the user assumes that the player had just punched the enemy when in fact it was an "invisible bullet" so to speak. I find this idea not quite efficient.

Is there another way to create physical combat without the use of invisible projectiles?

Pseudo code, actual code, or ideas would be much appreciated. Thank you all in advance. Have a good Friday.

Regards,
Gamma

1 decade ago by stillen

I would make a hotbox entity that doesn't move, isn't effect by gravity and doesn't collide with anything. This hitbox entity spawns during a certain frame of the animation. Then that entity could either have a kill timer or after the animation is over you kill all hit box entities.

This is similar to the bullet idea, but you can have better control of the hitbox when you spawn it by adjusting the size and location of it.

You can then have sweet spots, like most fighter have. Spawning a smaller hit box that does more damage and only lasts for like 10 frames and then having the larger weaker hotbox that lasts for 40 frames.

Old school fight games do something very similar to this.
Page 1 of 1
« first « previous next › last »