Polishing for Final. Animations and such.
|
Hey there! After a couple of days in bed after a cold I am now back on my feet and are currently working on polishing and fixing current bugs and problems with our animation and trying to get them in order so the right ones play as they should. The ones I am currently working on are when the player grows or shrinks in size as they get more or losses candy. I have worked on this since it was one of the things i have been in charge of adding to our game and while my colleague is working on the map i am finishing this up. So we can cross another thing of the list. This is an image displaying how the transformation looks in game when you have gathered enough candy to grow from small to medium size. A smoke cloud appears and plays a short animation of the cloud and as that animation has reached the last frame it will change and play the animation for the medium sized pinata. So we have one currently active animated sprite that changes depending on circumstances what animation it should play, to sort this out we have different vectors (a vector is a container for different kinds of data, which this time holds images) containing different sets of animation frames. One for the small sized pinata simply standing idle, where it walks across the screen, one for its dash attack and so on. The condition for the transformation animation to be played is when our candy meter (representing the health for the player) reaches certain numbers and shall either grow or shrink (it is limited between 1 and 22) . As for the image above the pinata has reached 8 and shall now grow into the medium sized after the smoke animation has played. What we have had trouble with is that when these numbers have been reached the animation will play but you can lose or gain different amount of candy and so you can pass the limit for the sizes and change sprite without the animation has played since they are set to certain numbers. Which lead to that the animation only played sometimes when the condition was met and not every time which was our plan. In order to fix this I looked back onto our previous project where i had a method that I thought could work in this scenario. There I used an int (Int is a type used to hold whole numbers) to hold certain number that represents the current state you are in and uses this number to determine where the player would spawn. This is very similar to what I am trying to accomplish here and I use the same kind of of int and sets the value to the currently active size and depending on what size you were before. As you change size now it will first check the int for what number it represent and afterwards it sets the current animation to transformation and then again to what size that should be running. This is it for now, I hope that you could follow what I talked about and leave not to confused and I wish you a good weekend and until next time. |
