Home > Back-end >  Lianliankan VC code
Lianliankan VC code

Time:10-01

Void CZLLKView: : OnMenuFirst ()
{
//TODO: Add your command handler code here
Int I, j;
Int temprand;
CString str;
CRect the rect.
//generated random sequence
Srand ((unsigned) time (NULL));
For (I=1; I<=ROW_NUMBER; I++)
For (j=1; J<=LINE_NUMBER; J++)
{
While (1)
{
Temprand=rand () % 15;//generated random number from 0 to 14
If (pic_number [temprand] <6)
{
Pic_number [temprand] + +;
Llk_map [I] [j]. State=0;
Llk_map [I] [j]. Journal of event=0;
Llk_map [I] [j]. Journal of PicIndex=temprand + 1;//1-15
break;
}
}
}
//list each picture all the location of the
ListPicPlace ();
//initialize event
InitEvent ();
G_userscore=0;
G_userlevel=1;
G_usergate=1;
//process control
Bingame=true;
Bfirst=true;

DrawRectangleHollow ();
M_nUpper=0;
DrawProgress (m_nUpper);//a total of 400 time
M_nSpeed=2;
The SetTimer (1120, 0, 0);
DrawInfo (120, 20, "rest");
DrawInfo (20, 20, "heavy columns:");
DrawInfo (20, 40, "tip:");
DrawInfo (540, 20, "score:");
DrawInfo2 (60, 20, m_sortnumber);
DrawInfo2 (40, 60 m_tishinumber);
DrawInfo2 (560, 40, g_userscore);

DrawMap ();
//sound
//if (m_soundeffect)
//PlaySound (MAKEINTRESOURCE (IDR_WAVE_NEWGAME), AfxGetResourceHandle (), SND_RESOURCE | SND_ASYNC);
}
Void CZLLKView: : DrawMap ()
{
//output graphics
The CDC * pDc.
PDc=GetDC ();
The CDC dcMemory;
DcMemory. CreateCompatibleDC (pDc);
DcMemory. SelectObject (& amp; Bitmap1);
Int I, j;
For (I=1; I<=ROW_NUMBER; I++)
{
For (j=1; J<=LINE_NUMBER; J++)
{
If (llk_map [I] [j] PicIndex> 0)
{
If (llk_map [I] [j]. State==0)
PDc - & gt; BitBlt (tilex (j), tiley (I),
PIC_WIDTH, PIC_HEIGHT, & amp; DcMemory PIC_WIDTH * (llk_map [j]. [I] PicIndex - 1), 0, SRCCOPY);

}
}
}
}


Void CZLLKView: : OnMenuExit ()
{
//TODO: Add your command handler code here
The PostQuitMessage (0);
}

CodePudding user response:

The effect of don't know
  • Related