ELEC2645 (2017/18) / Mbed 2 deprecated el17yw

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;
}