C++实现俄罗斯方块游戏

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_35028612/article/details/79933159

C++实现俄罗斯方块游戏


/*-------------------------
class:CBrick
func:砖块父类
author:creator
date: 2017年11月
-------------------------*/

#pragma once

#ifndef CBRICK_H
#define CBRICK_H

#include "CBrickUnit.h"
#include "CMainGameArea.h"

#define KBRICK_UNIT_COUNT 4

class CBrick
{
public:
    CBrick(CMainGameArea *pGameArea);
    virtual ~CBrick();
    virtual bool rotate() = 0;
    void eraseBrick();
    void drawBrick();
    bool moveLeft();
    bool moveRight();
    bool moveDown();

    void setGameAreaMatrix();
protected:
    CBrickUnit m_arrBrickUnit[KBRICK_UNIT_COUNT];
    int m_iStatus; //旋转的状态
    CMainGameArea *m_pGameArea;
};

#endif

猜你喜欢

转载自blog.csdn.net/qq_35028612/article/details/79933159