class for bullet in Car_race game

Committer:
fy14aaz
Date:
Mon Apr 17 20:45:25 2017 +0000
Revision:
8:89a98a3d7233
Parent:
6:581257752de1
Child:
11:61bbec4ede2c
completed the bullet class and will work on the motion using the accelerometer next

Who changed what in which revision?

UserRevisionLine numberNew contents of line
fy14aaz 1:6bd0cbdf15f7 1 #ifndef BULLET_H
fy14aaz 1:6bd0cbdf15f7 2 #define BULLET_H
fy14aaz 1:6bd0cbdf15f7 3
fy14aaz 1:6bd0cbdf15f7 4 #include "mbed.h"
fy14aaz 1:6bd0cbdf15f7 5 #include "N5110.h"
fy14aaz 1:6bd0cbdf15f7 6 #include "Gamepad.h"
fy14aaz 1:6bd0cbdf15f7 7
fy14aaz 1:6bd0cbdf15f7 8
fy14aaz 1:6bd0cbdf15f7 9 class Bullet
fy14aaz 1:6bd0cbdf15f7 10 {
fy14aaz 1:6bd0cbdf15f7 11
fy14aaz 1:6bd0cbdf15f7 12 public:
fy14aaz 1:6bd0cbdf15f7 13 Bullet();
fy14aaz 1:6bd0cbdf15f7 14 ~Bullet();
fy14aaz 4:a32443aee8f8 15 void init(Vector2D _CarHead);
fy14aaz 1:6bd0cbdf15f7 16 void draw(N5110 &lcd);
fy14aaz 6:581257752de1 17 void clearBullet(N5110 &lcd);
fy14aaz 5:fd945bf405dc 18 void update(N5110 &lcd,int _bulletDirection);
fy14aaz 8:89a98a3d7233 19 void destroyObstacles(N5110 &lcd);
fy14aaz 1:6bd0cbdf15f7 20 // void accident(N5110 &lcd);
fy14aaz 1:6bd0cbdf15f7 21
fy14aaz 1:6bd0cbdf15f7 22 private:
fy14aaz 4:a32443aee8f8 23
fy14aaz 4:a32443aee8f8 24 Vector2D _CarHead;
fy14aaz 1:6bd0cbdf15f7 25 int _bullet_x;
fy14aaz 1:6bd0cbdf15f7 26 int _bullet_y;
fy14aaz 1:6bd0cbdf15f7 27 int _speed;
fy14aaz 1:6bd0cbdf15f7 28
fy14aaz 1:6bd0cbdf15f7 29 };
fy14aaz 1:6bd0cbdf15f7 30 #endif