📄 game.h
字号:
#ifndef _GAME_H
#define _GAME_H
//--------------------------------------------------------------
/**\!File
*
*File name:GAME.h
*
*His:add by honghaier @2004/2/17
*
*Desc:游戏类
*/
//---------------------------------------------------------------
#include <d3dx8.h>
#include <stdio.h>
#include "BASIC.h"
#include "Cuboid.h"
#include "PERSON.h"
#include "KEYBOARD.h"
#include "2DMUSIC.h"
#include "d3dfont.h"
#include "ShowMsg.h"
#include "GameEnd.h"
#define WOODROW 29
#define WOODCOW 30
//---------------------------------------------------------------
/** GAME 类.
* 游戏类
*/
class CGame
{
int m_type;//玩法模式 1:赛分模式 2:对战模式
int m_align;//主角位置
bool m_stop;
CD3DFont *m_pFont1;
CD3DFont *m_pFont2;
TCHAR m_strFont[100];
DWORD m_dwFontSize;
CKEYBOARD m_keyboard;
CMusicManager* m_pMusicManager;
CSoundManager* m_pSoundManager;
ShowMsg m_Msg;//--------显示信息---------
C2DMUSIC m_bgmusic;
C2DSOUND m_sound[5];//---声音------
int m_personnum;//游戏人数
int m_level;//游戏原设级别
int m_row;//游戏行数设定
bool m_isshownext;//是否显示下一个
CPERSON m_person1;
CPERSON m_person2;
CCuboid *m_wood;/**墙体 */
CCuboid *m_skybox;/**天空 */
int m_wooddata[WOODROW][WOODCOW];
HWND m_hWnd;
public:
CGameEnd m_EndPart;
bool m_end;//结束游戏
bool Initialise(HWND hWnd, UINT nWidth, UINT nHeight);
void GameLoop();
void Render();
void DoMusic();
void Stop();
void EndGame(bool _isend);
void ReLife(int _which);
LPDIRECT3DDEVICE8 GetDevice();
CGame();
virtual ~CGame();
bool SetNum(int _num);
void SetType(int _type);
/**!\brief
*\param _p1:人数设定
*\param _align 位于窗口的位置
*\param _row 初始行数设定
*\param _level 初始级别设定
*\param _isshownext 是否显示下一个
*\param _isaddrow 玩法模式
*/
bool InitialiseGame(int _p1,int _align,int _row,int _level,bool _isshownext,bool _isaddrow);
/**!\brief
*设置键盘
*/
void SetKey(int ,CControl *);
private:
D3DFORMAT CheckDisplayMode(UINT nWidth, UINT nHeight, UINT nDepth);
HRESULT InitialiseD3D(HWND hWnd, UINT nWidth, UINT nHeight);
void RenderWood();
void RenderTile();
void RenderPerson(int _personnum);
void RenderFont();
LPDIRECT3D8 m_pD3D;
LPDIRECT3DDEVICE8 m_pD3DDevice;
void SetupCamera();
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -