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

  • A+
所属分类:C++

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

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

jblock.h代码:

// jblock.h
#ifndef JBLOCK_H
#define JBLOCK_H

#include "tetris.h"

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

#endif // JBLOCK_H

jblock.cpp代码:

// jblock.cpp
#include "jblock.h"

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

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

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

百分购

发表评论

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