📄 mopoidsettings.h
字号:
/*
========================================================================
Name : MopoidSettings.h
Author :
Copyright :
Description : Stores settings related to the game and the current level.
License :
========================================================================
*/
#ifndef __MOPOIDSETTINGS_H__
#define __MOPOIDSETTINGS_H__
#include <eikenv.h>
#include <aknutils.h>
class CMopoidSettings : public CBase
{
public:
static CMopoidSettings * NewL();
~CMopoidSettings();
enum TGameStatus {
EPlaying,
EStarted,
ENewLevel,
EFinished,
ELifeLost,
EDied
};
private:
CMopoidSettings();
void ConstructL();
public:
void SetScreenSize(const TSize& aNewSize);
void SetDrawRect(const TRect& aNewRect);
void SetGameRect(const TRect& aNewRect);
void SetBallSize(const TInt aNewWidth);
void SetPanelSize(const TInt aNewWidth);
void SetGridSize(const TInt aCols, const TInt aRows);
public:
/**
* The current highscore of the player.
*/
TInt iHighScore;
/**
* Current score of the player.
*/
TInt iScore;
/**
* Lives the player has left.
*/
TInt iLives;
/**
* Score when a live is lost.
* (Attention: should usually specify a negative value!)
*/
TInt iScoreLiveLost;
/**
* Level the player is currently playing.
*/
TInt iLevel;
/**
* Number of available levels.
*/
TInt iAvailableLevels;
/**
* Bonus score when the user cleared a level.
*/
TInt iScoreLevelCleared;
/**
* Bonus score when the user played through the game.
*/
TInt iScoreGameFinished;
/**
* Score for destroying a normal block.
*/
TInt iBlockNormalDestroyScore;
/**
* Decrease the score every x microseconds.
* (5000000 = 5s)
*/
TInt iScoreDecreaseTime;
/**
* Decrease the score by this value every
* iScoreDecreaseTime microseconds.
*/
TInt iScoreDecrement;
/**
* True if the game is paused.
*/
TBool iGamePaused;
/**
* Status of the game.
*/
TGameStatus iGameStatus;
/**
* Sound level
* 0 = deactivated
* 1 = 1/1 -> full volume
* 2 = 1/2 -> low volume
*/
TInt iSoundLevel;
TSize iScreenSize;
TRect iScreenRect;
TRect iDrawRect;
/**
* Virtual game field rectangle (640x480), scaled when drawing.
*/
TRect iGameRect;
TSize iPanelDefaultSize;
TSize iPanelSize;
TSize iPanelSizeHalf;
TReal iPanelSpeed;
TReal iPanelReflection;
TSize iBrickSize;
TInt iGridCols;
TInt iGridRows;
TPoint iGridTopLeft;
TSize iBallDefaultSize;
TSize iBallSize;
TSize iBallSizeHalf;
TReal iBallStartSpeed;
TReal iBallSpeedMaxX;
TReal iBallSpeedAccX;
TReal iBallSpeedMaxY;
TReal iBallSpeedAccY;
// Cached variables for faster access
// Needed to convert from virtual coordinate sytem to the screen coordinate system
TReal iGameRectX;
TReal iGameRectY;
TReal iGameRectWidth;
TReal iGameRectHeight;
TReal iDrawRectX;
TReal iDrawRectY;
TReal iDrawRectWidth;
TReal iDrawRectHeight;
/**
* Cache for the font that is used to display the text.
*/
const CFont* iFontUsed;
/**
* The font height (ascent) in pixels.
*/
TInt iFontHeight;
/**
* The additional offset that's added to the font
* height to get to the iTextYOffset.
*/
TInt iTextBaselineOffset;
/**
* The y-offset between two lines. Includes the size of a line,
* not just the space inbetween two lines.
*/
TInt iTextYOffset;
/**
* Seed for random number generator.
*/
TInt64 iRandSeed;
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -