91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 6.4MB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2023-09-23
  • 語言: 其他
  • 標簽:

資源簡介

qt5做的超級貪吃蛇,支持單人游戲,雙人游戲,有不同特效的食物,可加速減速, 有背景音樂,還有一個很智障的人機對戰。

資源截圖

代碼片段和文件信息

#include?“game0.h“

/*
?*游戲主界面
?*/
game0::game0(QWidget?*parent)?:?QWidget(parent)
{
????setFixedSize(1200600);
????setMouseTracking(true);
????button1?=?new?QPushButton(“單人游戲“this);
????button1->setFont(QFont(“楷體“15));
????button1->move(125100);
????button1->resize(150150);
????button1->setMouseTracking(true);

????button2?=?new?QPushButton(“雙人游戲“this);
????button2->setFont(QFont(“楷體“15));
????button2->move(125260);
????button2->resize(150150);
????button2->setMouseTracking(true);


????button3?=?new?QPushButton(“排行榜“this);
????button3->setFont(QFont(“楷體“15));
????button3->move(285410);
????button3->resize(150150);
????button3->setMouseTracking(true);


????button4?=?new?QPushButton(“人機對戰“this);
????button4->setFont(QFont(“楷體“15));
????button4->move(285260);
????button4->resize(150150);
????button4->setMouseTracking(true);

????button1->setstyleSheet(“border-radius:50px“);
????button2->setstyleSheet(“border-radius:70px“);
????button3->setstyleSheet(“border-radius:70px“);
????button4->setstyleSheet(“border-radius:70px“);
????//各個按鈕點擊后發射信號通知父窗口隱藏當前窗口,顯示游戲窗口
????connect(button1SIGNAL(clicked())thisSLOT(button1slot1()));
????connect(button2SIGNAL(clicked())thisSLOT(button1slot2()));
????connect(button3SIGNAL(clicked())thisSLOT(buttonSlot3()));
????connect(button4SIGNAL(clicked())thisSLOT(buttonSlot4()));

}
void?game0::button1slot1()
{
????emit?signalNewGame(1);
}
void?game0::button1slot2(){
????emit?signalNewGame(2);
}
void?game0::buttonSlot3()
{
????//排行榜對話框
????QMessageBox?*mb?=?new?QMessageBox(this);
????mb->addButton(tr(“重置“)QMessageBox::ActionRole);
????mb->addButton(tr(“退出“)QMessageBox::ActionRole);
????mb->setWindowtitle(“分數排行“);
????mb->setFont(QFont(“楷體“15));

????QString?s?=?“Score?????Ranking\n“;
????QFile?file(“ranking.txt“);
????if(!file.open(QIODevice::ReadOnly?|?QIODevice::Text))
????????return;

????QTextStream?in(&file);
????QString?line?=?in.readLine();
????while(!line.isNull())
????{
????????//分割文本內容
????????QString?s1?=?line.section(‘?‘00).trimmed();
????????s?=?s+s1;
????????//控制輸出顯示格式對齊
????????for(int?i?=?0;?i?????????????s?+=?“?“;
????????s1?=?line.section(‘?‘110);
????????s?=?s?+?s1?+?“\n“;
????????line?=?in.readLine();
????}
????file.close();
????mb->setText(s);

????switch(mb->exec())//判斷對話框點擊重置還是關閉
????{
????case?0:
????{
????????if(!file.open(QIODevice::WriteOnly?|?QIODevice::Text))
????????????return;
????????QTextStream?out(&file);
????????out?<????????break;
????}
????case?1:
????????break;
????}


}

void?game0::buttonSlot4()
{
?????emit?signalNewGame(3);
}

//鼠標移動事件,改變按鈕形狀
void?game0::mouseMoveEvent(QMouseEvent?*event)
{
????int?x?=?event->x();
????int?y?=?event->y();
????//qDebug()?<????if(x?>=?button1->x()?&&?x?<=?button1->x()+button1->width()
????????????&&?y?>=?button1->y()?&&?y?<=?button1->y()+button1->height())
????{

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????????646??2016-12-21?12:06??.qmake.stash
?????文件????????4707??2017-01-02?14:20??game0.cpp
?????文件?????????678??2017-01-02?14:26??game0.h
?????文件????????3660??2017-01-02?14:17??game1.cpp
?????文件?????????781??2017-01-02?14:29??game1.h
?????文件????????7606??2017-01-02?14:24??game2.cpp
?????文件?????????882??2017-01-02?14:26??game2.h
?????文件????????9144??2016-12-30?20:02??game3.cpp
?????文件?????????955??2017-01-02?14:28??game3.h
?????文件????????4022??2017-01-02?13:12??grid.cpp
?????文件????????1027??2017-01-02?14:28??grid.h
?????文件?????????181??2016-12-21?12:03??main.cpp
?????文件?????????923??2016-12-30?19:17??maingame.cpp
?????文件?????????540??2017-01-02?14:30??maingame.h
?????文件????????1578??2016-12-30?19:50??mainwidget.cpp
?????文件?????????625??2016-12-24?13:55??mainwidget.h
?????文件???????23507??2016-12-30?17:42??Makefile
?????文件??????160115??2016-12-30?17:42??Makefile.Debug
?????文件??????160412??2016-12-30?17:42??Makefile.Release
?????文件?????????377??2016-12-30?17:42??object_script.SuperSnake3.Debug
?????文件?????????413??2016-12-30?17:42??object_script.SuperSnake3.Release
?????文件??????????64??2017-12-20?11:10??ranking.txt
?????文件?????????386??2016-12-24?17:55??res.qrc
?????目錄???????????0??2016-12-24?17:55??resorce\
?????文件??????190260??2016-12-22?17:04??resorce\1.png
?????文件?????7091790??2016-12-22?16:53??resorce\Battle?Of?Balls.wav
?????文件????????8300??2016-12-24?16:39??resorce\bb1.jpg
?????文件????????4753??2016-12-24?16:39??resorce\bb2.jpg
?????文件????????1197??2016-12-22?16:44??resorce\food.png
?????文件??????288808??2016-12-22?17:18??resorce\icon.png
?????文件??????175777??2016-12-22?17:06??resorce\main.png
............此處省略10個文件信息

評論

共有 條評論