投稿日 | : 2007/07/25(Wed) 16:35 |
投稿者 | : tea |
Eメール | : |
URL | : |
タイトル | : Re^5: 前回の投稿では解決していませんでした・・・。 |
ふくさん、これさん、回答していただき本当にありがとうございます。
フラグを立てるという方法で試してみましたが実行すると00:00秒後に
ファウルカウントがあった場合に00:01秒と表示されるようになり1歩
前進しました。
しかし、この00:01秒から再開すると00:00秒になった後に次のクォー
ター(2nd)が表示されずに再び00:01秒と表示され再開すると00:00
秒という状態が延々と繰り返されてしまいます・・・。
下記はフラグを追加したコードです。
どうか教えてください。
よろしくお願いします。
'タイマー'
Private Sub tmrCountDown_Timer()
Dim i As Integer
Dim l As Integer
Dim k As Integer
Dim flag As Boolean
'フラグを設置
flag = False
If mp.TimeOutting Then
'' 更新と終了判断。
With vsTimeOut(mp.TimeOutintgTeamIndex)
.Value = .Value - 1
'50秒経過後のブザー'
If .Value = 10 Then
BeepBusy
End If
If .Value <> 0 Then Exit Sub
End With
'' タイムアウトの終了。
'60秒経過後のブザー'
BeepBusy
With mp
.TimeOutting = False
resetTimeOutClock .TimeOutintgTeamIndex
cmdTimeOut(.TimeOutintgTeamIndex).Enabled = Game.Team(.TimeOutintgTeamIndex).CanCurrentQuarterTimeOut
vsTimeOut(.TimeOutintgTeamIndex).Enabled = False
tmrCountDown.Enabled = False
End With
Else
'---オプションボタンで非表示を選択した場合---
If vs24Second.Visible = False Then
'---動作させない---
vs24Second.Enabled = False
Else
'' 更新。
With vs24Second
If 0 < .Value Then
.Value = .Value - 1
End If
'残り5秒から1秒までNBA風にクロック音 '
For i = 1 To 5
If .Value = i Then
Beep7
End If
Next
End With
End If
'ゲームタイムタイマー(カウントダウンタイマー)
With vsGameTime
If 0 < .Value Then
.Value = .Value - 1
End If
End With
'' クオーターの終了。
'' 次のクオーターへ表示を更新して、停止。
If vsGameTime.Value = 0 Then
'counter = counter + 1
BeepBuzzer2
'---ブザービーターに備えて5秒間遅らせる。----
Delay 5000
For l = 0 To 1
For k = 1 To 5
'ゲームメンバーの誰かがファウルカウントされなかった場合
If Game.Team(l).GameMember(k).FoulCount = 0 Then
'時間待機はなし
Delay 0
'ゲームメンバーの誰かが1回だけファウルカウントされた場合
ElseIf Game.Team(l).GameMember(k).FoulCount = 1 Then
'ゲームタイマーに1秒加えて00:01にする。
vsGameTime.Value = 1
'一時停止。
pauseGame
'フラグを立てる。
flag = True
'内側のループ(k)を抜ける。
Exit For
End If
Next k
Next l
'フラグがTrueの場合
If flag = True Then
tmrCountDown.Enabled = False
'時間が0秒になった時
If vsGameTime.Value = 0 Then
'次のクォーターへ移る。
readyNextQuarter
End If
Else
'00:00秒になったらカウントダウンタイマーを停止。
tmrCountDown.Enabled = False
'次のクォーターへ移る。
readyNextQuarter
End If
'' 24 秒の終了。
'' ポーズ。ポーズ再開で、進みます。
ElseIf vs24Second.Value = 0 Then
'---オプションボタンで非表示を選択した場合---
If vs24Second.Visible = False Then
'---動作させない---
vs24Second.Enabled = False
Else
BeepBuzzer
resetShotClock
pauseGame
End If
End If
End If
End Sub