GameStatePlay.hpp
上传用户:zhj2929
上传日期:2022-07-23
资源大小:28772k
文件大小:18k
- #include <stdio.h>
- #include "GameState.h"
- #include "../../JGE/HGE/include/hgefont.h"
- #define SAFE_DELETE(x) if (x) delete x
- #define VIRTUAL_WIDTH 3968.0f
- #define VIRTUAL_HEIGHT 480.0f
- #define BIGM_INITIAL_JUMP_VEL -0.57f
- #define DEFAULT_GRAVITY 0.001f
- #define DEFAULT_WALK_SPEED 0.15f
- #define MAX_TILES 10
- #define TILE_HILL1 0
- #define TILE_HILL2 1
- #define TILE_HILL3 2
- #define TILE_TUBE 3
- #define TILE_BRICK 4
- #define TILE_BLOCK1 5
- #define TILE_BLOCK2 6
- #define TILE_CASTLE 7
- #define BLOCK_SOLID 1 //不可碰撞的砖块
- #define BLOCK_QUES 2 //可碰撞的砖块
- #define BLOCK_BANANA 3 //香蕉
- #define BLOCK_APPLE 4 //苹果
- #define BLOCK_WEASEL 5 //黄鼠狼
- #define BLOCK_TUNNEL 6 //管道
- #define BLOCK_TURTLE 7 //刺猬
- #define BLOCK_SNOWMAN 8 //雪人
- #define BLOCK_MONSTER 9 //mushroom
- #define CHANGE_SEASON 10 //换季
- #define MAX_SFX 12
- #define SFX_JUMP1 0
- #define SFX_JUMP2 1
- #define SFX_COIN 2
- #define SFX_GOOD 3
- #define SFX_BAD 4
- #define SFX_HITWALL 5
- #define SFX_BREAKER 6
- #define SFX_DEAD 7
- #define SFX_CRUSHED 8
- #define SFX_PAUSE 9
- #define SFX_FIRE 10
- #define SFX_WANG 11
- #define MAX_STATIC_COIN 20
- #define MAX_BAD_FLOWER 10
- #define QUES_NUMBER 40
- class TileMap;
- class Scroller;
- class GameObject;
- class JumpingBlock;
- class JumpingCoin;
- class Mario;
- class Turtle;
- class Weasel;
- class Snowman;
- class Monster;
- class Question;
- class BadFlower;
- class GameApp;
- float mario_x;
- float mario_y;
- float mapPositionX;
- float mapPositionY;
- class GameStatePlay:public GameState
- {
- private:
- Scroller* scrollerMount;
- Scroller* scrollerCloud;
- JMusic* mMusic;
- JSample* mSfx[MAX_SFX];
- TileMap* mTileMap;
- JTexture* mTexture;
- JTexture* mQuestion;
- JTexture* VIC;
- JTexture* FAI;
-
- JQuad* good;
- JQuad* bad;
- JQuad* bananaPIC;
- JQuad* applePIC;
- JQuad* bookPIC;
- JTexture* mBgTex;
- JQuad* mCloud;
- JQuad* mMountains;
- JQuad* mTiles[MAX_TILES];
- JTexture* mTileTex;
- JTexture* bookTex;
- JTexture* mRainbowTex;
- JQuad* mRainbow;
- JumpingBlock* mBlock;
- JumpingCoin* mBanana;
- Mario *mMario;
- Turtle* mTurtle[5];
- int mTurtleCount;
- //----------------黄鼠狼-----------------
- Weasel* mWeasel[5];
- int mWeaselCount;
- //-------snowman------------------------
- Snowman* mSnowman[2];
- int mSnowmanCount;
-
- Monster* mMonster;
- Question* question;
- //BadFlower* mBadFlowers[MAX_BAD_FLOWER];
- //int mBadFlowersCount;
- int victory;
- int temp ;
- bool answered[QUES_NUMBER];
- public:
- int apple;
- int banana;
-
- float experience0;
- int questionNO;
- int Season;
- int Season1;
- GameStatePlay(GameApp* app);
- virtual ~GameStatePlay();
- virtual void Create();
- virtual void Destroy();
- virtual void Update();
- virtual void Render();
- virtual void Start();
- virtual void End();
- void quesCalculate(int victory);
- JTexture* GetTexture(int id);
- TileMap* GetTileMap() { return mTileMap; }
- int GetApple(){return apple;}
- int GetBanana(){return banana;}
- void SetBanana(int i);
- void SetApple(int i);
- JumpingBlock* GetJumpingBlock() { return mBlock; }
- JumpingCoin* GetJumpingCoin() { return mBanana; }
- Weasel* GetWeasel(int i) { return mWeasel
- [i]; }
- Snowman* GetSnowman(int i)
- {
- return mSnowman[i];
- }
-
- Turtle* GetTurtle(int i)
- {
- return mTurtle[i];
- }
- Monster* GetMonster()
- {
- return mMonster;
- }
- Mario* GetMario()
- {
- return mMario;
- }
- void SpawnTurtle(int col, int row);
- void SpawnWeasel(int col, int row);
- void SpawnSnowman(int col, int row);
-
- void SpawnMonster(int col, int row);
- //void SpawnBadFlower(int col, int row);
- void PlaySfx(int idx);
- };
- #include "TileMap.hpp"
- #include "Scroller.hpp"
- #include "GameObject.hpp"
- #include "JumpingCoin.hpp"
- #include "Question.hpp"
- #include "JumpingBlock.hpp"
- #include "Mario.hpp"
- #include "Turtle.hpp"
- #include "Weasel.hpp"
- #include "Snowman.hpp"
- #include "monster.hpp"
- #include "BadFlower.hpp"
- GameStatePlay::GameStatePlay(GameApp* app): GameState(app)
- {
- Season=0;
- mTexture = NULL;
- mMario = NULL;
- mQuestion = NULL;
- questionNO=-1;
- VIC = NULL;
- good = NULL ;
- bananaPIC = NULL ;
- applePIC = NULL ;
- bookPIC = NULL;
- apple = 0;
- banana =0;
- victory = 0;
- temp = 500;
- experience0=0;
- mBgTex = NULL;
- mMountains = NULL;
- mCloud = NULL;
- mMusic = NULL;
- int i;
-
- for (i=0;i<MAX_TILES;i++)
- mTiles[i] = NULL;
- mBlock = NULL;
-
- question = NULL;
-
- scrollerCloud = NULL;
- scrollerMount = NULL;
- mTileTex = NULL;
- bookTex =NULL;
- mTileMap = NULL;
- mRainbowTex = NULL;
- mRainbow = NULL;
- mBlock = NULL;
- mBanana = NULL;
-
- //for (i=0;i<10;i++)
- // mTurtle[i] = NULL;
- //for (i=0;i<MAX_BAD_FLOWER;i++)
- // mBadFlowers[i] = NULL;
- for (i=0;i<MAX_SFX;i++)
- mSfx[i] =NULL;
- for (i=0;i<10;i++)
- answered[i] = false ;
- }
- GameStatePlay::~GameStatePlay()
- {
- }
- void GameStatePlay::Create()
- {
-
- bookTex = mEngine->LoadTexture("book/book.png", true);
- int i;
- if(Season==0)
- {
- mBgTex = mEngine->LoadTexture("Res/bg1.png", true);
- mTileTex = mEngine->LoadTexture("Res/tiles.png", true);
- mTexture = mEngine->LoadTexture("Res/mario.png", true); // load texture and put onto VRAM if possible
- mQuestion = mEngine->LoadTexture("Res/question.png", true);
- VIC = mEngine->LoadTexture("Res/good.png", true);
- FAI = mEngine->LoadTexture("Res/bad.png", true);
- mRainbowTex = mEngine->LoadTexture("Res/chun.png", true);
- }
- if(Season==1)
- {
- mBgTex = mEngine->LoadTexture("Res/bg1.png", true);
- mTileTex = mEngine->LoadTexture("Res/tiles1.png", true);
- mTexture = mEngine->LoadTexture("Res/mario.png", true); // load texture and put onto VRAM if possible
- mQuestion = mEngine->LoadTexture("Res/question.png", true);
- VIC = mEngine->LoadTexture("Res/good.png", true);
- FAI = mEngine->LoadTexture("Res/bad.png", true);
- mRainbowTex = mEngine->LoadTexture("Res/xia.png", true);
- }
- if(Season==2)
- {
- mBgTex = mEngine->LoadTexture("Res/bg1.png", true);
- mTileTex = mEngine->LoadTexture("Res/tiles2.png", true);
- mTexture = mEngine->LoadTexture("Res/mario.png", true); // load texture and put onto VRAM if possible
- mQuestion = mEngine->LoadTexture("Res/question.png", true);
- VIC = mEngine->LoadTexture("Res/good.png", true);
- FAI = mEngine->LoadTexture("Res/bad.png", true);
- mRainbowTex = mEngine->LoadTexture("Res/qiu.png", true);
- }
- if(Season==3)
- {
- mBgTex = mEngine->LoadTexture("Res/bg1.png", true);
- mTileTex = mEngine->LoadTexture("Res/tiles3.png", true);
- mTexture = mEngine->LoadTexture("Res/mario.png", true); // load texture and put onto VRAM if possible
- mQuestion = mEngine->LoadTexture("Res/question.png", true);
- VIC = mEngine->LoadTexture("Res/good.png", true);
- FAI = mEngine->LoadTexture("Res/bad.png", true);
- mRainbowTex = mEngine->LoadTexture("Res/dong.png", true);
- }
-
- if(Season==4)
- {
- mBgTex = mEngine->LoadTexture("Res/bg1.png", true);
- mTileTex = mEngine->LoadTexture("Res/tiles4.png", true);
- mTexture = mEngine->LoadTexture("Res/mario.png", true); // load texture and put onto VRAM if possible
- FAI = mEngine->LoadTexture("Res/bad.png", true);
- mQuestion = mEngine->LoadTexture("Res/question.png", true);
- VIC = mEngine->LoadTexture("Res/good.png", true);
- mRainbowTex = mEngine->LoadTexture("Res/bg.png", true);
- }
- mMountains = new JQuad(mBgTex, 0.0f, 0.0f, 512.0f, 142.0f);
- mCloud = new JQuad(mBgTex, 0.0f, 352.0f, 512.0f, 159.0f);
- mTiles[TILE_HILL1] = new JQuad(mBgTex, 0.0f, 143.0f, 200.0f, 133.0f);
- mTiles[TILE_HILL2] = new JQuad(mBgTex, 202.0f, 143.0f, 200.0f, 85.0f);
- mTiles[TILE_HILL3] = new JQuad(mBgTex, 410.0f, 143.0f, 98.0f, 161.0f);
- mTiles[TILE_BRICK] = new JQuad(mBgTex, 48.0f, 278.0f, 64.0f, 64.0f);
- mTiles[TILE_BLOCK1] = new JQuad(mBgTex, 118.0f, 278.0f, 32.0f, 32.0f);
- mTiles[TILE_BLOCK2] = new JQuad(mBgTex, 160.0f, 278.0f, 32.0f, 32.0f);
- mTiles[TILE_CASTLE] = new JQuad(mBgTex, 202.0f, 232.0f, 160.0f, 116.0f);
- mTiles[TILE_TUBE] = new JQuad(mBgTex, 366.0f, 232.0f, 43.0f, 84.0f);
-
- mTileMap = new TileMap(this, mTileTex);
- mRainbow = new JQuad(mRainbowTex, 0.0f, 0.0f, 512.0f, 512.0f);
- mMario = new Mario(this);
- mMario->experience=experience0;
- if(Season==1)
- {
- mMario->SetX(0);
- mMario->SetY(VIRTUAL_HEIGHT - 96.0f - 1.0f);
- }
- if(Season==2)
- {
- mMario->SetX(0);
- mMario->SetY(VIRTUAL_HEIGHT - 64.0f - 1.0f);
- }
- if(Season==3)
- {
- mMario->SetX(0);
- mMario->SetY(VIRTUAL_HEIGHT - 416.0f - 1.0f);
- }
- if(Season==4)
- {
- mMario->SetX(0);
- mMario->SetY(VIRTUAL_HEIGHT -60.0f - 1.0f);
- }
-
- scrollerCloud = new Scroller(mCloud);
- scrollerMount = new Scroller(mMountains);
-
- mMusic = mEngine->LoadMusic("Res/smarioa.mod");
- char *sfx[] =
- {
- "Res/Sfx/jump1.wav",
- "Res/Sfx/jump2.wav",
- "Res/Sfx/coin.wav",
- "Res/Sfx/good.wav",
- "Res/Sfx/bad.wav",
- "Res/Sfx/brockbreak.wav",
- "Res/Sfx/breaker.wav",
- "Res/Sfx/dead.wav",
- "Res/Sfx/crushed.wav",
- "Res/Sfx/pause.wav",
- "Res/Sfx/fire.wav",
- "Res/Sfx/wang.wav"
- };
-
- for (i=0;i<MAX_SFX;i++)
- mSfx[i] = mEngine->LoadSample(sfx[i]);
- if(Season==0)
- mTileMap->Load("Res/map_Dh.dat", "Res/mario_Dh.ent");
- if(Season==1)
- mTileMap->Load("Res/map_Dh1.dat", "Res/mario_Dh1.ent");
- if(Season==2)
- mTileMap->Load("Res/map_Dh2.dat", "Res/mario_Dh2.ent");
- if(Season==3)
- mTileMap->Load("Res/map_Dh3.dat", "Res/mario_Dh3.ent");
- if(Season==4)
- mTileMap->Load("Res/map_Dh4.dat", "Res/mario_Dh4.ent");
- Season1=Season+1;
- mBlock = new JumpingBlock(this);
- good = new JQuad (VIC , 0.0f , 0.0f , 70.0f , 70.0f);
- bad =new JQuad (FAI , 0.0f , 0.0f , 70.0f , 70.0f);
- bananaPIC = new JQuad (mTileTex , 64.0f, 0.0f, 32.0f, 32.0f);
- applePIC = new JQuad (mTileTex , 32.0f, 0.0f, 32.0f, 32.0f);
- bookPIC = new JQuad (bookTex , 32.0f, 0.0f, 32.0f, 32.0f);
- mBanana = new JumpingCoin(this);
- question = new Question(this);
- for (i=0;i<5;i++)
- mTurtle[i] = new Turtle(this);
- //--------------------------
- for (i=0;i<5;i++)
- mWeasel[i] = new Weasel(this);
- for (i=0;i<2;i++)
- mSnowman[i] = new Snowman(this);
-
- mMonster = new Monster(this);
-
- /*for (i=0;i<MAX_BAD_FLOWER;i++)
- mBadFlowers[i] = new BadFlower(this);*/
- }
- void GameStatePlay::Start()
- {
- mTurtleCount = 0;
- mWeaselCount = 0;
- mSnowmanCount = 0;
-
-
- //questionNO = -1 ;
- mEngine->PlayMusic(mMusic);
-
- }
- void GameStatePlay::End()
- {
-
- }
- JTexture* GameStatePlay::GetTexture(int id)
- {
- if(!id)
- return mTexture;
- else
- return mQuestion;
- }
- void GameStatePlay::Destroy()
- {
- int i;
- if (mBgTex)
- mEngine->FreeTexture(mBgTex);
- SAFE_DELETE(mMountains);
- SAFE_DELETE(mCloud);
- if (mTexture)
- mEngine->FreeTexture(mTexture);
-
- if (mQuestion)
- mEngine->FreeTexture(mQuestion);
- for (i=0;i<MAX_TILES;i++)
- SAFE_DELETE(mTiles[i]);
-
- SAFE_DELETE(mMario);
- SAFE_DELETE(scrollerCloud);
- SAFE_DELETE(scrollerMount);
- if (mMusic)
- mEngine->FreeMusic(mMusic);
- if (mTileTex)
- mEngine->FreeTexture(mTileTex);
- if (bookTex)
- mEngine->FreeTexture(bookTex);
- SAFE_DELETE(mTileMap);
- if (mRainbowTex)
- mEngine->FreeTexture(mRainbowTex);
- SAFE_DELETE(mRainbow);
- SAFE_DELETE(mBlock);
- SAFE_DELETE(mBanana);
- SAFE_DELETE(mPrint);
- //for (i=0;i<10;i++)
- // SAFE_DELETE(mTurtle[i]);
- //黄鼠狼的删除有错误!!!!!!!!!
- //for (i=0;i<10;i++)
- //SAFE_DELETE(mWeasel[i]);
- //for (i=0;i<MAX_BAD_FLOWER;i++)
- // SAFE_DELETE(mBadFlowers[i]);
-
- for (i=0;i<MAX_SFX;i++)
- if (mSfx[i])
- mEngine->FreeSample(mSfx[i]);
- }
- void GameStatePlay::Update()
- {
- float dt = mEngine->GetDelta(); // get number of milliseconds passed since last frame
-
- if(mMonster->gameEnd==1)
- {
- mEngine->StopMusic();
- if(mMario->getExperience()>=80)
-
- {
-
- mApp->setI(4);
- mApp->LoadGameStateEnd();
-
- mApp->SetNextState(GAME_STATE_END);
- }
- if(mMario->getExperience()>=30&&mMario->getExperience()<80)
-
- {
- mApp->setI(3);
- mApp->LoadGameStateEnd();
- mApp->SetNextState(GAME_STATE_END);
- }
- if(mMario->getExperience()>=0&&mMario->getExperience()<30)
-
- {
- mApp->setI(2);
- mApp->LoadGameStateEnd();
- mApp->SetNextState(GAME_STATE_END);
- }
- }
- else if(mMonster->gameEnd==2)
- {
- mEngine->StopMusic();
- mApp->setI(1);
- mApp->LoadGameStateEnd();
- mApp->SetNextState(GAME_STATE_END);
- }
- mMario->Update(dt);
- mario_x = mMario->GetX();
- mario_y = mMario->GetY();
- mTileMap->GetPosition(&mapPositionX, &mapPositionY);
- mTileMap->Update(dt);
- if(Season==Season1)
- {
-
- mApp->SetNextState(GAME_STATE_LOADING);
- }
- if (mBlock && mBlock->IsActive())
- {
- mBlock->Update(dt);
- question->Update(dt);
- }
- char answer;
-
-
- if(mEngine->GetButtonClick(PSP_CTRL_LEFT))
- {
- if(mBlock->questioned==true)
- {
- answer = 'A';
- if((question->getAnswer(questionNO))==answer)
- victory = 1 ;
- else
- {
- victory = 2;
- }
-
- quesCalculate(victory);
- }
- }
- else if(mEngine->GetButtonClick(PSP_CTRL_RIGHT))
- {
- if(mBlock->questioned==true)
- {
- answer = 'D';
-
- if((question->getAnswer(questionNO))==answer)
- victory = 1 ;
- else
- {
- victory = 2;
- //if(!answered[questionNO])
- // mMario->AnswerWrong();
- // answered[questionNO]=1;
- }
-
- quesCalculate(victory);
- }
- }
- if (mBanana && mBanana->IsActive())
- {
- mBanana->Update(dt);
- }
-
- int i;
- for (i=0;i<5;i++)
- if (mTurtle[i] && mTurtle[i]->IsActive())
- mTurtle[i]->Update(dt);
- for (i=0;i<5;i++)
- if (mWeasel[i] && mWeasel[i]->IsActive())
- mWeasel[i]->Update(dt);
- for (i=0;i<2;i++)
- if (mSnowman[i] && mSnowman[i]->IsActive())
- mSnowman[i]->Update(dt);
-
- if (mMonster&& mMonster->IsActive())
- mMonster->Update(dt);
- int frame = -1;
- /*for (i=0;i<MAX_BAD_FLOWER;i++)
- if (mBadFlowers[i] && mBadFlowers[i]->IsActive())
- mBadFlowers[i]->Update(dt);*/
-
- }
- void GameStatePlay::Render()
- {
-
- PIXEL_TYPE colors[] =
- {
- ARGB(255,62,114,189),
- ARGB(255,62,114,189),
- ARGB(255,255,255,255),
- ARGB(255,255,255,255)
- };
-
- float mapX, mapY;
-
- mTileMap->GetPosition(&mapX, &mapY);
-
- mEngine->FillRect(0, 0.0f-mapY, SCREEN_WIDTH_F, VIRTUAL_HEIGHT, colors); // clear background to black
- float x = (mapX+200.0f)*0.02f;
- int n = (int) x;
- n = (n / 512);
- x -= (n*512);
- float y = 0.0f-mapY;
- x = mapX*0.10f;
- n = (int) x;
- n = (n / 512);
- x -= (n*512);
- y = VIRTUAL_HEIGHT-480.0f-mapY;
- mEngine->RenderQuad(mRainbow,0, y);
-
- x = mapX*0.20f;
- n = (int) x;
- n = (n / 512);
- x -= (n*512);
- float yofs = 50.0f*(208.0f-mapY)/208.0f;
- y = VIRTUAL_HEIGHT-142.0f-mapY;
-
- x = mapX*0.50f;
- n = (int) x;
- n = (n / 960);
- x -= (n*960);
- x = SCREEN_WIDTH_F - x;
- y = VIRTUAL_HEIGHT-84.0f-mapY;
- y = VIRTUAL_HEIGHT-160.0f-mapY;
- y = VIRTUAL_HEIGHT-132.0f-mapY;
- mMario->Render();
-
- if (mBlock && mBlock->IsActive())
- {
-
-
- mBlock->Render();
- }
- question->setCurrent(questionNO);
- if(victory==0&&mBlock->questioned)
- {
- question->Render();
- temp=0;
- }
- else if(victory==1&&temp<=200)
- {
- mBlock ->questioned=false;
- mEngine->RenderQuad(good, 20.0f, 50.0f);
- temp++;
- }
- else if(victory==2&&temp<=200)
- {
- mBlock ->questioned=false;
- //mBlock->SelectBlock(1);
- mEngine->RenderQuad(bad, 20.0f, 50.0f);
- temp++;
- }
- if(temp>200)
- {
- victory = 0;
- }
- mEngine->RenderQuad(bananaPIC, 210.0f, 10.0f);
- mEngine->RenderQuad(applePIC, 360.0f, 10.0f);
- mEngine->RenderQuad(bookPIC, 70.0f, 10.0f);
- if (mBanana && mBanana->IsActive())
- mBanana->Render();
-
- int i;
- for (i=0;i<5;i++)
- if (mTurtle[i] && mTurtle[i]->IsActive())
- mTurtle[i]->Render();
- //--------------------------------
- for (i=0;i<5;i++)
- if (mWeasel[i] && mWeasel[i]->IsActive())
- mWeasel[i]->Render();
- for (i=0;i<2;i++)
- if (mSnowman[i] && mSnowman[i]->IsActive())
- mSnowman[i]->Render();
-
- if (mMonster&& mMonster->IsActive())
- mMonster->Render();
- //for (i=0;i<MAX_BAD_FLOWER;i++)
- // if (mBadFlowers[i] && mBadFlowers[i]->IsActive())
- // mBadFlowers[i]->Render();
- mTileMap->Render(0,0);
- mPrint->SetColor(ARGB(255,90,240,120));
- float experience = (float)mMario->getExperience();
- if(experience<0||mMario->GetY()>=470)
- {
-
- mEngine->StopMusic();
- mApp->setI(1);
- mApp->LoadGameStateEnd();
- mApp->SetNextState(GAME_STATE_END);
- //mEngine->End();
- return;
- }
- mPrint->printf(110.0f,17.0f,"* %.1f", experience);
-
- mPrint->printf(250.0f,17.0f,"* %d", banana);
- mPrint->printf(400.0f,17.0f,"* %d", apple);
- }
- //void GameStatePlay::SpawnBadFlower(int col, int row)
- //{
- // /*
- // mBadFlowers[mBadFlowersCount++]->Spawn(col, row);
- // if (mBadFlowersCount >= MAX_BAD_FLOWER)
- // mBadFlowersCount = 0;
- // */
- //}
- void GameStatePlay::SpawnTurtle(int col, int row) //乌龟
- {
- {
- mTurtle[mTurtleCount++]->Spawn(col, row);
- }
- }
- //----------------------YB---黄鼠狼----------------------
- void GameStatePlay::SpawnWeasel(int col, int row) //黄鼠狼
- {
- {
- mWeasel[mWeaselCount++]->Spawn(col, row);
- }
- }
- void GameStatePlay::SpawnSnowman(int col, int row) //
- {
- {
- mSnowman[mSnowmanCount++]->Spawn(col, row);
- }
- }
- void GameStatePlay::SpawnMonster(int col, int row) //黄鼠狼
- {
- {
- mMonster->Spawn(col, row);
- }
- }
- void GameStatePlay::PlaySfx(int idx)
- {
- if (mSfx[idx])
- mEngine->PlaySample(mSfx[idx]);
- }
- void GameStatePlay::quesCalculate(int victory)
- {
- if(!answered[questionNO])
- {
- if(victory==1)
- {
- mMario->AnswerRight();
- PlaySfx(SFX_GOOD);
- answered[questionNO]=1;
- }
- else if(victory==2)
- {
- mMario->AnswerWrong();
- PlaySfx(SFX_BAD);
- answered[questionNO]=1;
- }
- }
- else
- return ;
- }
- void GameStatePlay::SetBanana(int i)
- {
- banana = i;
- }
- void GameStatePlay::SetApple(int i)
- {
- apple = i;
- }