資源簡(jiǎn)介
這是基于Qt5.7.1版本的俄羅斯方塊小游戲~基于繪制和鍵盤事件對(duì)數(shù)組進(jìn)行控制,可以選擇簡(jiǎn)單、中等、困難三個(gè)難度(其實(shí)就是對(duì)下落事件進(jìn)行控制),課程設(shè)計(jì)必備~
代碼片段和文件信息
//////////////////////////////////////////////////////
/**
*?@file?CatRect.cpp
*
*?@note?方塊類
*
*?@author?MollyNeko
*
*?@date?2018-08-06
*
*?@version?1.0.0
**/
//////////////////////////////////////////////////////
#include?
#include?
#include?“catrect.h“
CatRect::CatRect(Qobject?*parent):
????Qobject(parent)
{
}
CatRect::CatRect(ENUM_RECT_SHAPE?enShape?ENUM_RECT_DIRECT?enDirect?Qobject?*parent):
????Qobject(parent)
????m_enShape(enShape)
????m_enDirect(enDirect)
{
????m_nWidth?=?WIDTH_ARRAY[enShape][enDirect];
????m_nHeight?=?HEIGHT_ARRAY[enShape][enDirect];
????m_strRect?=?RECT_ARRAY[enShape][enDirect];
????m_enColor?=?COLOR_ARRAY[enShape];
}
/*?控制函數(shù)?*/
qint32?CatRect::GetWidth()
{
????return?m_nWidth;
}
qint32?CatRect::GetHeight()
{
????return?m_nHeight;
}
QString?CatRect::GetRect()
{
????return?m_strRect;
}
Qt::GlobalColor?CatRect::GetColor()
{
????return?m_enColor;
}
///////////////////////////
評(píng)論
共有 條評(píng)論