Projectile Library

Committer:
ll14c4p
Date:
Thu May 04 11:36:22 2017 +0000
Revision:
11:aa2ca5b358fe
Parent:
10:ee3c4bb4ce37
+Deoxygen

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ll14c4p 0:6914458c54cd 1 #ifndef PROJECTILE_H
ll14c4p 0:6914458c54cd 2 #define PROJECTILE_H
ll14c4p 0:6914458c54cd 3
ll14c4p 0:6914458c54cd 4 #include "mbed.h"
ll14c4p 0:6914458c54cd 5 #include "N5110.h"
ll14c4p 0:6914458c54cd 6 #include "Gamepad.h"
ll14c4p 2:b079859c59ba 7 #include "Player.h"
ll14c4p 0:6914458c54cd 8
ll14c4p 0:6914458c54cd 9 class Projectile
ll14c4p 0:6914458c54cd 10 {
ll14c4p 0:6914458c54cd 11 public:
ll14c4p 0:6914458c54cd 12 Projectile();
ll14c4p 0:6914458c54cd 13 ~Projectile();
ll14c4p 11:aa2ca5b358fe 14
ll14c4p 11:aa2ca5b358fe 15 /** Initialise Projectile
ll14c4p 11:aa2ca5b358fe 16 *
ll14c4p 11:aa2ca5b358fe 17 * This function initialises the projectile library.
ll14c4p 11:aa2ca5b358fe 18 */
ll14c4p 4:977109f7b9f6 19 void init(int playerx, int playery);
ll14c4p 11:aa2ca5b358fe 20
ll14c4p 11:aa2ca5b358fe 21 /** Draw
ll14c4p 11:aa2ca5b358fe 22 *
ll14c4p 11:aa2ca5b358fe 23 * This function draws the projectile on screen when called.
ll14c4p 11:aa2ca5b358fe 24 */
ll14c4p 1:2aee0cb1ebf9 25 void draw(N5110 &lcd);
ll14c4p 11:aa2ca5b358fe 26
ll14c4p 11:aa2ca5b358fe 27 /** Get Position
ll14c4p 11:aa2ca5b358fe 28 *
ll14c4p 11:aa2ca5b358fe 29 * This function obtains the coordinates of the top-left pixel in the projectile.
ll14c4p 11:aa2ca5b358fe 30 */
ll14c4p 1:2aee0cb1ebf9 31 Vector2D get_pos();
ll14c4p 11:aa2ca5b358fe 32
ll14c4p 11:aa2ca5b358fe 33 /** Update
ll14c4p 11:aa2ca5b358fe 34 *
ll14c4p 11:aa2ca5b358fe 35 * This function updates changes in position of the projectile on screen.
ll14c4p 11:aa2ca5b358fe 36 */
ll14c4p 1:2aee0cb1ebf9 37 void update();
ll14c4p 2:b079859c59ba 38 int playerx;
ll14c4p 2:b079859c59ba 39 int playery;
ll14c4p 4:977109f7b9f6 40 int _playerx;
ll14c4p 4:977109f7b9f6 41 int _playery;
ll14c4p 11:aa2ca5b358fe 42
ll14c4p 11:aa2ca5b358fe 43 /** Set Position
ll14c4p 11:aa2ca5b358fe 44 *
ll14c4p 11:aa2ca5b358fe 45 * This function is used to set the position of the projectile to a specific coordinate on screen.
ll14c4p 11:aa2ca5b358fe 46 */
ll14c4p 6:70b35ebfa8c8 47 void set_pos(Vector2D p);
ll14c4p 0:6914458c54cd 48
ll14c4p 0:6914458c54cd 49 private:
ll14c4p 3:70c599d9f191 50 int m;
ll14c4p 1:2aee0cb1ebf9 51 Vector2D _velocity;
ll14c4p 1:2aee0cb1ebf9 52 int _size;
ll14c4p 1:2aee0cb1ebf9 53 int _x;
ll14c4p 1:2aee0cb1ebf9 54 int _y;
ll14c4p 2:b079859c59ba 55
ll14c4p 0:6914458c54cd 56 };
ll14c4p 0:6914458c54cd 57 #endif