Timer控制要怎麼寫才不會和Keydown衝突,我正在寫一個有背景的射(編號:4867)

Public ManTimeNow As Long '記錄人物之前位置
Public ManTimeAfter As Long '記錄人物之後位置
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyUp
ManTimeAfter = ManTimeNow
ManTimeNow = ManTimeNow - 40
If ManTimeNow >= 200 Then
LoadPic 0, 40, ManTimeAfter
Else
ManTimeNow = ManTimeNow + 40
End If
Case vbKeyDown
ManTimeAfter = ManTimeNow
ManTimeNow = ManTimeNow + 40
If ManTimeNow <= 360 Then
LoadPic 0, 40, ManTimeAfter
Else
ManTimeNow = ManTimeNow - 40
End If
End Select
LoadPic 4, 40, ManTimeAfter
LoadPic 0, 40, ManTimeNow
Form1.PicFkLoad1.Refresh
End Sub
Private Sub Form_Load()
BkData0
BkData1
BkData2
BkData3
ManTimeNow = 280
LoadPic 0, 40, 280 '野狼隊人初值位置
LoadPic 0, 80, 440 '啄木鳥等待
Form1.PicFkLoad1.Refresh
End Sub
Private Sub Timer1_Timer()
v
End Sub
----------------------------
.bas'LoadPic函數功能: 動畫畫面更新顯示於PicFkLoad1.Image
'方法 :(背景暫存頁數,X坐標,Y坐標)
'用Form1.PicFkLoad1.Refresh可一次顯示
Public Function LoadPic(SelectPic As Integer, ByVal ArugnX As Long, ByVal ArugnY As Long)
'代入引數
PicX = ArugnX
PicY = ArugnY
PicSelect = SelectPic
'選擇圖形出現位置
Select Case PicSelect
Case 0 '動物和人物的背景讀取至前景區PicFkLoad0
BitBlt Form1.PicFkLoad0.hdc, 0, 0, PicX + 40, PicY + 40, Form1.PicBkSave0.hdc, PicX, PicY, vbSrcCopy
   
Case 1 '子彈移動和石頭火燄的背景讀取至前景區PicFkLoad0
BitBlt Form1.PicFkLoad0.hdc, 0, 0, PicX + 40, PicY + 40, Form1.PicBkSave1.hdc, PicX, PicY, vbSrcCopy
    
Case 2 '子彈爆炸和人物死亡背景讀取至前景區PicFkLoad0
BitBlt Form1.PicFkLoad0.hdc, 0, 0, PicX + 40, PicY + 40, Form1.PicBkSave2.hdc, PicX, PicY, vbSrcCopy
    
Case 3 '雙方道具背景讀取至前景區PicFkLoad0
BitBlt Form1.PicFkLoad0.hdc, 0, 0, PicX + 40, PicY + 40, Form1.PicBkSave3.hdc, PicX, PicY, vbSrcCopy
   
Case 4 '消除出現圖形,PicBkSave4為一完整初始背景
BitBlt Form1.PicFkLoad0.hdc, 0, 0, PicX + 40, PicY + 40, Form1.PicBkSave4.hdc, PicX, PicY, vbSrcCopy
    
