ssprite.h
来自「用VC++及DirectX实现的SuperMario小游戏」· C头文件 代码 · 共 47 行
H
47 行
/*
Author: Bear
This source is free to anybody.
If you have any problem with this or some advice to me, please:
mailto: heyang22118952.student@sina.com
or yang45249.student@sina.com
or you can contact me through my QQ: 261570581
Welcome to discuss game programming techniques with me :)
And I like to play games!
*/
#pragma once
#include "SuperMarioDemo.h"
#include <string>
class SSprite
{
public:
SSprite(void);
virtual ~SSprite(void);
bool Init(const std::string& name, BDirectDrawSurface* ppSurfaces[], int type, int width, int height, int speedX, int speedY, int posX, int posY, int nFrames, std::string strAnimSeq);
bool Draw(BDirectDrawSurface* pDest, int worldX, int worldY);
virtual void Anim(void);
void UnInit(void);
int GetX(void);
int GetY(void);
bool HitTest(SSprite* sprite);
int GetType(void);
const std::string& GetName(void);
protected:
std::string m_name;
int m_nCurFrame;
int m_nFrames;
int m_posX, m_posY;
int m_speedX, m_speedY;
int m_width, m_height;
int m_animCount;
int m_animSeq[MAX_SEQUENCE_LENGTH];
int m_type;
int count; //used for animate
int temp; //used for animate
bool forward;
BDirectDrawSurface* m_ppSurfaces[MAX_FRAME_NUM];
};
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?