”Wanted Animation”
|
The beta-crunch is on and this week our group have been totally focused on adding the last, important features to our game. But also cutting the features that we won’t be able to add in time for beta or final. In our game the players avatar, the bat, has many different states that are all represented by a change of animation to the bat. Examples of these is: “flying” -the normal animation cycle of the bat flying without any powerup, “greenP” –the effect of the green powerup, the bat is covered in a green slime-like glow and “dashing” – the bat is inside a sparkly field that should indicate the amazing speed of the bat while dashing. One of the things I’ve been working on this week is a collection of functions we call “wanted animation”. What this does is actually manage the different animation cycles of mainly the bat and change it according to some set rules of priority. This basically means that instead of just switching animation for the bat when something happens, we actually, whenever an animation event happens, instead send a message to our wanted animation. The wanted animation then decides if that animation is applicable to the bat in that situation. There is actually two reasons for this. First we don’t have to have the many animation switching events individually keep track of the many different rules and priorities that govern if the bat is able to go in to that state. And second we have a system to actually hold back the triggering of animation that might not be able to apply at the moment, but a bit later. So, if the bat hits a green powerup that powerups animation is added to the wanted animation. In next update the engine will check if the current animation is matching the wanted animation. In this example let’s say it doesn’t. Then the current animation will change to what’s in the wanted animation. If some seconds later the player decides to do a dash while the green powerup is still active, the dash animation actually has higher priority than the powerup allowing the animation to be switched once again. But, if the short dash animation is finished before the green powerup has run out that animation would actually still be in the wanted animation so the bat would go from dashing to being “greenly” powered up. For the future I also hope to make this system actually transition between the right frames within the animation cycles. So if the bat is on frame four in an animation cycle, the system should be able to start the upcoming animation on frame five to make it look really smooth. The “problem” is that it actually already look pretty good so this will probably not be prioritized. |