sgame.h

来自「用VC++及DirectX实现的SuperMario小游戏」· C头文件 代码 · 共 50 行

H
50
字号
/*
Author: Bear

This source is free to anybody.
If you have any problem with this or some advice to me, please:
    mailto: heyang22118952.student@sina.com
        or  yang45249.student@sina.com
or you can contact me through my QQ:     261570581

Welcome to discuss game programming techniques with me :)
And I like to play games!
*/
#pragma once
#include "SuperMarioDemo.h"
#include "SMap.h"
#include "SSprite.h"
#include "SMario.h"
#include "SSpriteManager.h"
#include "SSpriteFactory.h"

class SGame : public BGame
{
public:
	SGame(void);
	virtual ~SGame(void);
	virtual int Initialize(HINSTANCE hInstance, HWND hwndMain, bool windowMode, int screenWidth, int screenHeight, int screenBpp);
	virtual int ShutDown(void);
protected:
	virtual bool ProcessInput(void);
	virtual bool RunGameLogic(void);
	virtual bool DrawScreen(void);
private:
	void GameOver();
	int ReStart();
	int ReStartGame();
private:
	BBitmap bitmap;
	//BWaveFile waveFile;
	//"SuperMarioDemo" used variables
	SMap mapLevel1;	//Encapsulate map of the world.
	SMario* mario;	//sprite controled by player
	SSpriteFactory spriteFactory;	//use this to create sprites
	SSpriteManager spriteManager;	//use this to manage sprites
	int score;	//players' score
	int life;	//players' life, when it becomes 0, game over.
	bool restarting;	//used for restart screen
	bool gameOver;
	char buf[255];
};

⌨️ 快捷键说明

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