📄 cmodelgame.h
字号:
///////////////////////////////////////////////////////////////////////////////
//
// CModelGame.h
//
// Copyright (c) 2003 Forum Nokia. All rights reserved.
//
// Technology developed by Rocket Science Oy Ltd
//
///////////////////////////////////////////////////////////////////////////////
#ifndef __CMODELGAME_H__
#define __CMODELGAME_H__
// INCLUDE FILES
#include "MModel.h"
#include "MSystem.h"
#include "CFont.h"
// FORWARD DECLARATIONS
class CSprite;
class MCharacter;
class CTileMap;
// CLASS DECLARATION
class SP
{
public:
TInt type;
TInt x;
TInt y;
TInt width;
TInt height;
TInt ctr;
TInt level;
TInt direction;
TInt action;
TInt sight;
TInt value;
SP() {};
};
/**
* CModelGame Class of the main game.
*/
class CModelGame
: public CBase
, public MModel
{
public:
/**
* Two-phased constructor.
*/
static CModelGame* NewL( MSystem* aSystem );
/**
* Destructor.
*/
~CModelGame();
private:
/**
* Default constructor
*/
CModelGame( MSystem* aSystem );
/**
* Second phase constructor.
*/
void ConstructL();
public: // MModel
void ActivateL();
void Deactivate();
void Draw( CBitmap& aTarget, CFbsBitGc& aGc );
void Move();
private: // Data members
MSystem* iSystem; /// pointer to system
TInt counter;
TInt level;
TInt gameState;
CBitmap* imgPlayerSmall;
CBitmap* imgPlayerMiddle;
CBitmap* imgPlayerLarge;
CBitmap* imgEnemy0Small[11];
CBitmap* imgEnemy0Middle[11];
CBitmap* imgEnemy0Large[11];
CBitmap* imgScores;
CBitmap* imgTop;
CBitmap* imgIntro;
CBitmap* imgYummy;
CBitmap* imgGrowth;
CBitmap* imgSharks;
CBitmap* imgSinlan;
CBitmap* imgPS[11];///not don't Destroy
CBitmap* imgPM[11];//don't destroy
CBitmap* imgPL[11];//don't destroy
CBitmap* imgPlayer[33];////don't delete
CBitmap* imgEnemy[165];////don't Destroy
CBitmap* imgScore[13];///don't destroy
CBitmap* imgPerl[4];
CBitmap* imgBubble;
CBitmap* imgBounus[5];
CBitmap* imgBack[3];
CBitmap* imgShark[4];////don't Destroy
CBitmap* imgNumber;
CBitmap* imgBy;
CBitmap* imgShuimu;
CBitmap* imgMenu;
CBitmap* imgStun;
CBitmap* imgArrow;
CBitmap* imgArrowL;
SP sprite[70];
SP* player;
TInt score;
TInt hit;
TInt collected;
TInt levelCompleteCtr;
TInt yummyCtr;
TInt newCtr;
TInt offsetX;
TInt offsetY;
TInt smallEaten;
TInt middleEaten;
TInt largeEaten;
TInt smallCtr;
TInt middleCtr;
TInt largeCtr;
TInt freezeCtr;
TInt speedCtr;
TInt doubleCtr;
TInt sharkCtr;
TInt congratulationsCtr;
TInt deadCtr;
TInt gameOverCtr;
TInt rest;
TInt PLAYER;
TInt SHARK;
TInt BLACK;
TInt WHITE;
TInt SEASTAR;
TInt DOUBLE;
TInt EXTRALIFE;
TInt SPEED;
TInt FREEZE;
TInt SHUIMU;
TInt BUBBLE1;
TInt BUBBLE2;
TInt PERL;
TInt SCORE;
TInt SMALL;
TInt MIDDLE;
TInt LARGE;
TInt HUGE;
TInt PLAY;
TInt INTRO;
TInt LEVELCOMPLETE;
TInt ANALYS;
TInt MENU;
TInt ABOUT;
TInt HELP;
TInt CONGRATULATIONS;
TInt RIGHT;
TInt LEFT;
TInt SWIM;
TInt TURN;
TInt IDLE;
TInt MOVENEAR;
TInt MOVEFAR;
TInt INCREASE;
TInt OPEN;
TInt EAT;
TInt CLOSE;
TInt BOUNUS;
TInt BUBBLEINCREASE;
TInt BUBBLEBOUNUSINCREASE;
TInt HIT;
TInt KILL;
TInt SHUIMUINCREASE;
TInt STUN;
TInt BOARDHEIGHT;
CBitmap* imgTitle;
TRgb backGroundColor;
TInt menuColor;
TInt titleY;
TInt menuY;
TBool resumeFlag;
TBool hasSound;
TBool pauseFlag;
TBool isRunning;
TInt helpY;
TInt screenWidth;
TInt screenHeight;
public:
void DrawPauseHint( CBitmap& aTarget, CFbsBitGc& aGc );
void InitConstData();
void ReleaseLastKey();
void UpdateHelp();
void UpdateAbout();
void CleanSprites();
void NewGame();
void UpdateMenu();
void InitLevel(TInt level);
void InitBounus( const SP& perl);
void PlayerDead();
void InitScore(TInt value,TInt x,TInt y);
void KillEnemy( SP* enemy );
void InitShuimu();
void RandomShuimu();
void InitShark();
void RandomShark();
void UpdateEnemies();
void UpdatePlayer();
void InitBubbleBounus();
void InitBubble();
void RandomBubbles();
void DrawRest( CBitmap& aTarget, CFbsBitGc& aGc );
void DrawCongratulations(CBitmap &aTarget, CFbsBitGc &aGc);
void DrawAbout(CBitmap &aTarget, CFbsBitGc &aGc);
void DrawHelp(CBitmap &aTarget, CFbsBitGc &aGc);
void DrawMenu(CBitmap &aTarget, CFbsBitGc &aGc);
void DrawTitle(CBitmap &aTarget, CFbsBitGc &aGc);
void DrawAnalys(CBitmap &aTarget, CFbsBitGc &aGc);
void DrawGameOver(CBitmap &aTarget, CFbsBitGc &aGc);
void DrawDead(CBitmap &aTarget, CFbsBitGc &aGc);
void DrawPause( CBitmap& aTarget, CFbsBitGc& aGc );
void DrawLevelComplete(CBitmap &aTarget, CFbsBitGc &aGc);
void DrawReset( CBitmap& aTarget, CFbsBitGc& aGc );
void DrawBounus(CBitmap &aTarget, CFbsBitGc &aGc);
void DrawCanEat(CBitmap &aTarget, CFbsBitGc &aGc);
void DrawGrowth(CBitmap &aTarget, CFbsBitGc &aGc);
void DrawScore(CBitmap &aTarget, CFbsBitGc &aGc);
void DrawBoard(CBitmap &aTarget, CFbsBitGc &aGc);
void DrawStatus( CBitmap& aTarget, CFbsBitGc& aGc );
void DrawSP(CBitmap &aTarget, CFbsBitGc &aGc);
void DrawBack( CBitmap& aTarget, CFbsBitGc& aGc );
void DrawIntro( CBitmap& aTarget, CFbsBitGc& aGc );
void InitPerl();
void InitEnemy( TInt type, TInt level);
void AddEnemy();
SP* GetFreeSprite();
void InitPlayer();
TInt menuIndex;
TInt64 seed;
TInt lastMenuKey;
};
#endif
// End of file
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -