Albert Tan-Mulligan / Mbed 2 deprecated ELEC2645_Project_el18ajst

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Bullets.h Source File

Bullets.h

00001 /** Bullets Class:
00002 @brief  - Defines instances of bullets for a 2D shooter game
00003 
00004 @author Albert Tan Muligan, Student at University of Leeds
00005 @date May 2020
00006 
00007 
00008 */ 
00009 
00010 #include "mbed.h"
00011 #include "N5110.h"
00012 #include "Gamepad.h"
00013 class Bullets
00014 {
00015 
00016 public:
00017     /** 
00018   * @brief Constructor that sets inital x and y
00019   * @param x and y  @details x and y in pixels (max x = 84, y = 48)
00020   */
00021     Bullets(int ex, int wy, int d);
00022     ~Bullets();
00023     void draw(N5110 &lcd);
00024     void update();
00025     ///Y value accessor
00026     int get_y();
00027     ///X value accessor
00028     int get_x();
00029     ///"Dead" mutator puts the x and y at 1000 so it's off-screen.
00030     void dead();
00031 private:
00032     int _x;
00033     int _y;
00034     int _dir;
00035 };