Steven Mahasin / Mbed 2 deprecated DreamDungeon

Dependencies:   mbed MotionSensor

Committer:
el17sm
Date:
Thu May 09 14:43:45 2019 +0000
Revision:
58:c8d90bb7404a
Parent:
53:93338b52489d
Child:
59:fd4669864b67
Fully Doxygenated

Who changed what in which revision?

UserRevisionLine numberNew contents of line
el17sm 32:fe6359ef9916 1 #ifndef BULLETS_H
el17sm 32:fe6359ef9916 2 #define BULLETS_H
el17sm 32:fe6359ef9916 3 #include "Entity.h"
el17sm 32:fe6359ef9916 4
el17sm 58:c8d90bb7404a 5 /**Bullets Class
el17sm 58:c8d90bb7404a 6 @author Steven Mahasin
el17sm 58:c8d90bb7404a 7 @brief Creates a Bullet which inherits the Entity class, this will be a created projectile by the player class
el17sm 58:c8d90bb7404a 8 @date May 2019
el17sm 58:c8d90bb7404a 9 */
el17sm 32:fe6359ef9916 10 class Bullets : public Entity
el17sm 32:fe6359ef9916 11 {
el17sm 32:fe6359ef9916 12
el17sm 32:fe6359ef9916 13 public:
el17sm 58:c8d90bb7404a 14 /** Constructor
el17sm 58:c8d90bb7404a 15 * @brief creates a bullet at positions pos_x and pos_y travelling at face dir
el17sm 58:c8d90bb7404a 16 * @param pos_x @details initialise _position.x
el17sm 58:c8d90bb7404a 17 * @param pos_y @details initialise _position.y
el17sm 58:c8d90bb7404a 18 * @param dir @details initialise _face
el17sm 58:c8d90bb7404a 19 */
el17sm 58:c8d90bb7404a 20 Bullets(float pos_x, float pos_y, int dir);
el17sm 32:fe6359ef9916 21
el17sm 32:fe6359ef9916 22 // Functions
el17sm 58:c8d90bb7404a 23 /**
el17sm 58:c8d90bb7404a 24 * @brief function moves the bullet on it's face at a speed
el17sm 58:c8d90bb7404a 25 * @param speed @details the speed of the bullet
el17sm 58:c8d90bb7404a 26 * @param unused @details not used
el17sm 58:c8d90bb7404a 27 * @param map @details not used
el17sm 58:c8d90bb7404a 28 * @param doorways @details not used
el17sm 58:c8d90bb7404a 29 */
el17sm 58:c8d90bb7404a 30 virtual void move(float speed, float unused, char * map, bool * doorways);
el17sm 58:c8d90bb7404a 31 /**
el17sm 58:c8d90bb7404a 32 * @brief draws the bullet onto the screen
el17sm 58:c8d90bb7404a 33 * @param lcd @details the screen where the bullet is drawn
el17sm 58:c8d90bb7404a 34 */
el17sm 32:fe6359ef9916 35 virtual void draw(N5110 &lcd);
el17sm 58:c8d90bb7404a 36 /**
el17sm 58:c8d90bb7404a 37 * @brief reduce _hp by damage
el17sm 58:c8d90bb7404a 38 * @param damage @details the amount of damage to be taken
el17sm 58:c8d90bb7404a 39 */
el17sm 32:fe6359ef9916 40 virtual void take_damage(int damage);
el17sm 58:c8d90bb7404a 41 /**
el17sm 58:c8d90bb7404a 42 * @brief checks if the bullet is out of bounds (hit wall or out of screen)
el17sm 58:c8d90bb7404a 43 * @param map @details the 2d map array that dictates where there are walls or empty space
el17sm 58:c8d90bb7404a 44 * @param doorways @details an array that dictates which side of the wall has a doorway
el17sm 58:c8d90bb7404a 45 * @returns true if bullet is out of bounds
el17sm 58:c8d90bb7404a 46 */
el17sm 34:1d5b4da3935e 47 bool out_of_bounds_check(char * map, bool * doorways);
el17sm 32:fe6359ef9916 48 };
el17sm 32:fe6359ef9916 49
el17sm 33:4f3948dcd2f7 50 const char bullets_sprite[3][3] = {{1,1,1},
el17sm 32:fe6359ef9916 51 {1,1,1},
el17sm 32:fe6359ef9916 52 {1,1,1}
el17sm 32:fe6359ef9916 53 };
el17sm 32:fe6359ef9916 54
el17sm 32:fe6359ef9916 55 #endif