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

  • A+
所属分类:C++

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

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

sblock.h代码:

// sblock.h
#ifndef SBLOCK_H
#define SBLOCK_H

#include "tetris.h"

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

#endif // SBLOCK_H

sblock.cpp代码:

// sblock.cpp
#include "sblock.h"

SBlock::SBlock(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-1;
    CurPosi[2].x = bwide/2;
    CurPosi[3].x = bwide/2;
    CurPosi[0].y = 1;
    CurPosi[1].y = 0;
    CurPosi[2].y = 1;
    CurPosi[3].y = 2;
}

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

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

百分购

发表评论

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