ECE 4180 Final

Dependencies:   mbed wave_player mbed-rtos C12832_lcd 4DGL-uLCD-SE LCD_fonts SDFileSystem

Bubble.cpp

Committer:
yqin70
Date:
2019-12-08
Revision:
21:cbcbb3480cad
Parent:
19:d65f9fb1023b

File content as of revision 21:cbcbb3480cad:

#include "Bubble.hpp"

Bubble::Bubble(int x, int y) {
    xpos = x;
    ypos = y;
}

void Bubble::draw() {
    uLCD.filled_circle(xpos, ypos, bubbleRadius, 0x000000);
    uLCD.filled_circle(xpos, newypos, bubbleRadius, 0xFFFFFF);
    update();
}

void Bubble::clear() {
    uLCD.filled_circle(xpos, newypos, bubbleRadius, 0x000000);
}

void Bubble::update() {
    ypos = newypos;
}

void Bubble::moveDown() {
    newypos += bubbleSpeed;
}

int Bubble::getYpos() {
    return ypos;
}