Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef CLASSES_H
- #define CLASSES_H
- class Block
- {
- private:
- int x, y;
- bool ShowBlock;
- int ShapeColor;
- public:
- Block();
- int Getx();
- int Gety();
- void Setx(int xvalue);
- void Sety(int yvalue);
- void DisplayBlocks();
- bool GetShowBlock();
- void SetShowBlock(bool OnOff);
- void SetShapeColor(int shapecolorvalue);
- friend class Shape;
- };
- class Shape
- {
- private:
- int shape, orientation;
- int BlockMarker[4];
- bool LxVel, RxVel, yVel, FlipShape;
- bool LxVelFast, RxVelFast, yVelFast, Fast, pause, restart;
- public:
- Shape();
- void handle_input();
- bool move(Block* aBlock, Shape aShape, int maxsize);
- int CheckCollision(Block* aBlock, int maxsize, int* OriginalyPosition, int* OriginalxPosition);
- void SetShape(int shapevalue, Block* aBlock, int maxsize);
- void SetBlockMarker(int value, int index);
- int GetBlockMarker(int index);
- bool MoveShapeDown(Block* aBlock, Shape aShape, int maxsize);
- void SpawnNewShapeIfNeeded(bool &SpawnShapeAnswer, Block* aBlock, int maxsize, int &nextblockshape, int &linesclearedint, int &scorevalue);
- void SpawnNextShapeInSidebar(int shapevalue, Block* aBlock);
- void Shape::Rotate(Block* aBlock, Shape aShape, int maxsize);
- bool GetIfKeyHeldDown();
- void SetFast(bool fastvalue);
- bool GetPause();
- void SetPause(bool pausevalue);
- void SetOrientation(int OrientationValue);
- bool CheckGameOver(Block* aBlock, int maxsize);
- bool GetRestart();
- void SetRestart(bool restartvalue);
- };
- //timer class and functions made by Lazy Foo [http://lazyfoo.net/SDL_tutorials/index.php]
- class Timer
- {
- private:
- //The clock time when the timer started
- int startTicks;
- //The ticks stored when the timer was paused
- int pausedTicks;
- //The timer status
- bool paused;
- bool started;
- public:
- //Initializes variables
- Timer();
- //The various clock actions
- void start();
- void stop();
- void pause();
- void unpause();
- //Gets the timer's time
- int get_ticks();
- //Checks the status of the timer
- bool is_started();
- bool is_paused();
- };
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement