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

  • A+
所属分类:C++

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

Z型方块代码实现(zblock.h, zblock.cpp)

zblock.h代码:

// zblock.h
#ifndef ZBLOCK_H
#define ZBLOCK_H

#include "tetris.h"

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

#endif // ZBLOCK_H

zblock.cpp代码:

// zblock.cpp
#include "zblock.h"

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

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

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

百分购

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: