Using animated sprites is an important part of games programming. Unless some kind of animation is applied to the sprites, it will not appear realistic enough and the whole mood of immersion in the game will be lost. Although animations can be achieved in a variety of ways, we will only look at sprite strip animation, as it is the most commonly used form of animation for 2D games.
To work through this recipe, you will need a machine running Windows. You also need to have a working copy of Visual Studio installed on your Windows machine. No other prerequisites are required.
In this recipe, we will find out how easy it is to create dialog boxes.
Open Visual Studio.
Create a new C++ project.
Select a Win32 Windows application.
Add a
AnimatedSprite.cpp
file.Add the following lines of code to
Source.cpp
:// This include #include "AnimatedSprite.h" // Static Variables // Static Function Prototypes // Implementation CAnimatedSprite::CAnimatedSprite...