Elements used in the Balls and Things games for the RETRO.
Dependents: RETRO_BallsAndPaddle RETRO_BallAndHoles
Diff: Physics.h
- Revision:
- 0:3d0db4e183ee
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Physics.h Fri Feb 06 09:51:06 2015 +0000 @@ -0,0 +1,37 @@ +#pragma once +#include "mbed.h" +#include "Vector.h" +#include "Shapes.h" + +class Position +{ + public: + Position(); + Point getPrev(); + Point getCur(); + int getX(); + int getY(); + + void set(float x, float y); + void set(int x, int y); + void set(Point ptNew); + void setX(int x); + void setY(int y); + + void move(float fDiffX, float fDiffY); + void move(int nDiffX, int nDiffY); + void move(Vector vDiff); + bool hasChanged(); + private: + Vector vPos; + Point pPrev; + Point pCur; +}; + +class Dimension +{ + public: + Dimension(); + int nWidth; + int nHeight; +}; \ No newline at end of file