Elements used in the Balls and Things games for the RETRO.

Dependents:   RETRO_BallsAndPaddle RETRO_BallAndHoles

Vector.h

Committer:
maxint
Date:
2015-03-02
Revision:
8:19dd2a538cbe
Parent:
2:74bc9b16fb88

File content as of revision 8:19dd2a538cbe:

#pragma once
#include "mbed.h"

class Vector
{
    public:
        float x;
        float y;
        
        Vector();
        Vector(float fX, float fY);
        void set(float fX, float fY);
        void set(int nX, int nY);
        float getSize();
        bool isLeft();
        bool isRight();
        bool isUp();
        bool isDown();
        void add(float fAdd);
        void add(Vector vAdd);
        void multiply(Vector vMult);
        Vector getNormal();
        Vector getNormalized();
        void bounce(Vector vBounce);
};