Still Broken
This class I want to focus on fixing my broken script from last class.
So to start this off I went back to the code I had changed and looked at it in a new light. And to my surprise I forgot to add the "Obj_player" to the script. This means the code had no actual effect on the player character and was simply just doing nothing. So I changed some things around and made it look like this instead.
if keyboard_check(ord(obj_player.button_activate))
{
obj_player.sprite_index = spr_player_1_drinking
obj_player.busy = true;
if image_index = -0 and obj_player.sprite_index = spr_player_1_drinking
{
obj_player.busy = false;
}
}
The red text is the code I am currently working on, and the red, bold, underlined text is what I added today to hopefully fix my problems.
Now the animation triggers, but the busy variable, which pauses the player and stops them from moving attacking and blocking doesn't reset to false. This shows me exactly what part of the code is not working correctly.
if image_index = -0 and obj_player.sprite_index = spr_player_1_drinking
{
obj_player.busy = false;
}
The section highlighted above is not being properly detected. This results in the player becoming stuck in this animation without the ability to move.
After another 10 minutes of attempting new ways to change the code around, I still can't figure out why it wont work. So next class I will continue to work with it. And I might even call to the Howie for some minor assistance, or possibly the internet.
No comments:
Post a Comment