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

Dependents:   RETRO_BallsAndPaddle RETRO_BallAndHoles

Physics.h

Committer:
maxint
Date:
2015-02-06
Revision:
0:3d0db4e183ee

File content as of revision 0:3d0db4e183ee:

#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;
};