ELEC2645 (2018/19) / Mbed 2 deprecated el17m2h_public

Dependencies:   mbed

Floors/Floors.cpp

Committer:
el17m2h
Date:
2019-04-17
Revision:
10:e1d2289705ef
Parent:
9:5e53bca2a4c2
Child:
11:2041290b5a74

File content as of revision 10:e1d2289705ef:

#include "Floors.h"

Floors::Floors(){
}
Floors::~Floors(){
}

void Floors::init(int x, int y, int width, int height){
    _height = height;
    _width = width;
    
    _pos.x = x;
    _pos.y = y;
    
}

void Floors::draw(N5110 &lcd){
    lcd.drawRect(_pos.x, _pos.y, _width, _height, FILL_BLACK);
}

void Floors::update(Vector2D current_pos){
    _pos = current_pos;
    // if they are below the y  bottom then they re-appear at top in a random place
    
}

Vector2D Floors::get_pos(){
    Vector2D p = {_pos.x,_pos.y};
    return p;
}


void Floors::set_pos(Vector2D p){
    _pos.x = p.x;
    _pos.y = p.y;
}