投稿日 | : 2002/11/27(Wed) 00:38 |
投稿者 | : 回転 |
Eメール | : |
URL | : |
タイトル | : スロットマシーン |
スロットマシーンで停止ボタンを押したら急に止めずに速度をおとしてゆっくり
止めるにはどうすれば良いのでしょうか。
cmdStartはコマンドのスタート、cmdStopはコマンドのストップ、
timTimerはタイマー、picSlotはピクチャーのコントロール配列(0〜2)、
imgSlotはイメージのコントロール配列(0〜9)です。
↓のコードで一応スロットはできるんですが、速度を落として止められません。
Dim cnt As Integer
Private Sub cmdStart_Click()
timTimer = True
End Sub
Private Sub cmdStop_Click()
Dim osoi As Integer
timTimer.Interval = 500
picSlot(0).Picture = imgSlot(cnt).Picture
picSlot(1).Picture = imgSlot(cnt + 1).Picture
picSlot(2).Picture = imgSlot(cnt + 2).Picture
cnt = cnt + 1
If cnt = 8 Then
cnt = 0
End If
osoi = osoi + 1
If osoi = 4 Then
timTimer.Enabled = False
End If
End Sub
Private Sub timTimer_Timer()
picSlot(0).Picture = imgSlot(cnt).Picture
picSlot(1).Picture = imgSlot(cnt + 1).Picture
picSlot(2).Picture = imgSlot(cnt + 2).Picture
cnt = cnt + 1
If cnt = 8 Then
cnt = 0
End If
End Sub