GameStateHelp.hpp
上传用户:zhj2929
上传日期:2022-07-23
资源大小:28772k
文件大小:1k
- #ifndef _GAME_STATES_HELP_H_
- #define _GAME_STATES_HELP_H_
- #include "GameState.h"
- class GameStateHelp:public GameState
- {
- private:
- JTexture* bgTexture;//背景图片
- JQuad* mBg;
- public:
- GameStateHelp(GameApp* app): GameState(app)
- {
- bgTexture = NULL;
- mBg = NULL;
- }
- virtual ~GameStateHelp()
- {
- }
- virtual void Create()
- {
- mEngine->LoadMP3("music/helpBg.mp3");
- bgTexture = mEngine->LoadTexture("backgroud/noteBook.png", true);
- mBg = new JQuad(bgTexture, 0.0f, 0.0f, GAMESCREEN_WIDTH,GAMESCREEN_HEIGHT);
- }
-
- virtual void Destroy()
- {
- if (bgTexture)
- mEngine->FreeTexture(bgTexture);
- if (mBg) delete mBg;
- }
-
- virtual void Start()
- {
- mEngine->PlayMP3();
- }
- virtual void End()
- {
- mEngine->EnableVSync(false);
- mEngine->StopMP3();
- mEngine->FreeMP3();
- }
- virtual void Update()
- {
- if (mEngine->GetButtonClick(PSP_CTRL_START))
- {
-
- mApp->LoadGameStateSplash();
- mApp->SetNextState(GAME_STATE_SPLASH);
- return;
- }
- }
- virtual void Render()
- {
- mEngine->ClearScreen(ARGB(255,255,255,255));
-
- //背景的渲染
- mEngine->RenderQuad(mBg, 0.0f, 0.0f);
- }
- };
- #endif