ELEC2645 (2017/18) / Mbed 2 deprecated el17yw

Dependencies:   mbed

boom/boom.cpp

Committer:
RickYu
Date:
2018-04-30
Revision:
27:eab2cf10554e
Parent:
18:78001ecadcb2
Child:
29:f3e24ccc401d

File content as of revision 27:eab2cf10554e:

#include "boom.h"
boom::boom()
{
}
boom::~boom()
{
}

void boom::init(int x,int y)
{
    boom_x = x;  //initialise the boom position
    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;  
}

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