Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Doodler/Doodler.h
- Committer:
- el17m2h
- Date:
- 2019-04-17
- Revision:
- 10:e1d2289705ef
- Parent:
- 9:5e53bca2a4c2
- Child:
- 13:10851784af9a
File content as of revision 10:e1d2289705ef:
#ifndef DOODLER_H
#define DOODLER_H
#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
#include "Floors.h"
class Doodler{
public:
Doodler();
~Doodler();
void init(int radius);
void draw(N5110 &lcd);
void update(Direction d, float mag, float current_vel_x, double current_vel_y);
float get_velocity_x();
double get_velocity_y();
float get_position_x();
float get_position_y();
void set_velocity(float v_x, double v_y);
void set_position(float p_x, float p_y);
private:
int _radius;
// since the velocity will be added, it will not be an integer so it cannot be a vector
float _pos_x;
float _pos_y;
// velocity needs to be float in order to decelerate
float _velocity_x;
double _velocity_y;
double _gravity;
double _up;
};
#endif