home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Hack-Phreak Scene Programs
/
cleanhpvac.zip
/
cleanhpvac
/
WINTUT2.ZIP
/
Tut2
/
anim.h
next >
Wrap
C/C++ Source or Header
|
1997-04-03
|
763b
|
33 lines
class CAnimatedPic
{
public :
CAnimatedPic::CAnimatedPic()
{
m_nCurFrame = RANDOM (0, 13);
m_nFrameCount = 3;
} // Constructor
int m_nCurFrame;
// Current frame associated with this picture
void PositionImage (int nX, int nY)
{
m_nXPos = nX;
m_nYPos = nY;
m_nFrameCount--;
if (m_nFrameCount == 0) // Only alter the frame every five frames (otherwise too quick!)
{
m_nCurFrame = (m_nCurFrame + 1) % g_nNumFrames;
m_nFrameCount = 5;
}
}
int GetXPos () { return m_nXPos; }
int GetYPos () { return m_nYPos; }
private:
int m_nXPos, m_nYPos;
int m_nFrameCount;
}; // Simple little class to handle the individual pictures flying around
// Should have it's own .cpp file, but hey, I'm lazy