End Select
'讀取本次出現圖形和是否消除上次出現圖形
Form1.PicFkLoad0.Refresh
'PicFkLoad1為畫面上真正的前景
BitBlt Form1.PicFkLoad1.hdc, PicX, PicY, 40, 40, Form1.PicFkLoad0.hdc, 0, 0, vbSrcCopy
'回傳新引數
ArugnX = PicX
ArugnY = PicY
SelectPic = PicSelect
End Function
Public Sub v()
bnew1 = 40 * Int(5 * Rnd + 3)
bnew2 = 40 * Int(5 * Rnd + 3)
bnew3 = 40 * Int(5 * Rnd + 3)
bnew4 = 40 * Int(5 * Rnd + 3)
bnew5 = 40 * Int(5 * Rnd + 3)
tp1 = 440
tp2 = 440
tp3 = 440
tp4 = 440
tp5 = 440
'1(x,440)顯示
LoadPic 0, bnew1, tp1
Form1.PicFkLoad1.Refresh
'1(x,440)清除
LoadPic 4, bnew1, tp1
Form1.PicFkLoad1.Refresh
'1(x,400),2(x,440)顯示
tp1 = tp1 - 40
LoadPic 0, bnew1, tp1
LoadPic 0, bnew2, tp2
Form1.PicFkLoad1.Refresh
'1(x,400),2(x,440)清除
LoadPic 4, bnew1, tp1
LoadPic 4, bnew2, tp2
Form1.PicFkLoad1.Refresh
'1(x,360),2(x,400),3(x,440)顯示
tp1 = tp1 - 40
tp2 = tp2 - 40
LoadPic 0, bnew1, tp1
LoadPic 0, bnew2, tp2
LoadPic 0, bnew3, tp3
Form1.PicFkLoad1.Refresh
'1(x,360),2(x,400),3(x,440)清除
LoadPic 4, bnew1, tp1
LoadPic 4, bnew2, tp2
LoadPic 4, bnew3, tp3
Form1.PicFkLoad1.Refresh
'1(x,320),2(x,360),3(x,400),4(x,440)顯示
tp1 = tp1 - 40
tp2 = tp2 - 40
tp3 = tp3 - 40
LoadPic 0, bnew1, tp1
LoadPic 0, bnew2, tp2
LoadPic 0, bnew3, tp3
LoadPic 0, bnew4, tp4
Form1.PicFkLoad1.Refresh
'1(x,320),2(x,360),3(x,400),4(x,440)清除
LoadPic 4, bnew1, tp1
LoadPic 4, bnew2, tp2
LoadPic 4, bnew3, tp3
LoadPic 4, bnew4, tp4
Form1.PicFkLoad1.Refresh
'1(x,280),2(x,320),3(x,360),4(x,400),5(x,440)顯示
tp1 = tp1 - 40
tp2 = tp2 - 40
tp3 = tp3 - 40
tp4 = tp4 - 40
LoadPic 0, bnew1, tp1
LoadPic 0, bnew2, tp2
LoadPic 0, bnew3, tp3
LoadPic 0, bnew4, tp4
LoadPic 0, bnew5, tp5
Form1.PicFkLoad1.Refresh
'1(x,280),2(x,320),3(x,360),4(x,400),5(x,440)清除
LoadPic 4, bnew1, tp1
LoadPic 4, bnew2, tp2
LoadPic 4, bnew3, tp3
LoadPic 4, bnew4, tp4
LoadPic 4, bnew5, tp5
Form1.PicFkLoad1.Refresh
'1(x,240),2(x,280),3(x,320),4(x,360),5(x,400)顯示
tp1 = tp1 - 40
tp2 = tp2 - 40
tp3 = tp3 - 40
tp4 = tp4 - 40
tp5 = tp5 - 40
LoadPic 0, bnew1, tp1
LoadPic 0, bnew2, tp2
LoadPic 0, bnew3, tp3
LoadPic 0, bnew4, tp4
LoadPic 0, bnew5, tp5
Form1.PicFkLoad1.Refresh
'1(x,240),2(x,280),3(x,320),4(x,360),5(x,400)清除
LoadPic 4, bnew1, tp1
LoadPic 4, bnew2, tp2
LoadPic 4, bnew3, tp3
LoadPic 4, bnew4, tp4
LoadPic 4, bnew5, tp5
Form1.PicFkLoad1.Refresh
'1(x,200),2(x,240),3(x,280),4(x,320),5(x,360)顯示
tp1 = tp1 - 40
tp2 = tp2 - 40
tp3 = tp3 - 40
tp4 = tp4 - 40
tp5 = tp5 - 40
LoadPic 0, bnew1, tp1
LoadPic 0, bnew2, tp2
LoadPic 0, bnew3, tp3
LoadPic 0, bnew4, tp4
LoadPic 0, bnew5, tp5
Form1.PicFkLoad1.Refresh
'1(x,200),2(x,240),3(x,280),4(x,320),5(x,360)清除
LoadPic 4, bnew1, tp1
LoadPic 4, bnew2, tp2
LoadPic 4, bnew3, tp3
LoadPic 4, bnew4, tp4
LoadPic 4, bnew5, tp5
Form1.PicFkLoad1.Refresh
'1(x,160),2(x,200),3(x,240),4(x,280),5(x,320)顯示
tp1 = tp1 - 40
tp2 = tp2 - 40
tp3 = tp3 - 40
tp4 = tp4 - 40
tp5 = tp5 - 40
LoadPic 0, bnew1, tp1
LoadPic 0, bnew2, tp2
LoadPic 0, bnew3, tp3
LoadPic 0, bnew4, tp4
LoadPic 0, bnew5, tp5
Form1.PicFkLoad1.Refresh
'1(x,160),2(x,200),3(x,240),4(x,280),5(x,320)清除
LoadPic 4, bnew1, tp1
LoadPic 4, bnew2, tp2
LoadPic 4, bnew3, tp3
LoadPic 4, bnew4, tp4
LoadPic 4, bnew5, tp5
Form1.PicFkLoad1.Refresh
End Sub