Class containing methods to draw a ball within the maze game with the specified position, size and fill style parameters.
Ball.h
- Committer:
- el15mh
- Date:
- 2017-05-03
- Revision:
- 2:bcb96ab2848b
- Parent:
- 1:ba8bb10ebd5a
- Child:
- 3:569a3f2786ec
File content as of revision 2:bcb96ab2848b:
/* @file Ball.h (c) Max Houghton 02.14.17 Roller Maze Project, ELEC2645, Univeristy of Leeds */ // // ball.h // // // Created by Max Houghton on 19/03/2017. // // #ifndef BALL_H #define BALL_H #include "mbed.h" #include "N5110.h" #include "Gamepad.h" class Ball { public: Ball(); ~Ball(); void init(float x, float y, int radius, bool colour); void update(Vector2D position); void draw(N5110 &lcd); Vector2D getPosition(); Vector2D getVelocity(); void setPosition(Vector2D p); void setVelocity(Vector2D v); private: Vector2D velocity; Vector2D checkForInterference(Vector2D velocity); int _radius; float _x; float _y; bool _colour; }; #endif /* BALL_H */