Option Explicit
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Public FrmMove As Boolean
Public DragX As Long
Public Dragy As Long
Private Sub Form_Load()
Dim I As Integer
MakeTransparent Me.hwnd, 100
'Ex: all transparent at ratio 140/255
'ActiveTransparency Me, True, False, 140, Me.BackColor
'Ex: Form transparent, visible component at ratio 140/255
'ActiveTransparency Me, True, True, 140, Me.BackColor
'Example display the form transparency degradation
ActiveTransparency Me, True, False, 0
Me.Show
For I = 0 To 255 Step 3
ActiveTransparency Me, True, False, I
Me.Refresh
Next I
Call StopBGM
'Call StopSound
frmVictory.SetFocus
End Sub
Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
tmrCoins.Enabled = True
tmrSP.Enabled = True
End If
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
FrmMove = True
DragX = X
Dragy = Y
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim nx, ny
If FrmMove Then
nx = frmVictory.Left + X - DragX
ny = frmVictory.top + Y - Dragy
frmVictory.Left = nx
frmVictory.top = ny
End If
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim nx, ny
nx = frmVictory.Left + X - DragX
ny = frmVictory.top + Y - Dragy
frmVictory.Left = nx
frmVictory.top = ny
FrmMove = False
End Sub
Private Sub tmrCoins_Timer()
Dim Num As Integer
If GetAsyncKeyState(vbKeyReturn) And tmrCoins.Enabled = True Then
tmrCoins.Enabled = False
frmVictory.Visible = False
Call StopBGS
Call PlayBGM(Map(GetPlayerMap(MyIndex)).Music)
End If
Num = Val(lblCoins.Caption)
If Num <= 0 Then
tmrCoins.Enabled = False
Else
Num = Num - 1
Call PlaySound("MP_Coin.wav.wav")
End If
End Sub
Private Sub tmrSP_Timer()
Dim Num As Integer
If GetAsyncKeyState(vbKeyReturn) And tmrSP.Enabled = True Then
tmrSP.Enabled = False
frmVictory.Visible = False
Call StopBGS
Call PlayBGM(Map(GetPlayerMap(MyIndex)).Music)
End If
Num = Val(lblEXP.Caption)
If Num <= 0 Then
tmrSP.Enabled = False
Else
Num = Num - 1
Call PlaySound("Magic_coin.wav")
End If
End Sub