Bentley
Member
Hello, I've been working on a Street Fighter like project (just for practice, there's no way I can actually do it). I've come across a tricky problem. For example: "D" is to punch, but holding back for two seconds and pressing "D" is also how you shoot your special. To solve this problem, I decided to give priority to special moves. I did this by placing the code for the special in the Begin Step (I suppose you could place it above the other code in the Step, but I foresee that becoming a bit messy).
I'm using objects as states and I'm using instance_change to change states. Here's the code
I don't know that much about the Begin Step. I only know that it runs before the other Step Events (which is why I'm using it to give priority).
I know that there are going to be countless other problems like this. Am I using the Begin Step the right way? Is there a better way to approach this problem? Thank you for reading.
I'm using objects as states and I'm using instance_change to change states. Here's the code
Code:
BEGIN STEP EVENT
//Special
if (key_right) && (key_left)
{
if (key_punch)
{
instance_change(obj_guile_special, true);
exit;
}
}
STEP EVENT
//Enter Punch State
if (key_punch)
{
instance_change(obj_guile_punch, true);
exit;
}
I don't know that much about the Begin Step. I only know that it runs before the other Step Events (which is why I'm using it to give priority).
I know that there are going to be countless other problems like this. Am I using the Begin Step the right way? Is there a better way to approach this problem? Thank you for reading.
Last edited: