Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
boom/boom.cpp
- Committer:
- RickYu
- Date:
- 2018-04-30
- Revision:
- 24:14489d259ffb
- Parent:
- 18:78001ecadcb2
File content as of revision 24:14489d259ffb:
#include "boom.h"
boom::boom()
{
}
boom::~boom()
{
}
void boom::init(int x,int y)
{
boom_x = x;
boom_y = y;
}
void boom::draw(N5110 &lcd)
{
//draw the boom on the screen
lcd.drawCircle(boom_x,boom_y,2,FILL_TRANSPARENT);
}
void boom::update()
{
//set the falling speed of boom
//let the boom move with set speed
boom_speed = 4;
boom_y+= boom_speed;
boom_x+=1;
}
Vector2D boom::get_pos()
{
Vector2D p = {boom_x,boom_y};
return p;
}
void boom::set_pos(Vector2D p1)
{
boom_x = p1.x;
boom_y = p1.y;
}