This is the description
Dependencies: mbed Menu Joystick
Diff: Bullet/Bullet.cpp
- Revision:
- 0:59cbc5800eb6
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Bullet/Bullet.cpp Mon Apr 27 14:04:30 2020 +0000 @@ -0,0 +1,40 @@ +#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; +} \ No newline at end of file