class for bullet in Car_race game

Committer:
fy14aaz
Date:
Fri Apr 07 10:56:15 2017 +0000
Revision:
3:7015c77e39a2
Parent:
2:b87e78ff82ca
Child:
4:a32443aee8f8
working on destroying obstacles using buttons

Who changed what in which revision?

UserRevisionLine numberNew contents of line
fy14aaz 1:6bd0cbdf15f7 1 #include "Bullet.h"
fy14aaz 1:6bd0cbdf15f7 2
fy14aaz 1:6bd0cbdf15f7 3 Bullet::Bullet()
fy14aaz 1:6bd0cbdf15f7 4 {
fy14aaz 1:6bd0cbdf15f7 5
fy14aaz 1:6bd0cbdf15f7 6 }
fy14aaz 1:6bd0cbdf15f7 7
fy14aaz 1:6bd0cbdf15f7 8 Bullet::~Bullet()
fy14aaz 1:6bd0cbdf15f7 9 {
fy14aaz 1:6bd0cbdf15f7 10
fy14aaz 1:6bd0cbdf15f7 11 }
fy14aaz 1:6bd0cbdf15f7 12
fy14aaz 1:6bd0cbdf15f7 13 void Bullet::init(int bullet_x,int bullet_y)
fy14aaz 1:6bd0cbdf15f7 14 {
fy14aaz 1:6bd0cbdf15f7 15 _bullet_x = bullet_x;
fy14aaz 1:6bd0cbdf15f7 16 _bullet_y = bullet_y;
fy14aaz 1:6bd0cbdf15f7 17 }
fy14aaz 1:6bd0cbdf15f7 18
fy14aaz 1:6bd0cbdf15f7 19 void Bullet::draw(N5110 &lcd)
fy14aaz 1:6bd0cbdf15f7 20 {
fy14aaz 3:7015c77e39a2 21 lcd.drawRect(_bullet_x,_bullet_x,2,2,FILL_BLACK);
fy14aaz 1:6bd0cbdf15f7 22 }
fy14aaz 1:6bd0cbdf15f7 23
fy14aaz 3:7015c77e39a2 24 void Bullet::update()
fy14aaz 1:6bd0cbdf15f7 25 {
fy14aaz 2:b87e78ff82ca 26 _bullet_x += 0;
fy14aaz 3:7015c77e39a2 27 _bullet_y -= 1;
fy14aaz 1:6bd0cbdf15f7 28
fy14aaz 1:6bd0cbdf15f7 29 }