I added punching to Hapax, video included

Started by Legend, Aug 02, 2024, 04:37 PM

0 Members and 1 Guest are viewing this topic.

Legend



There's no violence in Hapax but there are still moments where melee attacks are useful. Plus it's just important to give the player full control over their body. It's a 2D VR game  ::)

Only took about an hour to implement since I already had a lot of systems in place. Of course it could use more refinement, but I'm surprised how nice it feels having the punch animation transition from/to the body's rest position. The vast vast majority of games just glue the arms to the camera. I had that originally but I had trouble making the shadow look good.

Punching is automatically done with the left hand if the right is busy, so spamming the button punches with both arms. Would also punch with the left if the right is in the middle of picking something up or throwing. Punching while holding something just uses the same animation without forming a fist. I wouldn't mind a swing animation when holding longer objects, but that's not too important.

Legend

Had a unexpected dilemma. The player can toggle their flashlight on and off but this also uses a hand animation. By spamming the punch and flashlight buttons at the same time, the que of pending animations could grow arbitrarily large as the hands tried as best they could to make sure every single action gets performed. So then the arms would just be stuck punching and toggling the flashlight for minutes even after the player stops pressing them.

Just put in a limit for punching so it doesn't build up too much. Easy enough solution, no player will care that they spammed the punch button 13 times in a second yet only got 6 punches.


Another similar problem I have is with swapping items between inventory slots. Right now if your belt is full your hands literally juggle two objects to get them swapped and that takes a second so the queue can get arbitrarily large as well. It's fun to walk around while your player keeps juggling but I need to get rid of it. Probably will just make it so you can't grab from an inventory slot unless its current item is the same as the item it will have at the end of the queue.