Pages vues depuis 25/07/2007 : 25 272 630
Index du forum »» Création-Développement »» Hollywood 5.0
/****************************************************************
**?????????????????????????????????????????????????????????????**
**?Name:????????BeastScroll????????????????????????????????????**
**?Author:??????Andreas?Falkenhahn?????????????????????????????**
**?Version:?????1.0????????????????????????????????????????????**
**?Date:????????05.02.12???????????????????????????????????????**
**?Interpreter:?Hollywood?5.0??????????????????????????????????**
**?Licence:?????Sample?program?for?Hollywood???????????????????**
**?Function:????Demonstrates?the?new?hardware?accelerated??????**
**??????????????double?buffer?in?Hollywood?5.0?????????????????**
**?????????????????????????????????????????????????????????????**
**?Notes:???????Based?on?code?by?Frederic?Cordier??????????????**
**?????????????????????????????????????????????????????????????**
**?History:????????????????????????????????????????????????????**
**?????????????????????????????????????????????????????????????**
**?1.0:?(05.02.12)?????????????????????????????????????????????**
**?????????????????????????????????????????????????????????????**
**?-?initial?release???????????????????????????????????????????**
**?????????????????????????????????????????????????????????????**
****************************************************************/
/*
**?Important!?Check?if?the?used?Hollywood?version?is?at?least
**?version?5.0!
*/
@VERSION?5,0
@SCREEN?{mode="ask",width=640,?Height=480}
/*
**?some?external?data
*/
@BRUSH?1,?"gfx/bgd1_ciel.jpg",?{Hardware?=?True}
@BRUSH?2,?"gfx/bgd2_montagnes.jpg",?{Hardware?=?True}
@BRUSH?3,?"gfx/bgd3_sol1.jpg",?{Hardware?=?True}
@BRUSH?4,?"gfx/bgd4_sol2.jpg",?{Hardware?=?True}
@BRUSH?5,?"gfx/bgd5_sol3.jpg",?{Hardware?=?True}
@BRUSH?6,?"gfx/sprite_nuages1.bmp",?{Transparency?=?0,?Hardware?=?True}
@BRUSH?7,?"gfx/sprite_nuages2.bmp",?{Transparency?=?0,?Hardware?=?True}
@BRUSH?8,?"gfx/sprite_nuages3.bmp",?{Transparency?=?0,?Hardware?=?True}
@BRUSH?9,?"gfx/sprite_nuages4.bmp",?{Transparency?=?0,?Hardware?=?True}
@BRUSH?10,?"gfx/sprite_barriere.bmp",?{Transparency?=?0,?Hardware?=?True}
@BRUSH?11,?"gfx/fireworks.bmp",?{Transparency?=?0,?Hardware?=?True}
@BRUSH?12,?"gfx/sprite_arbre.bmp",?{Transparency?=?0,?Hardware?=?True}
@BRUSH?13,?"gfx/scrolltext.bmp",?{Transparency?=?0,?Hardware?=?True}
@MUSIC?1,?"mus/b-title.mod"
xspeed?=?2
xscroll5?=?Rnd(640)?+?640
xscroll5b?=?Rnd(640)?+?640
/*
**?update?the?screen
*/
Function?p_Update()
????StartTimer(1)
????;?adapt?scroll?values
????xscroll?=?xscroll?+?xspeed
????If?xscroll?=?320?Then?xspeed?=?-2
??????If?xscroll?=?-960?Then?xspeed?=?2
??????
??????xscrollb?=?xscroll
??????If?xscrollb?-640?Then?xscrollb?=?-640
??????If?xscrollb?>?0?Then?xscrollb?=?0
??
??????xscroll1?=?xscroll1?-?1
??????If?xscroll1?=?-640?Then?xscroll1?=?0
??
??????xscroll2?=?xscroll2?-?2
??????If?xscroll2?=?-640?Then?xscroll2?=?0
??
??????xscroll3?=?xscroll3?-?3
??????If?xscroll3?-640?Then?xscroll3?=?xscroll3?+?640
??
??????xscroll4?=?xscroll4?-?4
??????If?xscroll4?-640?Then?xscroll4?=?xscroll4?+?640
??
??????xscroll5?=?xscroll5?-?5
??????If?xscroll5?-640?Then?xscroll5?=?xscroll5?+?1280
??
??????xscroll5b?=?xscroll5b?-?2
??????If?xscroll5b?-640?Then?xscroll5b?=?xscroll5b?+?1280
??
??????xscroll6?=?xscroll6?-?5
??????If?xscroll6?-640?Then?xscroll6?=?xscroll6?+?640
????;?redraw?the?screen?elements
??????DisplayBrush(1,?0,?0)
??????DisplayBrush(2,?xscroll1,?200)
??????DisplayBrush(2,?xscroll1?+?640,?200)
??????DisplayBrush(3,?xscroll2,?420)
??????DisplayBrush(3,?xscroll2?+?640,?420)
??????DisplayBrush(4,?xscroll3,?430)
??????DisplayBrush(4,?xscroll3?+?640,?430)
??????DisplayBrush(5,?xscroll4,?450)
??????DisplayBrush(5,?xscroll4?+?640,?450)
??????DisplayBrush(10,?xscroll5,?440)
??????DisplayBrush(6,?xscroll6,?0)
??????DisplayBrush(6,?xscroll6?+?640,?0)
??????DisplayBrush(7,?xscroll4,?82)
??????DisplayBrush(7,?xscroll4?+?640,?82)
??????DisplayBrush(8,?xscroll3,?120)
??????DisplayBrush(8,?xscroll3?+?640,?120)
??????DisplayBrush(9,?xscroll2,?138)
??????DisplayBrush(9,?xscroll2?+?640,?138)
??????DisplayBrush(12,?xscroll5b,?140)
??????DisplayBrush(11,?xscrollb,?0)
??????DisplayBrush(13,?xscrollb?+?640,?0)
????;?flip?the?back?buffer?into?view
?????Temps=GetTimer(1)
?????FPS1=?Round((1/Temps)*1000)
TextOut?(350,1,"Nombre?d'image?par?seconde",#BLUE)
TextOut?(586,1,fps1)
????Flip(True)
EndFunction
;?start?music
PlayMusic(1)
;?create?a?hardware?double?buffer
BeginDoubleBuffer(True)
;?call?p_Update()?60?times?per?second
SetInterval(1,?p_Update,?1000\60)
;?main?loop
Repeat
????WaitEvent
Forever