Rex Raj / Mbed 2 deprecated el17rrrs

Dependencies:   mbed Gamepad N5110 mbed-rtos

Instruction/Instruction.cpp

Committer:
RexRoshan
Date:
2019-05-08
Revision:
6:1fcfd331c047
Parent:
5:016a7315b75d
Child:
7:574c66ebd8b0

File content as of revision 6:1fcfd331c047:

#include "Instruction.h"

Instruction::Instruction()
{

}

Instruction::~Instruction()
{

}
// sprite of the instruction page
int instruction1 [47][83] = {
    
{0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0},
{0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0},
{0,0,0,0,0,1,0,0,1,0,1,0,0,0,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,0,0,0,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,0,1,1,1,1,1,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0},
{0,0,0,0,0,1,0,0,1,0,1,1,0,0,1,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,1,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0},
{0,0,0,0,0,1,0,0,1,0,1,0,1,0,1,0,1,1,1,1,1,0,0,0,1,0,0,0,1,1,1,1,1,0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,1,0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,1,0,0,1,0,0,0,0,0,1,0,0,1,0,0,1,1,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,0,0,1,1,0,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,1,1},
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0},

};

// sprite of the game rules top border
int game_top [1][82] = {

{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}

};

// sprite of the game rules side border
int game_side [48][1] = {

{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},

};    

// sprite of the instruction page side border        
int instruction_side [37][1] = {
    
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},
{1},

};    

// sprite of rule one
int rule_one [13] [75] = {
    
{0,0,1,0,0,0,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,0,0,1,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,1,0,0,1,1,1,1,1,0,1,1,1,1,1,0,0,0,0,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1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1},
{1,1,1,1,1,0,1,0,0,0,1,0,1,0,0,0,0,0,1,0,1,0,0,0,1,1,1,1,1,0,0,1,1,1,1,1,0,0,0,1,0,0,0,1,1,1,1,1,0,1,0,1,1,1,0,0,0,1,1,1,1,1,0,1,1,1,1,1},
{0,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,0,0,1,1,1,1,0,0,1,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,1,1,0,0,0,0,0,0,0,0,1,0,1,0,0},
{1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,0,0,0,1,0,1,0,0,1,0,0,0,1,1,1,1,1,0,0,0,1,0,0,0,1,0,0,1,0,0,1,0,1,0,0,1,1,0,1,1,1,1,1,0,1,0,0,1,0},

};

enum States { Life0,Life1,Life2,Life3,Life4,Life5,Life6,Life7,Life8,Life9,Life10,Life11,Life12 }; // enum state for instruction and game page

