⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 game.h

📁 3D游戏模板
💻 H
字号:
/* 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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -