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

  • A+
所属分类:C++

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

O型方块代码实现(oblock.h, oblock.cpp)

oblock.h代码:

// oblock.h
#ifndef OBLOCK_H
#define OBLOCK_H

#include "tetris.h"

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

#endif // OBLOCK_H

oblock.cpp代码:

// oblock.cpp
#include "oblock.h"

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

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

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

百分购

发表评论

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