



下載本文檔
版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領
文檔簡介
1、Dim c As Integer '記錄已打死蚊子個數(shù)Dim r As IntegerDim f As Integer ' 標記蚊子飛行方向Dim s As Integer ' 倒計時秒數(shù)Dim b As IntegerSub init()'f = 1's = 60Image1.Left = -700End SubPrivate Sub Form_Load()f = 1s = 60b = 0Image1.Enabled = TrueImage2.Enabled = FalseImage2.Visible = FalseTimer2.Enabled = F
2、alseWith Image1 .Left = 0 .Top = 3000End WithWith Image2 .Left = form1.Width .Top = 3000End With Timer1.Interval = 50Timer2.Interval = 50RandomizeEnd SubPrivate Sub Image1_Click()Image1.Visible = FalseWith Image1 .Left = 0 .Top = 3000End WithWith Image2 .Left = form1.Width .Top = 3000End WithTimer1.
3、Enabled = TrueTimer2.Enabled = Falsec = c + 1Label4.Caption = cf = 1End SubPrivate Sub Image2_Click()Image2.Visible = Falsef = 1With Image1 .Left = 0 .Top = 3000 .Height = 700 .Width = 700End WithWith Image2 .Left = form1.Width .Top = 3000 .Height = 700 .Width = 700End WithTimer1.Enabled = TrueTimer
4、2.Enabled = Falsec = c + 1Label4.Caption = cEnd SubPrivate Sub Timer1_Timer() '控制向右飛If f = 2 Then Image2.Enabled = False Image2.Visible = False Image1.Enabled = True Image1.Visible = True Image1.Top = Image2.Top Image1.Left = Image2.Left Image1.Height = Image2.Height - 50 Image1.Width = Image2.W
5、idth - 50 End Iff = 1Image1.Visible = TrueIf Image1.Left < (form1.ScaleWidth - Image1.Width) Then Image1.Left = Image1.Left + 100 r = Int(Rnd * 2) + 1) Select Case r Case 1: Image1.Top = Image1.Top + 100 Case 2: Image1.Top = Image1.Top - 100 End SelectEnd If If Image1.Left >= (form1.ScaleWidth
6、 - Image1.Width) Then Timer1.Enabled = False Timer2.Enabled = TrueEnd If End SubPrivate Sub Timer2_Timer() '控制向左飛If f = 1 Then Image1.Enabled = False Image1.Visible = False Image2.Enabled = True Image2.Visible = True Image2.Top = Image1.Top Image2.Left = Image1.Left Image2.Height = Image1.Height
7、 - 50 Image2.Width = Image1.Width - 50End Iff = 2Image2.Enabled = TrueIf Image2.Left > 0 Then Image2.Left = Image2.Left - 100 r = Int(Rnd * 2) + 1) Select Case r Case 1: Image2.Top = Image1.Top + 100 Case 2: Image2.Top = Image1.Top - 100 End SelectEnd IfIf Image2.Left <= 0 Then Timer2.Enabled = False Timer1.Enabled = TrueEnd If End SubPrivate Sub Timer3_Timer() '倒計時s = s - 1Label2.Caption = sIf s < 0 Then If c >= 20 Then MsgBox "恭喜你完成任務!", 0, "結(jié)果" Timer1.Enabled = False Timer2.Enabled = False Timer3.Enabled = False Else MsgBox "對不起
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 基于選區(qū)激光熔化技術的AlSi10Mg金屬粉腔結(jié)構(gòu)成形方法與性能研究
- 閩江水口庫區(qū)水環(huán)境演變模擬及低氧改善研究
- 2025年中國室內(nèi)外智能球型云臺市場調(diào)查研究報告
- 2025年中國套管座市場調(diào)查研究報告
- 2025年中國剛玉石市場調(diào)查研究報告
- 2025年中國儀表裝配流水線市場調(diào)查研究報告
- 制服訂單合同范本
- 2025年中國人參首烏精口服液市場調(diào)查研究報告
- 2025年中國絲杠傳動剪壁升降臺市場調(diào)查研究報告
- 2025年中國三格環(huán)保紙餐盒市場調(diào)查研究報告
- 自動駕駛數(shù)據(jù)安全白皮書
- 工期定額-民用建筑
- 黃土地質(zhì)災害類型及其危害性評估
- 交際德語教程第二版A1Studio[21] 課后習題參考答案
- 最新修改 班組安全管理建設--5831模式通用課件
- 氣割、電氣焊作業(yè)的應急救援預案
- 2018年柴油機大修工程量單
- 超級精美PPT模版美國經(jīng)典ppt模板(通用珍藏版2)
- 中醫(yī)內(nèi)科方歌-八
- 氣動控制閥的定義分類及工作原理詳解
- 梯形練字格A4紙打印版
評論
0/150
提交評論