Na dann schon mal im Vorraus : Happy Halloween
Im Anhang sind die dazugehörigen Bilder und Sounds als .zip Datei. Diese einfach in den Profan-Ordner bzw. Programm-Ordner kopieren.
Code
Declare Long texture[6], ende
Declare String sDateien[3]
WindowTitle "Happy Halloween"
Window 800, 600
sDateien[0] = $ProgDir + "Geist.mp3"
sDateien[1] = $ProgDir + "Hexe.mp3"
texture[0] = Create("hSizedPic", -1, $ProgDir + "Hexe.png", 100, 100, 1)
texture[1] = Create("hSizedPic", -1, $ProgDir + "Geist.png", 50, 50, 1)
texture[2] = Create("hSizedPic", -1, $ProgDir + "Kürbis.png", 50, 50, 1)
texture[3] = Create("hSizedPic", -1, $ProgDir + "Sarg.png", 50, 50, 1)
texture[4] = Create("hSizedPic", -1, $ProgDir + "Grab.png", 50, 50, 1)
texture[5] = Create("hSizedPic", -1, $ProgDir + "Hintergrund.jpg", Width(%HWnd, 1), Height(%HWnd, 1), 1)
texture[6] = Create("hSizedPic", -1, $ProgDir + "Happy.jpeg", 250, 150, 1)
DrawScene()
SoundAktion()
SetTimer 300
ende = 0
WhileNot ende
WaitInput
If %wmTimer
SoundAktion()
EndIf
Case %Key = 2 : ende = 1
EndWhile
Proc DrawScene
DrawPic texture[5], 0, 0; 0
DrawPic texture[0], Width(%HWnd, 1) - 400, 150; - 1
DrawPic texture[1], Width(%HWnd, 1) - 400, 50; - 1
DrawPic texture[2], Width(%HWnd, 1) - 300, 480; - 1
DrawPic texture[3], Width(%HWnd, 1) - 200, 480; -1
DrawPic texture[4], Width(%HWnd, 1) - 100, 480; - 1
DrawPic texture[6], 10, 10; 0
EndProc
Proc SoundAktion
PLAY_MP3(sDateien[1])
PLAY_MP3(sDateien[0])
EndProc
PROC PLAY_MP3
DECLARE ERROR$
PARAMETERS String DATEI
DATEI = "OPEN \q\:DATEI;\q TYPE MPEGVIDEO ALIAS AUDIO"
ERROR$ = MCISend$(DATEI)
ERROR$ = MCISend$("PLAY AUDIO WAIT")
ERROR$ = MCISend$("CLOSE AUDIO")
Case %MCIError: RETURN ERROR$
ENDPROC
KillTimer
End
Alles anzeigen
Schönes Gruseln !