Elements used in the Balls and Things games for the RETRO.
Dependents: RETRO_BallsAndPaddle RETRO_BallAndHoles
Shapes.h
- Committer:
- maxint
- Date:
- 2015-02-06
- Revision:
- 0:3d0db4e183ee
- Child:
- 3:441dc90d10ce
File content as of revision 0:3d0db4e183ee:
#pragma once #include "mbed.h" #include "Vector.h" class Point { protected : int x1, y1; public : Point(); Point(int x, int y); int getX(); int getY(); void set(int x, int y); }; class Rectangle { protected : int x1, x2, y1, y2; public : Rectangle(int x,int y, int x2, int y2); Rectangle(Point pt1, Point pt2); bool collides(Point pt); bool collides(Rectangle r); void set(Rectangle rNew); Point get1(); Point get2(); Point get3(); Point get4(); Point getCenter(); int getX1(); int getX2(); int getY1(); int getY2(); int getCenterX(); int getCenterY(); void move(Vector v); }; class Circle { protected : int x1, y1, r1; public : Circle(int x,int y, int r); Point getCenter(); int getRadius(); int getX(); int getY(); void setX(int x); void setY(int y); void setXY(int x, int y); void move(int x, int y); void move(Vector v); Rectangle getBoundingRectangle(); };