Showing posts with label animation. Show all posts
Showing posts with label animation. Show all posts

On-the-fly animations

While the default Animation editor works great if you know the values that you want to animate beforehand, it is not the right solution if you want animations that depend on the current state of your game. For example:
  • move and zoom the camera to the player figure or a particular enemy;
  • use animations to move a sprite on a grid based on player's input;
  • gradually modify the volume of a song based on the player's health bar;
  • create fade-in and fade-out effects by animating the alpha transparency of a sprite.
For my most recent game I have created a play_animation function which allows me to quickly create such animations from GDScript:

Most popular posts in the last month: