Yes post today
|
So, to recapitulate on yestrurday’s work, I fixed the issue of not being able to switch between animations. Now, i won’t say that i am fully able to differentiate all the different variables with “animation” and “current” in them but when creating the animation the first time i use this piece of code void TurtleObject::AddAnimation(const std::string &name, AnimatedSprite *Sprite) { And when changing animations i used this similar one (with an iterator around it). if (m_current_animation != it->second){ This failed to change the actual animation and had me stumped for almost an entire day, but yesterday when i came back to it i tried making the change-method more similar to the AddAnimation one by adding the lines m_sprite = Sprite; and m_current_animation->m_current_frame = 1; around the inner line. this fixed the issue but i ran straight into a second issue, when loading the game for the first time the animated sprite would not be displayed until it changed frame for the first time. It took me the better part of the day but eventually i found the issue. The animation was set to change once the m_time was over the duration of the frame of the animation and then set time back to 0 to be increased over time. However m_time was set to 0 at initialization and therefore it would not change the frame until after the first one. I fixed this by setting m_time to 10 at the start which is more than the duration of any frame and will therefore trigger the frame change at the start of the game. We also had a look at the requirements of the assignment and compared it properly to our game, we figured we had enough to pass and that we might be able to manage a VG. So i went on to figure out a way to make a particle effect for when the player would get hit. Today i sat down in the Game room for a couple of hours trying to figure out a way to make a particle effect. I’m doing it by creating several game objects which i hope qualifies as a particle effect, if i get it working i might also get a little firework to display when the player reaches a goal. Looks like i’m gonna have to spend the weekend writing that report. I hope we can finish the game before the time runs out. |