資源描述:
《掃雷程序設(shè)計(jì)》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在工程資料-天天文庫(kù)。
1、OptionExplicit'標(biāo)題欄21'確定TOP=70'取消TOP=31'LEFT=123'按鈕大小60*24'文本框大小38*18'文本框高度765431'Left=72PrivateSubForm_Load()Text1(0).Text=MHeightText1(1).Text=MWidthText1(2).Text=MinesRemoveMenuLineMe.hWnd,5EndSubPrivateSubOKButton_Click()LetMHeight=Text1(0).TextIfMHeig
2、ht<9ThenLetMHeight=9IfMHeight>24ThenLetMHeight=24LetMWidth=Text1(1).TextIfMWidth<9ThenLetMWidth=9IfMWidth>30ThenLetMWidth=30LetMines=Text1(2).TextIfMines<10ThenLetMines=10IfMines>(MHeight-1)*(MWidth-1)ThenLetMines=(MHeight-1)*(MWidth-1)FrmMain.ClsFrmMain.
3、GameStart'開(kāi)始UnloadMeEndSubPrivateSubCancelButton_Click()UnloadMeEndSubPrivateSubText1_KeyPress(IndexAsInteger,KeyAsciiAsInteger)If(KeyAscii<48OrKeyAscii>57)AndKeyAscii<>8ThenKeyAscii=0EndSub'PrivateSubHotKey(IndexAsInteger)'Text1(Index).SetFocus'Text1(Ind
4、ex).SelStart=0'Text1(Index).SelLength=Len(Text1(Index).Text)'EndSub''PrivateSubLabel1_Click()'HotKey0'EndSub''PrivateSubLabel2_Click()'HotKey1'EndSub''PrivateSubLabel3_Click()'HotKey2'EndSubOptionExplicitPrivateConstvbGray=&H848284'灰色PrivateConstMLeftAsLo
5、ng=180'雷區(qū)距離左側(cè)(按Twips計(jì)算)PrivateConstMTopAsLong=825'雷區(qū)距離上部PrivateConstWAVE_DEFAULT=432'默認(rèn)聲音PrivateConstWAVE_VICTORY=433'失敗聲音PrivateConstWAVE_LOST=434'勝利聲音PrivateConstBMP_GRID_WIDTH=16'格子的寬PrivateConstBMP_GRID_HEIGHT=16'格子的高PrivateConstBMP_NUM_WIDTH=13'數(shù)字的寬P
6、rivateConstBMP_NUM_HEIGHT=23'數(shù)字的高PrivateConstBMP_NUM_TOP=16'數(shù)字距離上邊(菜單底)PrivateConstBMP_NUM_MINE_LEFT=17'計(jì)數(shù)器距離左側(cè)PrivateConstBMP_NUM_TIME_RIGHT=BMP_NUM_WIDTH*3+20'計(jì)時(shí)器左側(cè)距離窗體右側(cè)PrivateConstBMP_FACE_WIDTH=24'表情的寬PrivateConstBMP_FACE_HEIGHT=24'表情的高PrivateConstBM
7、P_FACE_TOP=16'表情距離上邊(菜單底)PrivateCanPeeperAsBoolean'作弊'初級(jí)9/9/10'中級(jí)16/16/40'高級(jí)30/16/99'PrivateNoMineAsBooleanPrivateSubInithDC()DimIAsLongDimhBmpAsStdPicture'從資源讀取游戲圖片F(xiàn)orI=0To2'不用PictureBoxSethBmp=LoadResPicture(IIf(MnuCheck(1).Checked,410,411)+I*10,vbResBi
8、tmap)LethBmpDC(I)=CreateCompatibleDC(Me.hdc)CallSelectObject(hBmpDC(I),hBmp.Handle)SethBmp=NothingNextEndSubPublicSubGameStart()'游戲開(kāi)始'NoMine=FalseLetMe.Width=MLeft+(MWidth*16+8+GetMePixelWidth-Me.ScaleWidth)*Screen.