俄罗斯方块C++实现(基于QT)(8)– L型方块代码

  • A+
所属分类:C++

俄罗斯方块C++实现(基于QT)(7)-- S型方块代码

J型方块代码实现(lblock.h, lblock.cpp)

lblock.h代码:

// lblock.h
#ifndef LBLOCK_H
#define LBLOCK_H

#include "tetris.h"

class LBlock : public Tetris
{
public:
    LBlock(int const &style, int const &w, int const &h);
};

#endif // LBLOCK_H

lblock.cpp代码:

// lblock.cpp
#include "lblock.h"

LBlock::LBlock(int const &style, int const &w, int const &h)
{
    bwide = w;
    bhigh = h;
    this->style = style;
    CurPosi[0].x = bwide/2;
    CurPosi[1].x = bwide/2-1;
    CurPosi[2].x = bwide/2;
    CurPosi[3].x = bwide/2;
    CurPosi[0].y = 1;
    CurPosi[1].y = 0;
    CurPosi[2].y = 0;
    CurPosi[3].y = 2;
}

查看下一篇文章俄罗斯方块C++实现(基于QT)(9)

查看上一篇文章俄罗斯方块C++实现(基于QT)(7)

百分购

发表评论

您必须才能发表评论!