game.h
来自「3D游戏模板」· C头文件 代码 · 共 45 行
H
45 行
/* main game loop
* Template CS game
* (C)2001 Mat Sutcliffe. See license.txt for license info (GPL)
*/
#ifndef __GAME_MAIN_H__
#define __GAME_MAIN_H__
#include <iutil/objreg.h>
#include <csutil/var.h>
#include "../sound.h"
struct gamedata_t {
/* DEVELOPER MODIFIABLE:
* Game state: this is passed to init() by your 'start game' menu item
* It is also useful to have all the data in one place for save and load */
};
struct inputcmd_t {
const char *str;// action name, like "Fire", "Jump" or "Walk"
int *var; // pointer to the variable to store the input state
bool toggle; // for boolean inputs see, csInputBinder::Bind()
};
class Game {
private:
Sound *sound;
gamedata_t data;
public:
bool playing;
static inputcmd_t inputcmds[];
void start(gamedata_t);
void preframe(csTicks);
void doframe(csTicks);
void postframe(csTicks);
void stop();
Game(Sound *, iObjectRegistry *);
const char* init();
~Game();
};
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?