RUOFAN LI / Mbed 2 deprecated el17rl

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers homepage.h Source File

homepage.h

00001 #ifndef Homepage_H
00002 #define Homepage_H
00003 
00004 #include "mbed.h"
00005 #include "N5110.h"
00006 #include "Joystick.h"
00007 #include "Bitmap.h"
00008 #include "bgm.h"
00009 /** Homepage Class
00010 @brief Library for different pages in the screen of mbed, University of Leeds
00011 @author Li Ruofan
00012 @date May 2020
00013 */
00014 class Homepage{
00015 
00016 public:
00017     /** Constructor */
00018     Homepage();
00019     /** Destructor */
00020     ~Homepage();
00021     /** The welcome functions including lcd,leds and sound 
00022      * @param lcd (N5110)
00023      * @param stream of output bits to control leds (Busout)
00024      * @param the welcome song (Sound)
00025      */
00026     void welcome(N5110 &lcd,BusOut &output,Bgm &bgm);
00027     
00028     /** The over functions including lcd and leds
00029      * @param lcd (N5110)
00030      * @param a stream of output bits to control leds (Busout)
00031      */   
00032     void over(N5110 &lcd,BusOut &output);
00033     
00034     /** The over functions including lcd and leds
00035      * @param lcd (N5110)
00036      * @param the button A (InterruptIn)
00037      * @param the button B (InterruptIn)
00038      * @param the start button (InterruptIn)
00039      */  
00040     void homepage(N5110 &lcd,InterruptIn &buttonA,InterruptIn &buttonB, InterruptIn &start, int *score,int n);
00041     
00042     /** The rangking lists
00043      * @param lcd (N5110)
00044      * @param the vector of scores in the history (int)
00045      * @param the size of score vector (int)
00046      */    
00047    
00048     void displayCurScore(N5110 &lcd,int score);
00049     
00050     /** Draw images including a plane, a bullet and an enemy in the welcome page
00051      * @param lcd (N5110)
00052      * @param the value of score (int)
00053      */    
00054     void drawEverything(N5110 &lcd);
00055     
00056     
00057     /** Display rules of the game 
00058      * @param lcd (N5110)
00059      * @param the button B (InterruptIn)
00060      */ 
00061     void rules(N5110 &lcd,InterruptIn &buttonA,InterruptIn &buttonB);
00062     
00063     
00064     /**Play again the game when score > 10
00065      * Back when score <=10
00066      * @param lcd (N5110)
00067      * @param total score in one game (int)
00068      * @param the button X (InterruptIn)
00069      * @param the button Y (InterruptIn)
00070      * @return the score that need to be added to the previous one
00071      */     
00072     int again(N5110 &lcd,int score,InterruptIn &buttonX,InterruptIn &buttonY);
00073 private:
00074 };
00075 #endif