投稿日 | : 2002/11/27(Wed) 11:01 |
投稿者 | : NAO★ |
Eメール | : |
URL | : |
タイトル | : Re: スロットマシーン |
試していないので動かないかもしれませんが、
こんな感じでしょうか?
Dim cnt As Integer
Dim STOP_FALG As Boolean '回転を止めるフラグ
Private Sub cmdStart_Click()
STOP_FALG = False 'フラグをリセット
timTimer.Interval = 500 '通常の回転速度
timTimer = True
End Sub
Private Sub cmdStop_Click()
STOP_FALG = True 'フラグをセット
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
Static osoi As Integer 'Static で宣言
If STOP_FLAG = True then
osoi = osoi + 1
timTimer.Interval = timTimer.Interval + 500 'だんだん遅くする
If osoi = 4 Then
timTimer.Enabled = False
osoi = 0 '次のためにリセット
End If
End If
End Sub