D
DyingSilence
Guest
Hello everyone.
I'm currently creating a fighting game. The combat is based on states, for example if one fighter is in state "punching" and the other is in state "standing", the victim will go to state "stunned" for a short time and take some damage.
I made it so when a fighter is in air and is punched, he is knocked back. Every mid-air state has it's individual, yet very similar math behind this.
The fighter has vspeed set to 0, speed set to some various ammount and some gravity to slowly fall. His state becomes "falling", and when he touches the groung, gravity and both speeds become 0, and state changes to "fallen". It works perfectly fine, excerpt the case in which the pre-contact state is "jump_kicking". Then the variable "speed" isn't set to 0, despite the set command is in the same block as zeroing vspeed and gravity.
I have no idea why is this happening.
I'd appreciate some help.
Sorry for potentially bad English, i'm a foreigner.
I'm currently creating a fighting game. The combat is based on states, for example if one fighter is in state "punching" and the other is in state "standing", the victim will go to state "stunned" for a short time and take some damage.
I made it so when a fighter is in air and is punched, he is knocked back. Every mid-air state has it's individual, yet very similar math behind this.
The fighter has vspeed set to 0, speed set to some various ammount and some gravity to slowly fall. His state becomes "falling", and when he touches the groung, gravity and both speeds become 0, and state changes to "fallen". It works perfectly fine, excerpt the case in which the pre-contact state is "jump_kicking". Then the variable "speed" isn't set to 0, despite the set command is in the same block as zeroing vspeed and gravity.
I have no idea why is this happening.
I'd appreciate some help.
Sorry for potentially bad English, i'm a foreigner.