📄 ball.h
字号:
#if !defined(AFX_BALL_H__D380AC40_F5F9_4E61_BD04_F2EE8EE65875__INCLUDED_)
#define AFX_BALL_H__D380AC40_F5F9_4E61_BD04_F2EE8EE65875__INCLUDED_
#include "Sprite.h"
using namespace gamespace;
class CBall : public CSprite
{
private:
CBall();
void ConstructL(CFbsBitmap* aBmp,CFbsBitmap* aBmpMask,TInt aCellWidth=0,TInt aCellHeight=0);
public:
~CBall();
static CBall* NewL(CFbsBitmap* aBmp,CFbsBitmap* aBmpMask,TInt aCellWidth=0,TInt aCellHeight=0);
static CBall* NewLC(CFbsBitmap* aBmp,CFbsBitmap* aBmpMask,TInt aCellWidth=0,TInt aCellHeight=0);
private:
TInt iSpeedX;
TInt iSpeedY;
TRect iRect;//活动范围
private:
void Init();
public:
void SetActiveRect(const TRect& aRect);
void SetSpeed(TInt aX,TInt aY);
void CollideWithActiveRect();
void CollideWithBall(CBall& aBall);
void GetSpeed(TInt& aX,TInt& aY);
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -