ELEC2645 (2018/19) / Mbed 2 deprecated el17m2h_public

Dependencies:   mbed

Revision:
4:8ec314f806ae
Child:
5:8814d6de77d0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Doodler/Doodler.cpp	Thu Apr 11 14:44:14 2019 +0000
@@ -0,0 +1,41 @@
+#include "Doodler.h"
+
+Doodler::Doodler(){
+}
+Doodler::~Doodler(){
+}
+
+void Doodler::init(int x, int y, int radius){
+    _radius = radius;
+    
+    _x = x;
+    _y = y;
+    
+    _velocity.x = 0;
+    _velocity.y = 0;
+}
+
+void Doodler::draw(N5110 &lcd){
+    lcd.drawCircle(_x, _y, _radius, FILL_BLACK);
+}
+
+
+void Doodler::set_velocity(Vector2D v){
+    _velocity.x = v.x;
+    _velocity.y = v.y;
+}
+
+Vector2D Doodler::get_velocity(){
+    Vector2D v = {_velocity.x,_velocity.y};
+    return v;
+}
+
+Vector2D Doodler::get_pos(){
+    Vector2D p = {_x,_y};
+    return p;
+}
+
+void Doodler::set_pos(Vector2D p){
+    _x = p.x;
+    _y = p.y;
+}
\ No newline at end of file