Re: pure miga
Publié : dim. 19/oct./2014 19:02
Debut d'intro, fade in/out/zoom de Pure Beast Demo:
Beast intro
Beast intro
Code : Tout sélectionner
;***********************************************
;Titre :*Amiga_leds
;Auteur : Raven
;Date :18/11/2014
;Heure :10:32:53
;Version Purebasic : PureBasic 5.31 (Windows - x64)
;Version de l'editeur :EPB V2.58
; Libairies necessaire : Aucune
;***********************************************
EnableExplicit
Enumeration
#Amiga
EndEnumeration
Enumeration
#font
EndEnumeration
enumeration
#ligne
#ligne2=1015
#led_rouge=467
#led_rouge_fond=467
#led_verte=467
#led_verte_fond=467
endenumeration
Enumeration
#lecteur
EndEnumeration
;-variables globale
global amiga_posx,amiga_image,affiche_menu,i,amiga_posx,amiga_posy,lecteur,lecteurfin,Ecran,Plein_ecran,image_guru,tempo_guru
global image_led_rouge,image_led_verte,tempo_led_rouge,tempo_led_verte
declare affiche_menu()
declare amiga()
declare guru()
declare led_rouge()
declare led_verte()
amiga_posx=250
amiga_posy =250
;--------------------------------------------------------------
;------------ affichage du menu ---------------------
;--------------------------------------------------------------
Procedure affiche_menu()
If StartDrawing(ScreenOutput())
If KeyboardReleased( #PB_Key_Tab)
If affiche_menu = #True
affiche_menu = #False
Else
affiche_menu = #True
EndIf
EndIf
DrawingMode(#PB_2DDrawing_Transparent)
If affiche_menu = #False
DrawingFont(FontID(#font))
DrawText(20,690,"Pure Miga: ",RGB(255,255,255))
DrawText(20,720,"Amiga Led ",RGB(255,255,255))
Else
EndIf
StopDrawing()
EndIf
EndProcedure
;------------- Procédure Amiga -----------------------------------
Procedure amiga()
amiga_image=catchsprite(#Amiga,?amiga,#PB_Sprite_AlphaBlending)
ZoomSprite(#Amiga,350,350)
DisplayTransparentSprite(#Amiga,amiga_posx/1,amiga_posy/1)
EndProcedure
;------------------------ procédure guru ------------------------------
Procedure guru()
StartDrawing(ScreenOutput())
DrawingMode((#PB_2DDrawing_AlphaBlend ))
DrawingFont(FontID(#font))
DrawText(120,30, "software failure. Press left mouse button to continue", RGB(255,0,0))
DrawText(220,90, "guru meditation #00000004.0000AAC0", RGB(255,0,0))
If image_guru=2:image_guru=0:EndIf
Box(#ligne,10,1024*image_guru,10,RGB(255,0,0))
Box(#ligne,20,10*image_guru,140,RGB(255,0,0))
Box(#ligne,150,1024*image_guru,10,RGB(255,0,0))
Box(#ligne2,20,10*image_guru,140,RGB(255,0,0))
tempo_guru + 1
If tempo_guru = 60
image_guru + 1
tempo_guru = 0
EndIf
StopDrawing()
EndProcedure
;----------- procédure led rouge -----------
procedure led_rouge()
StartDrawing(ScreenOutput())
If image_led_rouge=2:image_led_rouge=0:EndIf
Box(#led_rouge_fond,435,21,5,rgb(155,0,0))
Box(#led_rouge,435,21*image_led_rouge,5,rgb(255,0,0))
tempo_led_rouge + 1
If tempo_led_rouge = 60
image_led_rouge + 1
tempo_led_rouge = 0
EndIf
StopDrawing()
EndProcedure
;---------- procédure led verte ---------
procedure led_verte()
StartDrawing(ScreenOutput())
If image_led_verte=2:image_led_verte=0:EndIf
Box(#led_verte_fond,443,21,5,RGB(50,155,50))
Box(#led_verte,443,21*image_led_verte,5,RGB(Random(50), Random(255), Random(50)))
tempo_led_verte + 1
If tempo_led_verte = 25
image_led_verte + 1
tempo_led_verte = 0
endif
StopDrawing()
endprocedure
;---------------- son lecteur----------------------------
Procedure lecteur()
lecteur=Catchsound(#lecteur,?lecteur,?lecteurfin-?lecteur)
If lecteur
;SoundVolume(0,75)
Playsound(#lecteur)
EndIf
EndProcedure
;----------------------------------------------------------------------------
;- Initialisations
If InitSprite()=0 Or InitKeyboard()=0 Or InitMouse()=0 Or InitSound()=0 Or UseOGGSoundDecoder()=0 or UsePNGImageDecoder()=0
MessageRequester("Problème","Initialisations impossibles",0)
End
EndIf
;-------------------------------------------------------------------------------
;-charge la fonte
LoadFont(#font,"Cooper Black",24,#PB_Font_HighQuality )
;------------------------------------------------------------------------------
;-ouvre une fenetre ou l'openscreen
Ecran= MessageRequester("Pure Miga","Plein écran?",#PB_MessageRequester_YesNo)
If Ecran = #PB_MessageRequester_Yes
Plein_ecran=#True
OpenScreen(1024,768,32,"Pure Miga" )
Else
Plein_ecran=#False
OpenWindow(0,0, 0, 1024 , 768 ,"Pure Miga", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget|#PB_Window_ScreenCentered)
SetWindowPos_(WindowID(0), -1, 0, 0, 0, 0, #SWP_NOSIZE | #SWP_NOMOVE)
OpenWindowedScreen(WindowID(0),0,0, 1024 , 768,32,0,0)
endif
If Plein_ecran = #False
While WindowEvent() : Wend
EndIf
;------------------------------------------------------
;--------------- Boucle Principale --------------
;-----------------------------------------------------
SpriteQuality(#PB_Sprite_BilinearFiltering)
lecteur()
Repeat
;-clavier et souris
ExamineKeyboard()
ExamineMouse()
ClearScreen(0)
amiga()
affiche_menu()
guru()
led_rouge()
led_verte()
FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape)
closescreen()
End
;-Data
DataSection
lecteur:
IncludeBinary "media\lecteur_amiga.ogg"
lecteurfin:
Amiga:
includebinary "media\amiga_sans_leds.png"
enddatasection
; Epb