void Instruction::rules(N5110 &lcd,Gamepad &pad){     

int fps = 5; // set the frames per second to 5
States currentInstruction = Life0; // current instruction is Life 1
        
     while(currentInstruction != Life12) { 
        switch(currentInstruction){
              case Life0:
              lcd.clear();
              lcd.drawSprite(12,3,27,62,(int*)move);
              lcd.drawSprite(20,33,14,43,(int*)press_start);
              lcd.refresh();
               if(pad.check_event(Gamepad::A_PRESSED) ==  true){ 
                currentInstruction = Life1;    // sets current instruction = Life1 if start button is pressed
                }  
              break;
              case Life1:
                // draws the first instrcution 
                lcd.clear();
                lcd.drawSprite(1,0,47,83 ,(int *)instruction1);
                lcd.drawSprite(11,11,26,63 ,(int *)objective);
                 lcd.drawSprite(73,18,5,3 ,(int *)right_arrow);
                //lcd.drawSprite(6,4,37,1,(int *)instruction_side);
                lcd.refresh();
                if(pad.get_direction() ==  E){ 
                currentInstruction = Life2;    // sets current instruction = Life2 if joystick moves to the right
                }  
                wait(1.0f/fps);
              break;
              case  Life2:
                lcd.clear();
                // draws the second instrcution
                lcd.drawSprite(1,0,47,83 ,(int *)instruction1);
                lcd.drawSprite(12,11,27,60 ,(int *)three_mission);
                lcd.drawSprite(73,18,5,3 ,(int *)right_arrow);
                lcd.drawSprite(8,18,5,3 ,(int *)left_arrow);
               // lcd.drawSprite(6,4,37,1,(int *)instruction_side);
                lcd.refresh();
                 if(pad.get_direction() ==  W){ 
                currentInstruction = Life1;    // sets current instruction = Life1 if joystick moves to the left
                }
                if(pad.get_direction() ==  E){ 
                currentInstruction = Life3;    // sets current instruction = Life3 if joystick moves to the right
                } 
                wait(1.0f/fps); 
              break;
              case  Life3:
                // draws the third instrcution
                lcd.clear();
                lcd.drawSprite(1,0,47,83 ,(int *)instruction1);
                lcd.drawSprite(16,11,26,53 ,(int *)difficulty);
                lcd.drawSprite(73,18,5,3 ,(int *)right_arrow);
                lcd.drawSprite(8,18,5,3 ,(int *)left_arrow);
                lcd.drawSprite(6,4,37,1,(int *)instruction_side);
                lcd.refresh(); 
                if(pad.get_direction() ==  W){ 
                currentInstruction = Life2;    // sets current instruction = Life2 if joystick moves to the left
                }
                if(pad.get_direction() ==  E){ 
                currentInstruction = Life4;    // sets current instruction = Life4 if joystick moves to the right
                }  
                wait(1.0f/fps);
              break;
              case  Life4:
                // draws the fourth instrcution
                lcd.clear();
                lcd.drawSprite(1,0,47,83 ,(int *)instruction1);
                lcd.drawSprite(8,11,26,68 ,(int *)sstriker);
                 lcd.drawSprite(73,18,5,3 ,(int *)right_arrow);
                lcd.drawSprite(8,18,5,3 ,(int *)left_arrow);
                lcd.drawSprite(6,4,37,1,(int *)instruction_side);
                lcd.refresh(); 
                 if(pad.get_direction() ==  W){ 
                currentInstruction = Life3;    // sets current instruction = Life3 if joystick moves to the left
                }
                if(pad.get_direction() ==  E){ 
                currentInstruction = Life5;    // sets current instruction = Life5 if joystick moves to the right
                }  
                wait(1.0f/fps);
              break;
              case Life5:
                // draws the first and second game rules
                lcd.clear();
                lcd.drawSprite(6,5,8,74 ,(int *)game_rules);
                lcd.drawSprite(2,2,1,82 ,(int *)game_top);
                lcd.drawSprite(3,1,48,1 ,(int *)game_side);
                lcd.drawSprite(2,46,1,82 ,(int *)game_top);
                lcd.drawSprite(82,1,48,1 ,(int *)game_side);
                lcd.drawSprite(6,16,13,75 ,(int *)rule_one);
                lcd.drawSprite(7,32,13,69 ,(int *)rule_two);
                lcd.refresh(); 
                 if(pad.get_direction() ==  W){ 
                currentInstruction = Life4;    // sets current instruction = Life4if joystick moves to the left
                }
                if(pad.get_direction() ==  E){ 
                currentInstruction = Life6;    // sets current instruction = Life6if joystick moves to the right
                }  
                wait(1.0f/fps);
              break;   
              case Life6:
                // draws the third game rule
                lcd.clear();
                lcd.drawSprite(6,5,8,74 ,(int *)game_rules);
                lcd.drawSprite(2,2,1,82 ,(int *)game_top);
                lcd.drawSprite(3,1,48,1 ,(int *)game_side);
                lcd.drawSprite(5,15,31,76 ,(int *)rule_three);
                lcd.drawSprite(82,1,48,1 ,(int *)game_side);
                lcd.drawSprite(2,46,1,82 ,(int *)game_top);
                lcd.refresh(); 
                if(pad.get_direction() ==  W){ 
                currentInstruction = Life5;    // sets current instruction = Life5 if joystick moves to the left
                }
                if(pad.get_direction() ==  E){ 
                currentInstruction = Life7;    // sets current instruction = Life7 if joystick moves to the right
                }  
                wait(1.0f/fps);
              break;
             case Life7:
                // draws the fourth game rule
                lcd.clear();
                lcd.drawSprite(6,5,8,74 ,(int *)game_rules);
                lcd.drawSprite(2,2,1,82 ,(int *)game_top);
                lcd.drawSprite(3,1,48,1 ,(int *)game_side);
                lcd.drawSprite(5,15,31,76 ,(int *)rule_four);
                lcd.drawSprite(2,46,1,82 ,(int *)game_top);
                lcd.drawSprite(82,1,48,1 ,(int *)game_side);
                lcd.refresh();
                if(pad.get_direction() ==  W){ 
                currentInstruction = Life6;    // sets current instruction = Life6 if joystick moves to the left
                }
                if(pad.get_direction() ==  E){ 
                currentInstruction = Life8;    // sets current instruction = Life8 if joystick moves to the right
                } 
                wait(1.0f/fps);
              break;
              case Life8:
                // draws the fifth game rule
                lcd.clear();
                lcd.drawSprite(6,5,8,74 ,(int *)game_rules);
                lcd.drawSprite(2,2,1,82 ,(int *)game_top);
                lcd.drawSprite(3,1,48,1 ,(int *)game_side);
                lcd.drawSprite(5,15,31,76 ,(int *)rule_five);
                lcd.drawSprite(2,46,1,82 ,(int *)game_top);
                lcd.drawSprite(82,1,48,1 ,(int *)game_side);
                lcd.refresh();
                if(pad.get_direction() ==  W){ 
                currentInstruction = Life7;    // sets current instruction = Life7 if joystick moves to the left
                }
                if(pad.get_direction() ==  E){ 
                currentInstruction = Life9;    // sets current instruction = Life9 if joystick moves to the right
                } 
                wait(1.0f/fps);
              break;
              case Life9:
                // draws the page one of the sixth game rule
                lcd.clear();
                lcd.drawSprite(6,5,8,74 ,(int *)game_rules);
                lcd.drawSprite(2,2,1,82 ,(int *)game_top);
                lcd.drawSprite(3,1,48,1 ,(int *)game_side);
                lcd.drawSprite(5,15,31,76 ,(int *)rule_six);
                lcd.drawSprite(2,46,1,82 ,(int *)game_top);
                lcd.drawSprite(82,1,48,1 ,(int *)game_side);
                lcd.refresh(); 
                if(pad.get_direction() ==  W){ 
                currentInstruction = Life8;    // sets current instruction = Life8 if joystick moves to the left
                }
                if(pad.get_direction() ==  E){ 
                currentInstruction = Life10;   // sets current instruction = Life10 if joystick moves to the right
                } 
                wait(1.0f/fps);
              break;
              case Life10:
              // draws the page two of the sixth game rule
                lcd.clear();
                lcd.drawSprite(6,5,8,74 ,(int *)game_rules);
                lcd.drawSprite(2,2,1,82 ,(int *)game_top);
                lcd.drawSprite(3,1,48,1 ,(int *)game_side);
                lcd.drawSprite(5,15,13,76 ,(int *)rule_six_two);
                lcd.drawSprite(2,46,1,82 ,(int *)game_top);
                lcd.drawSprite(82,1,48,1 ,(int *)game_side);
                lcd.refresh();
                if(pad.get_direction() ==  W){ 
                currentInstruction = Life9;    // sets current instruction = Life9 if joystick moves to the left
                }
                if(pad.get_direction() ==  E){ 
                currentInstruction = Life11;   // sets current instruction = Life11 if joystick moves to the right
                } 
                wait(1.0f/fps);
              break;
              case Life11:
                while(pad.check_event(Gamepad::A_PRESSED) == false){
                    // draws the goodluck page & makes the hat flash
                    lcd.clear();
                    lcd.drawSprite(6,5,8,74 ,(int *)game_rules);
                    lcd.drawSprite(2,2,1,82 ,(int *)game_top);
                    lcd.drawSprite(3,1,48,1 ,(int *)game_side);
                    lcd.drawSprite(2,46,1,82 ,(int *)game_top);
                    lcd.drawSprite(82,1,48,1 ,(int *)game_side);
                    lcd.drawSprite(4,15,14,76 ,(int *)goodluck);
                    lcd.drawSprite(14,31,14,43 ,(int *)press_start);
                    lcd.drawSprite(59,31,14,22 ,(int *)hat);
                    lcd.refresh();
                    wait(0.5);
                    lcd.clear();
                    lcd.drawSprite(6,5,8,74 ,(int *)game_rules);
                    lcd.drawSprite(2,2,1,82 ,(int *)game_top);
                    lcd.drawSprite(3,1,48,1 ,(int *)game_side);
                    lcd.drawSprite(2,46,1,82 ,(int *)game_top);
                    lcd.drawSprite(82,1,48,1 ,(int *)game_side);
                    lcd.drawSprite(4,15,14,76 ,(int *)goodluck);
                    lcd.drawSprite(14,31,14,43 ,(int *)press_start);
                    lcd.refresh();
                    wait(0.5);
                    if(pad.get_direction() ==  W){ 
                    currentInstruction = Life10;   // sets current instruction = Life10 if joystick moves to the left
                    break;
                    }
                    if(pad.check_event(Gamepad::A_PRESSED) == true){ 
                    currentInstruction = Life12;   // sets current instruction = Life12 if joystick moves to the right
                    break;
                    }
                    wait(1.0f/fps);
                } 
              break;
              case Life12:
              break;
              
        }
    }   
}