Kein Sound wiederholt

Übersicht BlitzBasic Beginners-Corner

Neue Antwort erstellen

 

Svolf

Betreff: Kein Sound wiederholt

BeitragFr, Apr 14, 2006 15:25
Antworten mit Zitat
Benutzer-Profile anzeigen
Hi Leute,
ich weis nicht an was es liegt. Ich möchte nur das wenn Sound2 zu ende ist, dass er es nochmal spielt also immer. Er spielt Sound2 nur einmal und habe doch loobspund drinne.
hier mein code:

BlitzBasic: [AUSKLAPPEN]
Sound1=LoadSound ("Musik\Holzchopf - Hot Gears.ogg")
Sound2=LoadSound ("Musik\Holzchopf - Trance Syndrome.ogg")
Channel=PlaySound(Sound2)
LoopSound sound2



For Fragen.fragen=Each fragen
Frage = Frage + 1
Timer = MilliSecs()
Color 255,255,255
SetFont Bigfont
For Speed# = 1 To 20 Step 0.1
Timer = MilliSecs()
Moveback(speed#)
Text 320, 190, "Auf zur nächsten Frage...", 1, 1
Text 320, 290, "Frage " + Frage, 1, 1

DrawImage Maus, MouseX(), MouseY()
Repeat
Until MilliSecs() => Timer + 10
Flip
Next
For Speed# = 20 To 1 Step -0.1
Timer = MilliSecs()
Moveback(speed#)
Text 320, 190, "Auf zur nächsten Frage...", 1, 1
Text 320, 290, "Frage " + Frage, 1, 1
DrawImage Maus, MouseX(), MouseY()
Repeat
Until MilliSecs() => Timer + 10
Flip
Next

Repeat
Moveback()
Color 255,255,255
SetFont Bigfont
Text 320, 50, Fragen\Frage1$, 1, 1
Text 320, 100, Fragen\Frage2$, 1, 1

If Drawbutton(Button, Buttonover, 150,240) Then antwort = 1
If Drawbutton(Button, Buttonover, 470,240) Then antwort = 2
If Drawbutton(Button, Buttonover, 150,340) Then antwort = 3
If Drawbutton(Button, Buttonover, 470,340) Then antwort = 4
If Drawbutton(Ende, Endeover, 320-88, 400) Then Antwort = 10
Color 128,0,0
SetFont Smallfont
Text(150,240, Fragen\Antwort1$,1,1)
Text(470,240, Fragen\Antwort2$,1,1)
Text(150,340, Fragen\Antwort3$,1,1)
Text(470,340, Fragen\Antwort4$,1,1)

DrawImage Maus, MouseX(), MouseY()
Flip
Until antwort
SetFont smallfont
If Antwort = 10 Then Exit
If Antwort = Fragen\RiAntwort Then
Color 0,255,0
Punkte = Punkte + 1
Ri = Ri + 1
Timer = MilliSecs()
Repeat
Moveback()
Text 320,190, "Die Antwort war Richtig.", 1, 1
Text 320,290, "Du hast jetzt "+ punkte + " Punkte.", 1, 1
DrawImage Maus, MouseX(), MouseY()
Flip
Until MilliSecs() > timer + 2000
Else
Color 255,0,0
Timer = MilliSecs()
Punkte = Punkte - 1
Fa = Fa + 1
Repeat
Moveback()
Text 320,190, "Die Antwort war Leider Falsch.", 1, 1
Text 320,290, "Du hast jetzt "+ punkte + " Punkte.", 1, 1
DrawImage Maus, MouseX(), MouseY()
Flip
Until MilliSecs() > timer + 2000
End If
antwort = 0
Next
SetFont Smallfont
Color 255,255,255
Repeat
Timer = MilliSecs()
Moveback()
Text 320,50, "Das Spiel ist Vorbei.", 1, 1
Text 320,100, "Du hast insgesammt " + Punkte + " Punkte erreicht,", 1, 1
Text 320,150, "indem du " + ri + " Fragen Richtig beantwortet hast", 1, 1
Text 320,200, "und " + fa + " Fragen falsch.", 1, 1
Text 320,250, "Hoffentlich hat dir das Spiel gefallen.", 1, 1
Text 320,300, "Maustaste drücken, um weiterzukommen.", 1, 1
DrawImage Maus, MouseX(), MouseY()
Repeat
Until MilliSecs() > timer + 10
Flip
Until MouseHit(1)
FreeSound Sound2
StopChannel(kanal)
Channel=PlaySound(Sound1)

Smokie

BeitragFr, Apr 14, 2006 15:56
Antworten mit Zitat
Benutzer-Profile anzeigen
Hi,
lies ma in der Online Hilfe, da steht:
Zitat:
Nach dem Befehl LOOPSOUND muss man nur wieder PLAYSOUND benutzen.


Du musst also noch ein Playsound Sound2 dahinter machen.

Grüße
Smokie
M-Soft Studios Mit selbst gemachtem Forum!!!
Unbequem lebt's sich schwer.
Musik macht erst Spaß, wenn man sie mit 2,8 facher Geschwindigkeit hört
Zuletzt bearbeitet von Smokie am Fr Jan 01, 1888 51:58 PM, insgesamt 1000-mal bearbeitet
 

flohrian

BeitragSa, Apr 15, 2006 12:05
Antworten mit Zitat
Benutzer-Profile anzeigen
loopsound und playsound umgekehrt ->


BlitzBasic: [AUSKLAPPEN]
sound2 = LoadSound ("sound.wav")
[...]
LoopSound (sound2)
channel = PlaySound (sound2)



So müsste es funktionieren...

Neue Antwort erstellen


Übersicht BlitzBasic Beginners-Corner

Gehe zu:

Powered by phpBB © 2001 - 2006, phpBB Group