GameState.h
上传用户:zhj2929
上传日期:2022-07-23
资源大小:28772k
文件大小:1k
源码类别:

游戏引擎

开发平台:

Visual C++

  1. #ifndef _GAME_STATE_H_
  2. #define _GAME_STATE_H_
  3. #include "../../JGE/include/JApp.h"
  4. #include "../../JGE/include/JGE.h"
  5. #include "../../JGE/include/JSprite.h"
  6. #include "../../JGE/include/JLBFont.h"
  7. #define FADING_SPEED 0.35f
  8. enum _gameSates
  9. {
  10. GAME_STATE_LOGO,
  11. GAME_STATE_SPLASH,
  12. GAME_STATE_HELP,
  13. GAME_STATE_LOADING,
  14. GAME_STATE_PLAY,
  15.     GAME_STATE_END,
  16. };
  17. class GameApp;
  18. class GameState
  19. {
  20. protected:
  21. GameApp* mApp;
  22. JGE* mEngine;
  23.     JLBFont* mPrint;
  24. public:
  25. GameState(GameApp* app) : mApp(app)
  26. {
  27. mEngine = mApp->GetJGE();
  28. mPrint=new JLBFont("f3",16,true);
  29. }
  30. virtual ~GameState() {}
  31. virtual void Create() {}
  32. virtual void Destroy() {}
  33. virtual void Start() {}
  34. virtual void End() {}
  35. virtual void setI(int j) {};
  36. virtual void Update() = 0;
  37. virtual void Render() = 0;
  38. JGE* GetJGE() { return mEngine; }
  39. };
  40. #endif