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.
Ball/Ball.h
- Committer:
- JamesCummins
- Date:
- 2019-04-11
- Revision:
- 11:2cf0d4ce8677
- Parent:
- 10:40c77d69e83c
- Child:
- 13:e5a36fbd48ae
File content as of revision 11:2cf0d4ce8677:
#ifndef BALL_H
#define BALL_H
#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
#include "FXOS8700CQ.h"
class Ball {
public:
//constructor method
Ball();
//destructor method
~Ball();
//methods for engine
void init(int radius);
void draw(N5110 &lcd);
void update(FXOS8700CQ &accelerometer);
//accessor methods
Vector2D get_accel();
Vector2D get_velocity();
Vector2D get_position();
int get_radius();
//mutator methods
void set_velocity(Vector2D vel);
void set_position(Vector2D pos);
void set_radius(int radius);
private:
int _radius;
int _x;
int _y;
Vector2D _velocity;
Vector2D _accel;
};
#endif