Proper length post, if only i had this much to write every day.
|
Okay, not on top today due to a case of migraine but thanks to the wonders of pharmaceutical science i am well enough to shake up something more than i did last night, So, I had Visual studio 2013 installed on the school laptop since i had been working on my stationary computer during the break. I could have sworn we were supposed to install 2012, note to self, look that up this Friday. Second note, Great news. I found the error in my animation code after a total of several hours of searching. The issue was in the EnemyObject.cpp file in the AddAnimation method. The code looked like this. void EnemyObject::AddAnimation(const std::string &name, AnimatedSprite *Sprite) {
When it was supposed to be this: void EnemyObject::AddAnimation(const std::string &name, AnimatedSprite *Sprite) {
The difference being the third line where the line triggers if the list of sprites are empty, the first version triggered if the input sprite was empty, therefore no animations were added. The way i realized this was when comparing my code with the Plattformer code from the Portal rather than my own, whether or not my own code was wrong(very likely) remains to be seen as i forgot that at home and won’t have access to it until this weekend. Once i had fixed this error the animations worked the way they were supposed to. Oh, which reminds me, i also found that for some reason had an extra line of std::getline(stream, row); in my method for reading the .txt file(AnimatedSprite* Spriteman::Load()) which caused it to skip one line of the code. It was probably a good thing that i found that issue before getting the animation working properly since it would have been tough coming out of one issue and straight into another without any idea of what was wrong. I think i have gained a better understanding about how this code for animations work during my work going through it over and over trying to find the issue, it also felt great to actually find the problem myself which was a good boost of confidence, something i always welcome. During my work with the animations Martin put the text/HUD project on ice for the time being and started working on the sounds of the game and a functional pause menu, and completed at least the music i believe, possibly both. He also changed some things about the different GameObjects so that they would only be drawn in the correct GameStates. Something that will make drawing things much easier since we won’t have to consider irrelevant objects when drawing a certain State. During these individual projects we haven’t really exchanged code with each other since the code of the other wasn’t really relevant for either of us, so at the end of the Monday class we sat down and i moved all my now functional animation onto his code so that we now have a proper new version. Now that is what i call a blog post. I wonder if there’s concentration aids in these migraine pills or something. |