James Cummins / Mbed 2 deprecated el17jnc

Dependencies:   mbed

Ball/Ball.h

Committer:
JamesCummins
Date:
2019-04-18
Revision:
23:61fa82f76808
Parent:
17:5104ecef5bd0
Child:
29:42651f87522b

File content as of revision 23:61fa82f76808:

#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 read_input(FXOS8700CQ &accelerometer);
    void update();
    void draw(N5110 &lcd);
//accessor methods
    Vector2D get_velocity();
    Vector2D get_position();
    int get_radius();
//mutator methods
    void set_ball_speed(int ball_speed);    //this is a constant multiplier for the ball velocity in both axes
    void set_velocity(Vector2D vel);    //this is used to set the velocity at one specific instant in the code
    void set_position(Vector2D pos);
    void set_radius(int radius);
    
private:
    int _radius;
    int _x;
    int _y;
    Vector2D _velocity;
    int _ball_speed;
};
#endif