Chen Zirui Project 201235448

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Touch.h Source File

Touch.h

00001 #ifndef TOUCH_H
00002 #define TOUCH_H
00003 
00004 #include "mbed.h"
00005 #include "N5110.h"
00006 #include "Gamepad.h"
00007 #include "Bullet.h"
00008 #include "Board.h"
00009 
00010 // gap from edge of screen
00011 #define GAP 2
00012 
00013 class Touch
00014 {
00015 
00016 public:
00017 
00018     void init(int Board_width,int Board_length,int bullet_size,int speed,N5110 &lcd);
00019     void reading(Gamepad &pad);
00020     void update(Gamepad &pad,N5110 &lcd);
00021     void draw(N5110 &lcd);
00022     int _leds;
00023     
00024 private:
00025 
00026     void Boundary_touch(Gamepad &pad);
00027     void Board_touch(Gamepad &pad,N5110 &lcd);
00028     void drop(Gamepad &pad);
00029     void print_scores(N5110 &lcd);
00030     
00031     Board _board;
00032      
00033     int _Board_width;
00034     int _Board_length;
00035     int _bullet_size;
00036     int _speed;
00037     
00038     // x positions of the Boards
00039     int _board_x;
00040     int _board_y;
00041     int _p1y;
00042     //int _leds;
00043     float X;//[83];
00044     float Y;//[24];
00045     int s;
00046     Bullet _bullet;
00047     
00048     Direction _d;
00049     float _mag;
00050 
00051 };
00052 
00053 #endif