class for bullet in Car_race game

Bullet.cpp

Committer:
fy14aaz
Date:
2017-04-11
Revision:
4:a32443aee8f8
Parent:
3:7015c77e39a2
Child:
5:fd945bf405dc

File content as of revision 4:a32443aee8f8:

#include "Bullet.h"

Bullet::Bullet()
{

}

Bullet::~Bullet()
{

}

void Bullet::init(Vector2D _CarHead)
{
    _bullet_x =  _CarHead.x;
    _bullet_y =  _CarHead.y + 2;
    
    printf("x=%d y=%d \n",_bullet_x,_bullet_y);
}

void Bullet::draw(N5110 &lcd)
{
  lcd.drawRect(_bullet_x,_bullet_x,2,2,FILL_BLACK);
}

void Bullet::update()
{
    _bullet_x = _bullet_x;
    _bullet_y = _bullet_y - 5; 
      printf("x=%d y=%d \n",_bullet_x,_bullet_y);
}