This article will show you how to create animation in SwinGame.
SwinGame lets you create animations. To make an animation you will need an image with some bitmap cells in it. Create your own animation script and the bundle script. Please refer to All about resources and all about animation to know how to write a bundle script and an animation script.
After that you will be able to build your own animation by just following these steps:
- Load the bundles (Load Resource Bundle) first
- Create a sprite (Create Sprite)
- Start the animation (Sprite Start Animation) with the animation name in the animation script.
- Give the animated sprite an initial position (Sprite Set X and Sprite Set Y) on the game screen.
- In game loop draw the sprite (Draw Sprite) and update the sprite (Update Sprite) you have just created.
The code below shows a small program that demonstrates all these steps in making an animation.