This is the description
Dependencies: mbed Menu Joystick
Bullet/Bullet.cpp
- Committer:
- mrkang
- Date:
- 2020-04-27
- Revision:
- 1:099632454013
- Parent:
- 0:59cbc5800eb6
File content as of revision 1:099632454013:
#include "Bullet.h" Bullet::Bullet() { } Bullet::~Bullet() { } void Bullet::init(int x,int y,int sizeX,int sizeY) { _x = x; _y = y; _sizeX = sizeX; _sizeY = sizeY; _speed = 2; } void Bullet::draw(N5110 &lcd) { int bullet[15] = { 0,1,0, 1,1,1, 0,1,0, 0,1,0, 0,1,1, }; Bitmap spirte(bullet,_sizeX,_sizeY); spirte.render(lcd,_x,_y); } void Bullet::update() { _y-=_speed; } Vector2D Bullet::getPos(){ Vector2D p = {_x,_y}; return p; }