tgamedata.h

来自「symbian 的一个 二维飞行游戏 源码 及相关技术文章」· C头文件 代码 · 共 56 行

H
56
字号
// Copyright 2002 Kenneth Guy,
// 
// TGameData.h

#ifndef _TGAMEDATA_H_
#define _TGAMEDATA_H_

/** \file TGameData.h 
    defines class TGameData */


#include <e32std.h>
#include "TLevelData.h"

/** Data assoicated with a game.
    
    Contains the information that is in common between the CGame, CGameFramework and ui classes.

*/

class TGameData {
  public:
  /** Defines values for the iKeys bitmask. */
      
    enum TGameKey {
      ELeft    = 0x00000001,  ///< Left arrow pressed
      ERight   = 0x00000002,  ///< Right arrow pressed 
      EUp      = 0x00000004,  ///< Up arrow pressed 
      EDown    = 0x00000008,  ///< Down arrow pressed 
      EAction1 = 0x00000010,  ///< 'A' pressed, unused
      EAction2 = 0x00000020,  ///< space pressed, unused
      EAction3 = 0x00000040,  ///< Left shift pressed, fire button
      EAction4 = 0x00000080,  ///< Enter pressed, unused
      EQuit    = 0x20000000   ///< 'Q' pressed
    };
    
    TUint32  iKeys;    /**< Bit mask of keys currently pressed.
                           Keys bits are set when CGameFramework receives
                           a key down event, and unset when it receives a
                           key up event. The fire button is also unset by
                           the CGame class when it fires a bullet. */
    TUint32  iScore;   /**< Players score */
    TUint32  iLives;   /**< Number of lives left */
    TBool    iForceRedraw;  /**< Set to force the status area to reupdate
                                after the game has been paused */
    TBool    iLevelCompleted;   /**< ETrue if CGame::Play finishes because
                                    player got to the end of the level, EFalse
                                    if the player quit or died.*/

    
    TLevelData iLevel; /**< Level information, set up by CGameFramework::LoadLevelL */
  };


#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?