• 用c++做的一个桌面捕抓游戏

    Invalidate(); UpdateWindow(); CDC *pdc=GetDC(); if(i<=time) { record[t]=10000-i*50; a=rand()%buchang; b=rand()%buchang; if(i==0) pdc->FillSolidRect(x,y,50,50,RGB(255,255,255)); else { if(a%2==0) x=(x+a)%(rc.Width()-50); else x=(x-a)%(rc.Width()-50); if(b%2==0) y=(y+b)%(rc.Height()-50); else y=(y-b)%(rc.Height()-50); if(x<0) x=0; if(y<0) y=0; if(k==0) pdc->FillSolidRect(x,y,50,50,RGB(255,255,255)); else pdc->FillSolidRect(x,y,50,50,RGB(255,0,0)); } } else { KillTimer(1); record[t]=5000-i*50; MessageBox("游戏超时"); CString str; str.Format("%d",record[t]); MessageBox(str); } i++; }

    2
    95
    493B
    2010-12-26
    9
关注 私信
上传资源赚积分or赚钱