- #ifndef _STATIC_COIN_HPP_
- #define _STATIC_COIN_HPP_
- #define QUES_NUMBER 40
- class Question: public GameObject
- {
- private:
- JQuad* question[QUES_NUMBER];
- int counter;
- int current;
- char answer[QUES_NUMBER];
- bool flag;
- public:
- Question(GameStatePlay* app);
- virtual ~Question();
- virtual void Update(float dt);
- virtual void Render();
- void setCurrent(int a);
- char getAnswer(int i);
- };
- char Question::getAnswer(int i)
- {
- return answer[i];
- }
- Question::Question(GameStatePlay* app): GameObject(app)
- {
- for(int i = 0 ; i < QUES_NUMBER ; i++)
- {
- question[i] = new JQuad(mQuestion, i*160.0f, 0.0f, 160.0f, 100.0f);
- }
- flag = 0 ;
- for( int i = 0 ; i < QUES_NUMBER ; i++ )
- {
- if(i==0)
- answer[i] = 'D';
- else if(i==1)
- answer[i] = 'A';
- else if(i==2)
- answer[i] = 'D';
- else if(i==3)
- answer[i] = 'A';
- else if(i==4)
- answer[i] = 'A';
- else if(i==5)
- answer[i] = 'D';
- else if(i==6)
- answer[i] = 'D';
- else if(i==7)
- answer[i] = 'D';
- else if(i==8)
- answer[i] = 'A';
- else if(i==9)
- answer[i] = 'D';
- else if(i==10)
- answer[i] = 'D';
- else if(i==11)
- answer[i] = 'D';
- else if(i==12)
- answer[i] = 'D';
- else if(i==13)
- answer[i] = 'A';
- else if(i==14)
- answer[i] = 'A';
- else if(i==15)
- answer[i] = 'D';
- else if(i==16)
- answer[i] = 'D';
- else if(i==17)
- answer[i] = 'D';
- else if(i==18)
- answer[i] = 'D';
- else if(i==19)
- answer[i] = 'D';
- else if(i==20)
- answer[i] = 'D';
- else if(i==21)
- answer[i] = 'D';
- else if(i==22)
- answer[i] = 'A';
- else if(i==23)
- answer[i] = 'A';
- else if(i==24)
- answer[i] = 'D';
- else if(i==25)
- answer[i] = 'A';
- else if(i==26)
- answer[i] = 'D';
- else if(i==27)
- answer[i] = 'D';
- else if(i==28)
- answer[i] = 'D';
- else if(i==29)
- answer[i] = 'D';
- else if(i==30)
- answer[i] = 'A';
- else if(i==31)
- answer[i] = 'D';
- else if(i==32)
- answer[i] = 'D';
- else if(i==33)
- answer[i] = 'A';
- else if(i==34)
- answer[i] = 'D';
- else if(i==35)
- answer[i] = 'D';
- else if(i==36)
- answer[i] = 'D';
- else if(i==37)
- answer[i] = 'A';
- else if(i==38)
- answer[i] = 'D';
- else if(i==39)
- answer[i] = 'D';
- }
- }
- Question::~Question()
- {
- for(int i = 0 ; i<QUES_NUMBER ; i++)
- delete question[i];
- }
- void Question::Update(float dt)
- {
- if(counter < 30 )
- {
- counter++;
- flag = true;
- }
- else
- {
- counter=0;
- flag = 0 ;
- }
- }
- void Question::Render()
- {
- float x, y;
- mMap->GetPosition(&x, &y);
- if(flag)
- mEngine->RenderQuad(question[current], 20 ,40);
- }
- void Question::setCurrent(int a )
- {
- current = a ;
- }
- #endif