Elements used in the Balls and Things games for the RETRO.
Dependents: RETRO_BallsAndPaddle RETRO_BallAndHoles
Vector.h@8:19dd2a538cbe, 2015-03-02 (annotated)
- Committer:
- maxint
- Date:
- Mon Mar 02 09:58:53 2015 +0000
- Revision:
- 8:19dd2a538cbe
- Parent:
- 2:74bc9b16fb88
more clean-up
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
maxint | 0:3d0db4e183ee | 1 | #pragma once |
maxint | 0:3d0db4e183ee | 2 | #include "mbed.h" |
maxint | 0:3d0db4e183ee | 3 | |
maxint | 0:3d0db4e183ee | 4 | class Vector |
maxint | 0:3d0db4e183ee | 5 | { |
maxint | 0:3d0db4e183ee | 6 | public: |
maxint | 0:3d0db4e183ee | 7 | float x; |
maxint | 0:3d0db4e183ee | 8 | float y; |
maxint | 0:3d0db4e183ee | 9 | |
maxint | 0:3d0db4e183ee | 10 | Vector(); |
maxint | 0:3d0db4e183ee | 11 | Vector(float fX, float fY); |
maxint | 2:74bc9b16fb88 | 12 | void set(float fX, float fY); |
maxint | 0:3d0db4e183ee | 13 | void set(int nX, int nY); |
maxint | 0:3d0db4e183ee | 14 | float getSize(); |
maxint | 0:3d0db4e183ee | 15 | bool isLeft(); |
maxint | 0:3d0db4e183ee | 16 | bool isRight(); |
maxint | 0:3d0db4e183ee | 17 | bool isUp(); |
maxint | 0:3d0db4e183ee | 18 | bool isDown(); |
maxint | 0:3d0db4e183ee | 19 | void add(float fAdd); |
maxint | 0:3d0db4e183ee | 20 | void add(Vector vAdd); |
maxint | 0:3d0db4e183ee | 21 | void multiply(Vector vMult); |
maxint | 2:74bc9b16fb88 | 22 | Vector getNormal(); |
maxint | 2:74bc9b16fb88 | 23 | Vector getNormalized(); |
maxint | 2:74bc9b16fb88 | 24 | void bounce(Vector vBounce); |
maxint | 0:3d0db4e183ee | 25 | }; |