易截截图软件、单文件、免安装、纯绿色、仅160KB

qt实现的一个俄罗斯方块的程序 主窗口c文件

//-----------------------------------------------------------------------------------------------------
//BY:yuyongbao
//QQ:673360056
//-----------------------------------------------------------------------------------------------------
#include "tetris.h"
Tetris::Tetris(QWidget *parent)
    : QDialog(parent), ui(new Ui::Tetris)
{
    ui->setupUi(this);
    gameInit();
    this->connect(ui->frame,SIGNAL(scoreChanged(int)),this,SLOT(drawScore(int)));
    this->connect(ui->frame,SIGNAL(nextTetrixChanged()),this,SLOT(nextTetrixChangedProc()));
    this->connect(ui->frame,SIGNAL(gameOver()),this,SLOT(gameEnd()));
}
Tetris::~Tetris()
{
    delete ui;
}
void Tetris::gameInit(void)
{
    m_curScore = 0;
    //总分数以后由文件读入
    m_totalScore = 0;
    m_level = 0;
    m_line = 0;
    m_bStart = FALSE;
    m_mute = FALSE;
    m_nextTetrisPos = QRect(120,160,4*PIXPERRECT,4*PIXPERRECT);
    m_scorePos = QRect(50,200,200,40);
    m_levelPos = QRect(50,240,200,40);
    m_linePos = QRect(50,280,200,40);
    //随机种子
    qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));
    skinPath = "skins/";
}
void Tetris::gameStart(void)
{
     timer = new QTimer(this);
     connect(timer, SIGNAL(timeout()), this, SLOT(timePro()));
     //游戏等级与时间之间的关系
     timer->start(1600 - m_level * 300);
     //产生当前方块和下一个方块
     ui->frame->curShape = (TetrixShape)(qrand()%7);
     ui->frame->nextShape = (TetrixShape)(qrand()%7);
   &n


相关文档:

Pro*C 连接数据库时dbname 的设置

    最近一段时间在研究 Pro*C 遇到了很多初级问题。在 Pro*C 中连接数据库时,我们一般是使用在“tnsnames.ora”中配置好连接,写起来很简单,语法如下:
    EXEC SQL CONNECT :username IDENTIFIED BY :password USING :dbname;
    /* 这里的 dbname 就是在 ......

C/C++ 笔试、面试题目大汇总

1.求下面函数的返回值(微软)
int func(x)
{
    int countx = 0;
    while(x)
    {
          countx ++;
          x = x&(x-1);
   &n ......

C/C++招聘的一些感受和经验

C/C++招聘的一些感受和经验
前段时间刚参加了n多公司的C/C++软件工程师的面试,有国企,外企,私企(moto,飞思卡尔,港湾,中国卫星XXX(这个牛))等等等等。感受感想颇多,近日终于空闲,在此表述一下。
本人基本条件:3年开发经验,2year+ Windows development experence,1year+ Linux experence. 熟悉C,C++,MFC/ ......

C/C++ assert() 函数用法

assert
函数名: assert
功  能: 测试一个条件并可能使程序终止
用  法: void assert(int test);
程序例:
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
struct ITEM {
   int&n ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号