Post 141
Problem Solved-ish
Today I am going to hopefully fix picking up health potions. The first problem I noticed that I missed yesterday was the fact that my code was located weird, and it caused some problems. So the code that told the game when to stop standing still was under the same "If" statement that told the game when the player was touching the health potion. However this doesn't work because once the player hits the activation button to pick up the potion, it disappears along with the code inside of it. So what happens is this code becomes completely irrelevant.
So what I did this time around was take that section of code and moved it to the outside of that "If" Statement. This should allow the game to actually read the code I have written.
So once again I have run into a problem, but this time I know exactly what is wrong with it.
Basically my code works right up until the very last health potion is picked up, once it is picked up this code to tell it to stop is not found, because the potion has been destroyed and therefor the code is not in the game. The way to fix this would surely just transporting all the potion code into the player so this "Logic" stays within the game right up until your death.
Next class I will work on transplanting the code into the player.
No comments:
Post a Comment