|
So another week has past, another artifact accomplished and perfected. A new thing has been learned this week. animations.
if you haven’t been paying attention in school I guess I’ll go over the basics. You create a class that allows itself to have a string of pictures. These depicts an animation and you line them up perfectly and in order. You take all of these images and load them into the program as just ONE image. You then created small frames of where you want to look at this specific time and for how long of a duration on this ONE image. finish it off by putting in more and more methods of genius into the class like pausing.
So I probably understood what I was doing with animations about two days ago. It’s like one of those days you fit every puzzle in your brain and understand every step you just took when seconds before you were a nerve wreaking moron just typing away until stuff showed up.
So each object of animation I create need to have a few details included before I could actually use them. The program loads a sprite for lets say an enemy, when inside the enemy class I create an Animation Object and send the sprite I just loaded, a float duration for each frame and two booleans(if paused and if looped) with it as a parameter.
When this is done I call to a method inside the animation called AddFrame that point a rectangle you create that’s fitting for you enemy and you just point it where you want a frame to be. It’s that simple hehehe…
I wont lie, it took a senior, one of the smartest guys in class and a week to figure all this crap out. I’ve been playing around with it since and finally gotten everything in order now. I apparently didn’t understand the concept of setOrigin that SFML has and had way to much to think about. There have been a few changes in the group that wasn’t planned and we’ve made some cuts. It’s not been great but this week have really been an eye opener. If anything I see now that this is something that I really want to do. I have been having is creating my high score class which I WONT be talking about anytime soon. As a bonus I created some kind of score feedback(pictures will come soon, on the wrong comp) which will be our picture for this weeks post. I tried to keep this one short so thanks for reading and cheers.


|