找一个QT四不像神兽是万兽之王王游戏能开户吗

很多人相知QT神奇实验室游戏有最新版本吗【qt吧】_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:33,219贴子:
很多人相知QT神奇实验室游戏有最新版本吗收藏
一楼喂百度。
登录百度帐号推荐应用自己的作品(19)
中秋无聊,女朋友加班,自己一个宅在宿舍写了一个类似“老虎机”的小游戏。供大家一起分享。
自已做了一个安装包,可以发给其它电脑安装玩耍。主要界面如下图:
是有音频效果的,如果谁想玩,我可以发安装包的喔。
tigtermachines.cpp
#include &tigtermachines.h&
#include &gameplatform.h&
#include &ui_tigtermachines.h&
#include &QDebug&
#include &QMessageBox&
#include &QTime&
#include &QSound&
#include &QDir&
TigterMachines::TigterMachines(QWidget *parent) :
QWidget(parent),
ui(new Ui::TigterMachines),
m_timer(new QTimer),
m_lamb(<span style="color:#),
m_currentMark(<span style="color:#),
m_remainingMark(<span style="color:#),
m_allFruitNumberMark(<span style="color:#),
m_fruitButtonId(<span style="color:#),
m_timeNumberCount(<span style="color:#),
m_time(<span style="color:#)
ui-&setupUi(this);
QPixmap pixmap(&:/image/tigerBack.png&);
QPalette palette = this-&palette();
palette.setBrush(backgroundRole(),QBrush(pixmap));
setPalette(palette);
setWindowFlags(Qt::FramelessWindowHint | Qt::Dialog);
initLamb();
showCurrentMark();
showRemainMark();
initFruitNumberMark();
initAllFruit();
initFruitNumber();
initFruitEdit();
initFruitButton();
initFruitMark();
initBetMark();
initTimeEdit();
connect(m_timer, SIGNAL(timeout()), this, SLOT(slotGameStart()));
connect(ui-&gameStartButton, SIGNAL(clicked()), this, SLOT(slotTimerStart()));
connect(ui-&getMarkButton, SIGNAL(clicked()), this, SLOT(slotBuyMark()));
connect(m_fruitNumberButton[<span style="color:#], SIGNAL(clicked()), this, SLOT(slotSetFruitButton1()));
connect(m_fruitNumberButton[<span style="color:#], SIGNAL(clicked()), this, SLOT(slotSetFruitButton2()));
connect(m_fruitNumberButton[<span style="color:#], SIGNAL(clicked()), this, SLOT(slotSetFruitButton3()));
connect(m_fruitNumberButton[<span style="color:#], SIGNAL(clicked()), this, SLOT(slotSetFruitButton4()));
connect(m_fruitNumberButton[<span style="color:#], SIGNAL(clicked()), this, SLOT(slotSetFruitButton5()));
connect(ui-&leave, SIGNAL(clicked()), this, SLOT(slotLeave()));
for(int fruitButton = <span style="color:#; fruitButton & <span style="color:#; fruitButton &#43;&#43;)
connect(m_fruitNumberButton[fruitButton], SIGNAL(clicked()), this, SLOT(slotSetFruitEidt()));
TigterMachines::~TigterMachines()
delete ui;
void TigterMachines::initLamb()
lambShow(<span style="color:#);
void TigterMachines::initTimeEdit()
m_time = <span style="color:#;
ui-&timeEdit1-&setText(QString::number(<span style="color:#));
ui-&timeEdit2-&setText(QString::number(<span style="color:#));
void TigterMachines::analyzeTime()
if(m_time &= <span style="color:#)
a = m_time % <span style="color:#;
b = m_time / <span style="color:#;
ui-&timeEdit1-&setText(QString::number(b));
ui-&timeEdit2-&setText(QString::number(a));
ui-&timeEdit1-&setText(QString::number(<span style="color:#));
ui-&timeEdit2-&setText(QString::number(m_time));
static int timeFlag = <span style="color:#;
void TigterMachines::slotGameStart()
if(m_lamb &<span style="color:# )
m_lamb = <span style="color:#;
lambShow(m_lamb);
m_lamb &#43;&#43;;
m_timeNumberCount &#43;&#43;;
t= QTime::currentTime();
qsrand(t.msec()&#43;t.second()*<span style="color:#00);
int n = qrand()%<span style="color:#;
if(<span style="color:# &= m_timeNumberCount &#43; n )
m_timeNumberCount = <span style="color:#;
m_timer-&stop();
getTheFinallMark();
initFruitNumberMark();
initAllFruit();
initFruitNumber();
initFruitEdit();
initFruitButton();
initFruitMark();
initBetMark();
initTimeEdit();
ui-&gameStartButton-&setEnabled(true);
timeFlag &#43;&#43;;
if(timeFlag % <span style="color:#)
m_time &#43;&#43;;
analyzeTime();
int TigterMachines::getTheFinallMark()
int finalMark = <span style="color:#;
if(<span style="color:# == m_fruitMark[m_lamb-<span style="color:#])
finalMark = m_fruitNumberEdit[<span style="color:#]-&text().toInt()*<span style="color:#;
} else if(<span style="color:# == m_fruitMark[m_lamb-<span style="color:#]) {
finalMark = m_fruitNumberEdit[<span style="color:#]-&text().toInt()*<span style="color:#;
} else if(<span style="color:# == m_fruitMark[m_lamb-<span style="color:#]) {
finalMark = m_fruitNumberEdit[<span style="color:#]-&text().toInt()*<span style="color:#;
} else if(<span style="color:# == m_fruitMark[m_lamb-<span style="color:#]) {
finalMark = m_fruitNumberEdit[<span style="color:#]-&text().toInt()*<span style="color:#;
} else if(<span style="color:# == m_fruitMark[m_lamb-<span style="color:#]) {
finalMark = m_fruitNumberEdit[<span style="color:#]-&text().toInt()*<span style="color:#;
qDebug() && &this finalMark is:& && finalMark && m_fruitMark[m_lamb-<span style="color:#] && m_lamb-<span style="color:# && m_fruitMark.count();
qDebug() && &the remaining mark is:& && m_remainingMark;
m_remainingMark &#43;= m_fruitMark[m_lamb-<span style="color:#] * finalM
ui-&allMarkEdit-&setText(QString::number(m_remainingMark));
ui-&getMarkEdit-&setText(QString::number(m_fruitMark[m_lamb-<span style="color:#] * finalMark));
return m_remainingMark;
void TigterMachines::slotTimerStart()
m_timer-&start(<span style="color:#0);
//QSound::play(&:/image/beijing.wav&);
QString dir=QCoreApplication ::applicationDirPath();
QString filename(dir&#43;&/image/beijing.wav&);
QSound::play ( filename );
ui-&gameStartButton-&setEnabled(false);
void TigterMachines::slotBuyMark()
qDebug()&& &the all remainingMark is:& && m_remainingMark;
m_remainingMark &#43;= <span style="color:#0;
setRemainingMark(m_remainingMark);
showRemainMark();
void TigterMachines::slotSetFruitButton1()
m_fruitButtonId = <span style="color:#;
void TigterMachines::slotSetFruitButton2()
m_fruitButtonId = <span style="color:#;
void TigterMachines::slotSetFruitButton3()
m_fruitButtonId = <span style="color:#;
void TigterMachines::slotSetFruitButton4()
m_fruitButtonId = <span style="color:#;
void TigterMachines::slotSetFruitButton5()
m_fruitButtonId = <span style="color:#;
void TigterMachines::slotLeave()
GamePlatform *gamePlat = new GamePlatform;
this-&close();
gamePlat-&show();
void TigterMachines::slotSetFruitEidt()
m_fruitNumber[m_fruitButtonId] &#43;= <span style="color:#;
if(! getAllFruitNumberMark())
m_fruitNumber[m_fruitButtonId] -= <span style="color:#;
if(<span style="color:# == m_fruitButtonId)
ui-&fruitEdit1-&setText(QString::number(m_fruitNumber[m_fruitButtonId]));
} else if (<span style="color:# == m_fruitButtonId) {
ui-&fruitEdit2-&setText(QString::number(m_fruitNumber[m_fruitButtonId]));
} else if(<span style="color:# == m_fruitButtonId) {
ui-&fruitEdit3-&setText(QString::number(m_fruitNumber[m_fruitButtonId]));
} else if(<span style="color:# == m_fruitButtonId) {
ui-&fruitEdit4-&setText(QString::number(m_fruitNumber[m_fruitButtonId]));
} else if(<span style="color:# == m_fruitButtonId) {
ui-&fruitEdit5-&setText(QString::number(m_fruitNumber[m_fruitButtonId]));
void TigterMachines::lambShow(int lambId)
if(<span style="color:# == lambId)
ui-&redLamp1-&hide();
ui-&redLamp2-&hide();
ui-&redLamp3-&hide();
ui-&redLamp4-&hide();
ui-&redLamp5-&hide();
ui-&redLamp6-&hide();
ui-&redLamp7-&hide();
ui-&redLamp8-&hide();
ui-&redLamp9-&hide();
ui-&redLamp10-&hide();
ui-&redLamp11-&hide();
ui-&redLamp12-&hide();
ui-&blackLamb1-&show();
ui-&blackLamb2-&show();
ui-&blackLamb3-&show();
ui-&blackLamb4-&show();
ui-&blackLamb5-&show();
ui-&blackLamb6-&show();
ui-&blackLamb7-&show();
ui-&blackLamb8-&show();
ui-&blackLamb9-&show();
ui-&blackLamb10-&show();
ui-&blackLamb11-&show();
ui-&blackLamb12-&show();
} else if (<span style="color:# == lambId) {
lambShow(<span style="color:#);
ui-&redLamp1-&show();
ui-&blackLamb1-&hide();
} else if (<span style="color:# == lambId) {
lambShow(<span style="color:#);
ui-&redLamp2-&show();
ui-&blackLamb2-&hide();
} else if (<span style="color:# == lambId) {
lambShow(<span style="color:#);
ui-&redLamp3-&show();
ui-&blackLamb3-&hide();
} else if (<span style="color:# == lambId) {
lambShow(<span style="color:#);
ui-&redLamp4-&show();
ui-&blackLamb4-&hide();
} else if (<span style="color:# == lambId) {
lambShow(<span style="color:#);
ui-&redLamp5-&show();
ui-&blackLamb5-&hide();
} else if (<span style="color:# == lambId) {
lambShow(<span style="color:#);
ui-&redLamp6-&show();
ui-&blackLamb6-&hide();
} else if (<span style="color:# == lambId) {
lambShow(<span style="color:#);
ui-&redLamp7-&show();
ui-&blackLamb7-&hide();
} else if (<span style="color:# == lambId) {
lambShow(<span style="color:#);
ui-&redLamp8-&show();
ui-&blackLamb8-&hide();
} else if (<span style="color:# == lambId) {
lambShow(<span style="color:#);
ui-&redLamp9-&show();
ui-&blackLamb9-&hide();
} else if (<span style="color:# == lambId) {
lambShow(<span style="color:#);
ui-&redLamp10-&show();
ui-&blackLamb10-&hide();
} else if (<span style="color:# == lambId) {
lambShow(<span style="color:#);
ui-&redLamp11-&show();
ui-&blackLamb11-&hide();
} else if (<span style="color:# == lambId) {
lambShow(<span style="color:#);
ui-&redLamp12-&show();
ui-&blackLamb12-&hide();
void TigterMachines::setCurrentMark(int mark)
m_currentMark =
int TigterMachines::getCurrentMark()
return m_currentMark;
void TigterMachines::setRemainingMark(int mark)
m_remainingMark =
int TigterMachines::getRemainingMark()
return m_remainingMark;
void TigterMachines::showCurrentMark()
ui-&getMarkEdit-&setText(QString::number(getCurrentMark()));
void TigterMachines::showRemainMark()
ui-&allMarkEdit-&setText(QString::number(getRemainingMark()));
void TigterMachines::initBetMark()
ui-&betMark-&setText(QString::number(<span style="color:#));
void TigterMachines::initFruitMark()
if(!m_fruitMark.isEmpty())
m_fruitMark.clear();
m_fruitMark && <span style="color:# && <span style="color:# && <span style="color:# && <span style="color:# && <span style="color:# && <span style="color:# && <span style="color:# && <span style="color:# && <span style="color:# && <span style="color:# && <span style="color:# && <span style="color:# ;
void TigterMachines::initAllFruit()
ui-&fruitEdit1-&setText(QString::number(<span style="color:#));
ui-&fruitEdit2-&setText(QString::number(<span style="color:#));
ui-&fruitEdit3-&setText(QString::number(<span style="color:#));
ui-&fruitEdit4-&setText(QString::number(<span style="color:#));
ui-&fruitEdit5-&setText(QString::number(<span style="color:#));
void TigterMachines::initFruitNumber()
if(!m_fruitNumber.isEmpty())
m_fruitNumber.clear();
for(int fruitNumberId = <span style="color:#; fruitNumberId & <span style="color:#; fruitNumberId &#43;&#43;)
m_fruitNumber && <span style="color:#;
void TigterMachines::initFruitNumberMark()
if(!m_fruitNumberMark.isEmpty())
m_fruitNumberMark.clear();
int mark = <span style="color:#;
for(int fruitNumberMarkId = <span style="color:#; fruitNumberMarkId & <span style="color:#; fruitNumberMarkId &#43;&#43;)
m_fruitNumberMark &&
mark &#43;= <span style="color:#;
void TigterMachines::initFruitButton()
if(!m_fruitNumberButton.isEmpty())
m_fruitNumberButton.clear();
m_fruitNumberButton && ui-&fruitButton1 && ui-&fruitButton2 && ui-&fruitButton3 && ui-&fruitButton4 && ui-&fruitButton5 ;
void TigterMachines::initFruitEdit()
if(!m_fruitNumberEdit.isEmpty())
m_fruitNumberEdit.clear();
m_fruitNumberEdit && ui-&fruitEdit1 && ui-&fruitEdit2 && ui-&fruitEdit3 && ui-&fruitEdit4 && ui-&fruitEdit5 ;
void TigterMachines::setFruitNumber()
m_fruitNumber[<span style="color:#] = ui-&fruitEdit1-&text().toInt();
m_fruitNumber[<span style="color:#] = ui-&fruitEdit2-&text().toInt();
m_fruitNumber[<span style="color:#] = ui-&fruitEdit3-&text().toInt();
m_fruitNumber[<span style="color:#] = ui-&fruitEdit4-&text().toInt();
m_fruitNumber[<span style="color:#] = ui-&fruitEdit5-&text().toInt();
void TigterMachines::getFruitNumber()
bool TigterMachines::getAllFruitNumberMark()
m_allFruitNumberMark = <span style="color:#;
int tempMark = <span style="color:#;
for(int fruitNumberId = <span style="color:#; fruitNumberId & <span style="color:#; fruitNumberId&#43;&#43;)
tempMark &#43;= m_fruitNumberMark[fruitNumberId] * m_fruitNumber[fruitNumberId];
m_remainingMark -= m_fruitNumberMark[m_fruitButtonId];
m_allFruitNumberMark = tempM
qDebug()&&&this is test(leeeeeeeee):& && m_remainingMark && m_fruitNumberMark[m_fruitButtonId] && m_remainingMark;
if((m_remainingMark &#43; m_fruitNumberMark[m_fruitButtonId]) & m_fruitNumberMark[m_fruitButtonId] || m_remainingMark &= m_fruitNumberMark[m_fruitButtonId] || m_remainingMark == <span style="color:# && m_fruitNumberMark[m_fruitButtonId] != <span style="color:#) {
ui-&allMarkEdit-&setText(QString::number(m_remainingMark));
ui-&betMark-&setText(QString::number(m_allFruitNumberMark));
return true;
QMessageBox::information(NULL, &Waring&, &the all Mark is low your control&,QMessageBox::Yes);
m_remainingMark &#43;= m_fruitNumberMark[m_fruitButtonId];
m_allFruitNumberMark -= m_fruitNumberMark[m_fruitButtonId];
ui-&allMarkEdit-&setText(QString::number(m_remainingMark));
ui-&betMark-&setText(QString::number(m_allFruitNumberMark));
return false;
widget.cpp
#include &widget.h&
#include &ui_widget.h&
#include &rigistered.h&
#include &findpassword.h&
#include &QFile&
#include &QTextStream&
#include &QMessageBox&
#include &QDebug&
#include &gameplatform.h&
Widget::Widget(QWidget *parent) :
QWidget(parent),
m_ui(new Ui::Widget)
m_ui-&setupUi(this);
QPixmap pixmap(QString::fromUtf8(&:/image/loginBack.png&));//当前文件夹下面的图片
QPalette palette = this-&palette();
palette.setBrush(backgroundRole(), QBrush(pixmap));
setPalette(palette);
setWindowFlags(Qt::FramelessWindowHint | Qt::Dialog);
this-&setStyleSheet(tr(&background-image: url(:/image/loginBack.png)&));
connect(m_ui-&rigisteredButton, SIGNAL(clicked()), this ,SLOT(registered()));
connect(m_ui-&login, SIGNAL(clicked()), this ,SLOT(slotLogin()));
connect(m_ui-&forgetPasswordButton, SIGNAL(clicked()), this, SLOT(slotForgetPassword()));
connect(m_ui-&cancle, SIGNAL(clicked()), this, SLOT(slotLeave()));
Widget::~Widget()
delete m_ui;
void Widget::registered()
Rigistered *rigist = new Rigistered(this);
this-&close();
rigist-&show();
void Widget::slotLogin()
qDebug()&& &the context is:&&&
QFile file(tr(&D:\personMessage.txt&));
if(!file.open(QIODevice::ReadOnly | QIODevice::Text))
QMessageBox::information(NULL, &Waring&, &Read file fail!&, QMessageBox::Yes, QMessageBox::Yes);
QTextStream in(&file);
QString userName = in.readLine(<span style="color:#);
QString password = in.readLine(<span style="color:#);
qDebug() && &the userName is:& && userN
qDebug() && &the password is:& &&
userName.toStdString();
password.toStdString();
if(m_ui-&userNameEdit-&text().isEmpty())
qDebug() && &this is test:& && m_ui-&userNameEdit-&text();
QMessageBox::information(NULL, &Waring&, &the userName is NULL&, QMessageBox::Yes);
if(m_ui-&userNameEdit-&text() != userName)
qDebug() && &this is test:& && m_ui-&userNameEdit-&text();
m_ui-&userName-&clear();
QMessageBox::information(NULL, &Waring&, &此账号未被注册!&, QMessageBox::Yes);
if(m_ui-&password-&text().isEmpty())
QMessageBox::information(NULL, &Waring&, &密码不能为空&, QMessageBox::Yes);
if(m_ui-&userNameEdit-&text() == userName && m_ui-&passWordEdit-&text() != password)
m_ui-&password-&clear();
QMessageBox::information(NULL, &Waring&, &用户密码错误&, QMessageBox::Yes);
if(m_ui-&userNameEdit-&text() == userName && m_ui-&passWordEdit-&text() == password)
GamePlatform *gamePlatform = new GamePlatform;
this-&close();
gamePlatform-&show();
file.close();
void Widget::slotForgetPassword()
FindPassword *rigist = new FindPassword;
this-&close();
rigist-&show();
void Widget::slotLeave()
this-&close();
//dice.cpp
#include &dice.h&
#include &ui_dice.h&
#include &QDebug&
#include &QMessageBox&
#include &QTime&
#include &QSound&
#include &QThread&
#include &gameplatform.h&
#ifndef GAME_DABAO
#define GAME_DABAO &GAMADABAO&
Dice::Dice(QWidget *parent) :
QWidget(parent),
ui(new Ui::Dice),
m_startTimer(new QTimer),
m_diceOne(<span style="color:#),
m_diceTwo(<span style="color:#),
m_diceThree(<span style="color:#),
m_currentDiceNumberOne(<span style="color:#),
m_currentDiceNumberTwo(<span style="color:#),
m_currentDiceNumberThree(<span style="color:#),
m_remainMark(<span style="color:#),
m_currentMark(<span style="color:#),
m_betMark(<span style="color:#),
m_diceEdit1(<span style="color:#),
m_diceEdit2(<span style="color:#),
m_diceEdit3(<span style="color:#),
m_diceEdit4(<span style="color:#),
m_TimerOne(new QTimer),
m_TimerTwo(new QTimer),
m_TimerThree(new QTimer),
m_time(<span style="color:#)
ui-&setupUi(this);
QPixmap pixmap(&:/image/diceBack.png&);
QPalette palette = this-&palette();
palette.setBrush(backgroundRole(),QBrush(pixmap));
setPalette(palette);
setWindowFlags(Qt::FramelessWindowHint | Qt::Dialog);
showDiceOne(<span style="color:#);
showDiceTwo(<span style="color:#);
showDiceThree(<span style="color:#);
initDiceEdit();
connect(ui-&startButton, SIGNAL(pressed()), this, SLOT(slotTimerStart()));
connect(m_startTimer, SIGNAL(timeout()), this, SLOT(slotDiceOne()));
connect(m_startTimer, SIGNAL(timeout()), this, SLOT(slotDiceTwo()));
connect(m_startTimer, SIGNAL(timeout()), this, SLOT(slotDiceThree()));
connect(ui-&getMark, SIGNAL(clicked()), this, SLOT(setRemainMark()));
connect(ui-&betButton1, SIGNAL(clicked()), this, SLOT(slotShowEdit1()));
connect(ui-&betButton2, SIGNAL(clicked()), this, SLOT(slotShowEdit2()));
connect(ui-&betButton3, SIGNAL(clicked()), this, SLOT(slotShowEdit3()));
connect(ui-&betButton4, SIGNAL(clicked()), this, SLOT(slotShowEdit4()));
connect(this, SIGNAL(oneAudioPlay()), this, SLOT(slotTimerOneStart()));
connect(this, SIGNAL(twoAudioPlay()), this, SLOT(slotTimerTwoStart()));
connect(this, SIGNAL(threeAudioPlay()), this, SLOT(slotTimerThreeStart()));
connect(m_TimerOne, SIGNAL(timeout()), this, SLOT(slotTimerOne()));
connect(m_TimerTwo, SIGNAL(timeout()), this, SLOT(slotTimerTwo()));
connect(m_TimerThree, SIGNAL(timeout()), this, SLOT(slotTimerThree()));
connect(ui-&leaveButton, SIGNAL(clicked()), this, SLOT(slotLeave()));
Dice::~Dice()
delete ui;
void Dice::setRemainMark()
m_remainMark &#43;= <span style="color:#;
remainMarkShow();
playMusic(&/image/getMark.wav&);
int Dice::getRemainMark()
return m_remainMark;
void Dice::setBetButton1()
if(m_remainMark &= <span style="color:#) {
m_diceEdit1 &#43;= <span style="color:#;
m_diceEdit1 &#43;= <span style="color:#;
void Dice::setBetButton2()
if(m_remainMark &= <span style="color:#) {
m_diceEdit2 &#43;= <span style="color:#;
m_diceEdit2 &#43;= <span style="color:#;
void Dice::setBetButton3()
if(m_remainMark &= <span style="color:#) {
m_diceEdit3 &#43;= <span style="color:#;
m_diceEdit3 &#43;= <span style="color:#;
void Dice::setBetButton4()
if(m_remainMark &= <span style="color:#) {
m_diceEdit4 &#43;= <span style="color:#;
m_diceEdit4 &#43;= <span style="color:#;
void Dice::dealBetEdit()
showBetMark();
if(m_remainMark &= <span style="color:#) {
m_remainMark --;
remainMarkShow();
void Dice::slotLeave()
GamePlatform *gamePlat = new GamePlatform;
this-&close();
gamePlat-&show();
void Dice::analyzeTime()
if(m_time &= <span style="color:#)
a = m_time % <span style="color:#;
b = m_time / <span style="color:#;
ui-&timeEdit1-&setText(QString::number(b));
ui-&timeEdit2-&setText(QString::number(a));
ui-&timeEdit1-&setText(QString::number(<span style="color:#));
ui-&timeEdit2-&setText(QString::number(m_time));
void Dice::slotShowEdit1()
setBetButton1();
ui-&betEdit1-&setText(QString::number(getBetButton1()));
dealBetEdit();
playMusic(&/image/getShunZhi.wav&);
void Dice::slotShowEdit2()
setBetButton2();
ui-&betEdit2-&setText(QString::number(getBetButton2()));
dealBetEdit();
playMusic(&/image/getBaoZhi.wav&);
void Dice::slotShowEdit3()
setBetButton3();
ui-&betEdit3-&setText(QString::number(getBetButton3()));
dealBetEdit();
playMusic(&/image/getBig.wav&);
void Dice::slotShowEdit4()
setBetButton4();
ui-&betEdit4-&setText(QString::number(getBetButton4()));
dealBetEdit();
playMusic(&/image/getSmall.wav&);
void Dice::setCurrentMark()
if(m_currentDiceNumberOne == m_currentDiceNumberTwo && m_currentDiceNumberOne == m_currentDiceNumberThree && (m_currentDiceNumberOne &#43; m_currentDiceNumberTwo &#43;m_currentDiceNumberThree) &<span style="color:# ) {
m_currentMark = <span style="color:# * ui-&betEdit2-&text().toInt() &#43; ui-&betEdit3-&text().toInt();
m_remainMark &#43;= m_currentMark;
} else if (m_currentDiceNumberOne == m_currentDiceNumberTwo && m_currentDiceNumberOne == m_currentDiceNumberThree && (m_currentDiceNumberOne &#43; m_currentDiceNumberTwo &#43;m_currentDiceNumberThree) &= <span style="color:#) {
m_currentMark = <span style="color:# * ui-&betEdit2-&text().toInt() &#43; ui-&betEdit4-&text().toInt();
m_remainMark &#43;= m_currentMark;
} else if ((m_currentDiceNumberTwo == m_currentDiceNumberOne &#43; <span style="color:# && m_currentDiceNumberTwo == m_currentDiceNumberThree &#43;<span style="color:#) ||(m_currentDiceNumberTwo == m_currentDiceNumberOne &#43; <span style="color:# && m_currentDiceNumberTwo == m_currentDiceNumberThree &#43;<span style="color:#) ||(m_currentDiceNumberThree == m_currentDiceNumberTwo &#43; <span style="color:# && m_currentDiceNumberThree == m_currentDiceNumberOne &#43;<span style="color:#) ||(m_currentDiceNumberThree == m_currentDiceNumberOne &#43; <span style="color:# && m_currentDiceNumberThree == m_currentDiceNumberTwo &#43;<span style="color:#) || (m_currentDiceNumberOne == m_currentDiceNumberTwo &#43; <span style="color:# && m_currentDiceNumberOne == m_currentDiceNumberThree &#43;<span style="color:#) || (m_currentDiceNumberOne == m_currentDiceNumberTwo &#43; <span style="color:# && m_currentDiceNumberOne == m_currentDiceNumberThree &#43;<span style="color:#) && (m_currentDiceNumberOne &#43; m_currentDiceNumberTwo &#43;m_currentDiceNumberThree) &= <span style="color:#) {
m_currentMark = <span style="color:# * ui-&betEdit1-&text().toInt() &#43; ui-&betEdit3-&text().toInt();
m_remainMark &#43;= m_currentMark;
} else if ((m_currentDiceNumberTwo == m_currentDiceNumberOne &#43; <span style="color:# && m_currentDiceNumberTwo == m_currentDiceNumberThree &#43;<span style="color:#) ||(m_currentDiceNumberTwo == m_currentDiceNumberOne &#43; <span style="color:# && m_currentDiceNumberTwo == m_currentDiceNumberThree &#43;<span style="color:#) ||(m_currentDiceNumberThree == m_currentDiceNumberTwo &#43; <span style="color:# && m_currentDiceNumberThree == m_currentDiceNumberOne &#43;<span style="color:#) ||(m_currentDiceNumberThree == m_currentDiceNumberOne &#43; <span style="color:# && m_currentDiceNumberThree == m_currentDiceNumberTwo &#43;<span style="color:#) || (m_currentDiceNumberOne == m_currentDiceNumberTwo &#43; <span style="color:# && m_currentDiceNumberOne == m_currentDiceNumberThree &#43;<span style="color:#) || (m_currentDiceNumberOne == m_currentDiceNumberTwo &#43; <span style="color:# && m_currentDiceNumberOne == m_currentDiceNumberThree &#43;<span style="color:#) && (m_currentDiceNumberOne &#43; m_currentDiceNumberTwo &#43;m_currentDiceNumberThree) & <span style="color:#) {
m_currentMark = <span style="color:# * ui-&betEdit1-&text().toInt() &#43; ui-&betEdit4-&text().toInt();
m_remainMark &#43;= m_currentMark;
} else if ((m_currentDiceNumberOne &#43; m_currentDiceNumberTwo &#43;m_currentDiceNumberThree) & <span style="color:#) {
m_currentMark = ui-&betEdit3-&text().toInt();
m_remainMark &#43;= m_currentMark;
} else if ((m_currentDiceNumberOne &#43; m_currentDiceNumberTwo &#43;m_currentDiceNumberThree) &= <span style="color:#) {
m_currentMark = ui-&betEdit4-&text().toInt();
m_remainMark &#43;= m_currentMark;
int Dice::getCurrentMark()
return m_currentMark;
void Dice::showCurrentMark()
ui-&getMarkEdit-&setText(QString::number(getCurrentMark()));
ui-&remainMarkEdit-&setText(QString::number(m_remainMark));
int Dice::getBetButton1()
return m_diceEdit1;
int Dice::getBetButton2()
return m_diceEdit2;
int Dice::getBetButton3()
return m_diceEdit3;
int Dice::getBetButton4()
return m_diceEdit4;
void Dice::setBetMark()
m_betMark = ui-&betEdit1-&text().toInt() &#43; ui-&betEdit2-&text().toInt() &#43; ui-&betEdit3-&text().toInt() &#43; ui-&betEdit4-&text().toInt() ;
int Dice::getBetMark()
return m_betMark;
void Dice::showBetMark()
setBetMark();
ui-&currentMarkEdit-&setText(QString::number(getBetMark()));
void Dice::remainMarkShow()
ui-&remainMarkEdit-&setText(QString::number(getRemainMark()));
void Dice::initDiceEdit()
ui-&betEdit1-&setText(QLatin1String(&0&));
ui-&betEdit2-&setText(QLatin1String(&0&));
ui-&betEdit3-&setText(QLatin1String(&0&));
ui-&betEdit4-&setText(QLatin1String(&0&));
ui-&getMarkEdit-&setText(QLatin1String(&0&));
ui-&currentMarkEdit-&setText(QLatin1String(&0&));
ui-&remainMarkEdit-&setText(QLatin1String(&0&));
void Dice::initGetMark()
ui-&betEdit1-&setText(QLatin1String(&0&));
ui-&betEdit2-&setText(QLatin1String(&0&));
ui-&betEdit3-&setText(QLatin1String(&0&));
ui-&betEdit4-&setText(QLatin1String(&0&));
ui-&currentMarkEdit-&setText(QLatin1String(&0&));
m_diceOne = <span style="color:#;
m_diceTwo = <span style="color:#;
m_diceThree = <span style="color:#;
m_currentDiceNumberOne = <span style="color:#;
m_currentDiceNumberTwo = <span style="color:#;
m_currentDiceNumberThree = <span style="color:#;
m_currentMark = <span style="color:#;
m_diceEdit1 = <span style="color:#;
m_diceEdit2 = <span style="color:#;
m_diceEdit3 = <span style="color:#;
m_diceEdit4 = <span style="color:#;
ui-&timeEdit1-&setText(QString::number(<span style="color:#));
ui-&timeEdit2-&setText(QString::number(<span style="color:#));
m_time = <span style="color:#;
static int diceTime = <span style="color:#;
void Dice::slotDiceOne()
t= QTime::currentTime();
qsrand(t.msec()&#43;t.second()*<span style="color:#00);
int n = qrand()%<span style="color:#0;
if(diceTime % <span style="color:# == <span style="color:#)
m_time &#43;&#43;;
diceTime = <span style="color:#;
analyzeTime();
m_diceOne &#43;= n;
m_currentDiceNumberOne = m_diceOne%<span style="color:#;
showDiceOne(m_currentDiceNumberOne &#43; <span style="color:#);
if(m_diceOne &= <span style="color:#00)
m_startTimer-&stop();
qDebug() && &(test) the dice is :& &&m_currentDiceNumberOne &#43; <span style="color:#
&& m_currentDiceNumberTwo &#43; <span style="color:# &&
m_currentDiceNumberThree &#43; <span style="color:#;
if(<span style="color:# == m_currentDiceNumberOne &#43; <span style="color:#) {
playMusic(&/image/1.wav&);
} else if (<span style="color:# == m_currentDiceNumberOne &#43; <span style="color:#) {
playMusic(&/image/2.wav&);
} else if (<span style="color:# == m_currentDiceNumberOne &#43; <span style="color:#) {
playMusic(&/image/3.wav&);
} else if (<span style="color:# == m_currentDiceNumberOne &#43; <span style="color:#) {
playMusic(&/image/4.wav&);
} else if (<span style="color:# == m_currentDiceNumberOne &#43; <span style="color:#) {
playMusic(&/image/5.wav&);
} else if (<span style="color:# == m_currentDiceNumberOne &#43; <span style="color:#) {
playMusic(&/image/6.wav&);
Q_EMIT oneAudioPlay();
diceTime &#43;&#43;;
qDebug() && &the diceOne is:& && m_diceOne;
void Dice::slotTimerOneStart()
m_TimerOne-&start(<span style="color:#00);
void Dice::slotTimerTwoStart()
m_TimerTwo-&start(<span style="color:#00);
void Dice::slotTimerThreeStart()
m_TimerThree-&start(<span style="color:#00);
int static timerOne = <span style="color:#;
void Dice::slotTimerOne()
if(timerOne % <span style="color:# == <span style="color:#)
m_TimerOne-&stop();
qDebug() && &the timer one is:& && m_currentDiceNumberTwo &#43; <span style="color:#;
if(<span style="color:# == m_currentDiceNumberTwo &#43; <span style="color:#) {
playMusic(&/image/1.wav&);
} else if (<span style="color:# == m_currentDiceNumberTwo &#43; <span style="color:#) {
playMusic(&/image/2.wav&);
} else if (<span style="color:# == m_currentDiceNumberTwo &#43; <span style="color:#) {
playMusic(&/image/3.wav&);
} else if (<span style="color:# == m_currentDiceNumberTwo &#43; <span style="color:#) {
playMusic(&/image/4.wav&);
} else if (<span style="color:# == m_currentDiceNumberTwo &#43; <span style="color:#) {
playMusic(&/image/5.wav&);
} else if (<span style="color:# == m_currentDiceNumberTwo &#43; <span style="color:#) {
playMusic(&/image/6.wav&);
Q_EMIT twoAudioPlay();
timerOne &#43;&#43;;
int static timerTwo = <span style="color:#;
void Dice::slotTimerTwo()
if(timerTwo % <span style="color:# == <span style="color:#)
m_TimerTwo-&stop();
qDebug() && &the timer two is:& && m_currentDiceNumberThree &#43; <span style="color:#;
if(<span style="color:# == m_currentDiceNumberThree &#43; <span style="color:#) {
playMusic(&/image/1.wav&);
} else if (<span style="color:# == m_currentDiceNumberThree &#43; <span style="color:#) {
playMusic(&/image/2.wav&);
} else if (<span style="color:# == m_currentDiceNumberThree &#43; <span style="color:#) {
playMusic(&/image/3.wav&);
} else if (<span style="color:# == m_currentDiceNumberThree &#43; <span style="color:#) {
playMusic(&/image/4.wav&);
} else if (<span style="color:# == m_currentDiceNumberThree &#43; <span style="color:#) {
playMusic(&/image/5.wav&);
} else if (<span style="color:# == m_currentDiceNumberThree &#43; <span style="color:#) {
playMusic(&/image/6.wav&);
Q_EMIT threeAudioPlay();
timerTwo &#43;&#43;;
int static timerThree = <span style="color:#;
void Dice::slotTimerThree()
if(timerThree % <span style="color:# == <span style="color:#)
m_TimerThree-&stop();
qDebug() && &the sum is:& && m_currentDiceNumberOne &#43; m_currentDiceNumberTwo &#43; m_currentDiceNumberThree &#43; <span style="color:#;
if(m_currentDiceNumberOne &#43; m_currentDiceNumberTwo &#43; m_currentDiceNumberThree &#43;<span style="color:# &<span style="color:#)
playMusic(&/image/big.wav&);
} else if (m_currentDiceNumberOne &#43; m_currentDiceNumberTwo &#43; m_currentDiceNumberThree &#43; <span style="color:# &= <span style="color:#) {
playMusic(&/image/small.wav&);
setCurrentMark();
showCurrentMark();
initGetMark();
timerThree &#43;&#43;;
void Dice::playMusic(QString musicPath)
#ifdef GAME_DABAO
QString dir=QCoreApplication ::applicationDirPath();
QString filename(dir &#43; musicPath);
QSound::play ( filename );
qDebug() && &this is test&&&
QSound::play(&:& &#43; musicPath);
void Dice::slotDiceTwo()
t= QTime::currentTime();
qsrand(t.msec()&#43;t.second()*<span style="color:#00);
int n = qrand()%<span style="color:#0;
m_diceTwo &#43;= n;
m_currentDiceNumberTwo = m_diceTwo%<span style="color:#;
showDiceTwo(m_currentDiceNumberTwo &#43; <span style="color:#);
void Dice::slotDiceThree()
t= QTime::currentTime();
qsrand(t.msec()&#43;t.second()*<span style="color:#00);
int n = qrand()%<span style="color:#0;
m_diceThree &#43;= n;
m_currentDiceNumberThree = m_diceThree%<span style="color:#;
showDiceThree(m_currentDiceNumberThree &#43; <span style="color:#);
void Dice::initDiceOne()
ui-&diceButton1-&hide();
ui-&diceButton2-&hide();
ui-&diceButton3-&hide();
ui-&diceButton4-&hide();
ui-&diceButton5-&hide();
ui-&diceButton6-&hide();
void Dice::initDiceTwo()
ui-&diceButtonTwo1-&hide();
ui-&diceButtonTwo2-&hide();
ui-&diceButtonTwo3-&hide();
ui-&diceButtonTwo4-&hide();
ui-&diceButtonTwo5-&hide();
ui-&diceButtonTwo6-&hide();
void Dice::initDiceThree()
ui-&diceButtonThree1-&hide();
ui-&diceButtonThree2-&hide();
ui-&diceButtonThree3-&hide();
ui-&diceButtonThree4-&hide();
ui-&diceButtonThree5-&hide();
ui-&diceButtonThree6-&hide();
void Dice::slotRemainShow()
ui-&remainMarkEdit-&setText(QString::number(getRemainMark()));
void Dice::slotTimerStart()
m_startTimer-&start(<span style="color:#0);
playMusic(&/image/diceBack.wav&);
void Dice::slotTimerStop()
m_startTimer-&stop();
void Dice::showDiceOne(int diceOne)
if (<span style="color:# == diceOne)
initDiceOne();
ui-&diceButton1-&show();
} else if (<span style="color:# == diceOne) {
initDiceOne();
ui-&diceButton2-&show();
} else if (<span style="color:# == diceOne) {
initDiceOne();
ui-&diceButton3-&show();
} else if (<span style="color:# == diceOne) {
initDiceOne();
ui-&diceButton4-&show();
} else if (<span style="color:# == diceOne) {
initDiceOne();
ui-&diceButton5-&show();
} else if (<span style="color:# == diceOne) {
initDiceOne();
ui-&diceButton6-&show();
void Dice::showDiceTwo(int diceTwo)
if (<span style="color:# == diceTwo)
initDiceTwo();
ui-&diceButtonTwo1-&show();
} else if (<span style="color:# == diceTwo) {
initDiceTwo();
ui-&diceButtonTwo2-&show();
} else if (<span style="color:# == diceTwo) {
initDiceTwo();
ui-&diceButtonTwo3-&show();
} else if (<span style="color:# == diceTwo) {
initDiceTwo();
ui-&diceButtonTwo4-&show();
} else if (<span style="color:# == diceTwo) {
initDiceTwo();
ui-&diceButtonTwo5-&show();
} else if (<span style="color:# == diceTwo) {
initDiceTwo();
ui-&diceButtonTwo6-&show();
void Dice::showDiceThree(int diceThree)
if (<span style="color:# == diceThree)
initDiceThree();
ui-&diceButtonThree1-&show();
} else if (<span style="color:# == diceThree) {
initDiceThree();
ui-&diceButtonThree2-&show();
} else if (<span style="color:# == diceThree) {
initDiceThree();
ui-&diceButtonThree3-&show();
} else if (<span style="color:# == diceThree) {
initDiceThree();
ui-&diceButtonThree4-&show();
} else if (<span style="color:# == diceThree) {
initDiceThree();
ui-&diceButtonThree5-&show();
} else if (<span style="color:# == diceThree) {
initDiceThree();
ui-&diceButtonThree6-&show();
&&相关文章推荐
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:80387次
积分:1676
积分:1676
排名:千里之外
原创:86篇
评论:20条
(1)(1)(1)(17)(18)(11)(27)(7)(2)(3)(1)

我要回帖

更多关于 万兽之王游戏 的文章

 

随机推荐