class for bullet in Car_race game
Diff: Bullet.cpp
- Revision:
- 1:6bd0cbdf15f7
- Parent:
- 0:aca013532788
- Child:
- 2:b87e78ff82ca
--- a/Bullet.cpp Thu Mar 30 22:30:02 2017 +0000 +++ b/Bullet.cpp Fri Mar 31 22:25:35 2017 +0000 @@ -0,0 +1,30 @@ +#include "Bullet.h" + +Bullet::Bullet() +{ + +} + +Bullet::~Bullet() +{ + +} + +void Bullet::init(int bullet_x,int bullet_y) +{ + _size = 2; + _bullet_x = bullet_x; + _bullet_y = bullet_y; +} + +void Bullet::draw(N5110 &lcd) +{ + lcd.drawRect(_bullet_x,_bullet_x,_size,_size,FILL_BLACK); +} + +void Bullet::update(Direction d,float mag) +{ + _bullet_x += 1; + _bullet_y += 1; + +} \ No newline at end of file