-2
私はゲームに取り組んできました。主なコンポーネントの1つがカウントダウンタイマーですが、このタイマーは遅れてしまい、理由を推測できません。私はそれを1秒に1回減少させたいと思いますが、6秒に一度減っているようです。ここでカウントダウンタイマーは遅れて減少しますか?
は私が設定タイマーを持っているかである:
loops = 0
minute = 1
tens = 0
ones = 0
#Timer Calculation
screen.blit(cloudSky, (0,0))
if go == True:
loops = loops + 1
if (loops % 60)== 0:
if ones == 0 and tens == 0 and minute != 0:
tens = 6
ones = 0
minute = minute - 1
if ones == 0 and tens != 0:
ones = 9
tens = tens - 1
elif ones != 0:
ones = ones - 1
elif tens == 0 and ones == 0:
tens = 5
minute = minute - 1
elif ones == 0 and tens != 0:
tens = tens - 1
if minute <= 0 and tens == 0 and ones == 0:
go = False
私は以下のコードを画面に出力します。すべてのヘルプは大歓迎です
#Draw Clock Time
time = timeFont.render(str (minute)+ ":" + str (tens) + str (ones), True, WHITE)
screen.blit(time, (750,10))
!