Timerlösung mit grafischen Fonts!
Übersicht
BlitzBasic
Beginners-Corner
|
Gast
Betreff: Timerlösung mit grafischen Fonts!
|
Mi, Jun 01, 2005 11:19
Antworten mit Zitat
|
Hi!
Ich hab nen Timer (MM:SS) in mein Game gebaut der sich je nach Wert
der vergangenen Zeit den Frame wechselt. Ich hab ihn mehr oder weniger
zum laufen gebracht, allerdings gefällt mir weder der Codeaufbau
noch das der Zehnerzähler beim wechsel (also wenn er auf FB2+1 schaltet)
alle Fontzahlen durch geht!
Der Code is wie folgt:
BlitzBasic: [AUSKLAPPEN] [EINKLAPPEN]
Zeit1 = MilliSecs()
Function Zeitmessung() Zeit2 = MilliSecs () SZ = (Zeit1 - Zeit2) / (-1000) SZZ = (Zeit1 - Zeit2) / (-10000) SZM = SZ / 60 SZM2 = SZ / 600
If sz Mod 10 = 0 Then FB = 16 If sz Mod 10 = 1 Then FB = 17 If sz Mod 10 = 2 Then FB = 18 If sz Mod 10 = 3 Then FB = 19 If sz Mod 10 = 4 Then FB = 20 If sz Mod 10 = 5 Then FB = 21 If sz Mod 10 = 6 Then FB = 22 If sz Mod 10 = 7 Then FB = 23 If sz Mod 10 = 8 Then FB = 24 If sz Mod 10 = 9 Then FB = 25 DrawImage Font,980,35,FB
If sz Mod 10 = 9 If MilliSecs() > szztimer + 1000 FB2 = FB2 + 1 If FB2 = 22 Then FB2 = 16 EndIf EndIf DrawImage Font,940,35,FB2
If szm Mod 10 = 0 Then FB3 = 16 If szm Mod 10 = 1 Then FB3 = 17 If szm Mod 10 = 2 Then FB3 = 18 If szm Mod 10 = 3 Then FB3 = 19 If szm Mod 10 = 4 Then FB3 = 20 If szm Mod 10 = 5 Then FB3 = 21 If szm Mod 10 = 6 Then FB3 = 22 If szm Mod 10 = 7 Then FB3 = 23 If szm Mod 10 = 8 Then FB3 = 24 If szm Mod 10 = 9 Then FB3 = 25 DrawImage Font,860,35,FB3
If szm2 Mod 10 = 0 Then FB4 = 16 If szm2 Mod 10 = 1 Then FB4 = 17 If szm2 Mod 10 = 2 Then FB4 = 18 If szm2 Mod 10 = 3 Then FB4 = 19 If szm2 Mod 10 = 4 Then FB4 = 20 If szm2 Mod 10 = 5 Then FB4 = 21 If szm2 Mod 10 = 6 Then FB4 = 22 If szm2 Mod 10 = 7 Then FB4 = 23 If szm2 Mod 10 = 8 Then FB4 = 24 If szm2 Mod 10 = 9 Then FB4 = 25 DrawImage Font,820,35,FB4
End Function
Habt ihr ne bessere Lösung für mich! Ich komm einfach nicht
dahinter solang ich auch drüber nachdenke!
MFG Damien X
|
|
|
|
Mi, Jun 01, 2005 11:32
Antworten mit Zitat
|
Vielleicht so??
BlitzBasic: [AUSKLAPPEN] [EINKLAPPEN]
Zeit1 = MilliSecs()
Function Zeitmessung() Zeit2 = MilliSecs () SZ = (Zeit1 - Zeit2) / (-1000) SZZ = (Zeit1 - Zeit2) / (-10000) SZM = SZ / 60 SZM2 = SZ / 600
FB = 16+(sz Mod 10) DrawImage Font,980,35,FB
If sz Mod 10 = 9 If MilliSecs() > szztimer + 1000 FB2 = FB2 + 1 If FB2 = 22 Then FB2 = 16 EndIf EndIf DrawImage Font,940,35,FB2
FB3 = 16+(szm Mod 10) DrawImage Font,860,35,FB3
FB4 = 16+(szm2 Mod 10) DrawImage Font,820,35,FB4
End Function
|
|
|
Gast
|
Mi, Jun 01, 2005 11:46
Antworten mit Zitat
|
Kanns jetzt nich ausprobieren! Allerdings ist der Code
besser! Und müsste nach "MEINER" Logik funcen!
Das ich da nicht drauf gekommen bin! Wieder mal n Brett forn Kopp ^^!
Danke schon mal!
MFG Damien X
|
|
Übersicht
BlitzBasic
Beginners-Corner
Powered by phpBB © 2001 - 2006, phpBB Group