cette espece de Fanatisme concernant les bouffeurs de trucs pas bon ( le forum anglophone )
Code : Tout sélectionner
Structure oliv
angle.f
long_text_bas.l
xt.l
yt.l
text.s
cr.w
cv.w
cb.w
EndStructure
Global Dim oliv.oliv(1)
Declare Ondulation(x,Y,Texte.s,r,v,b)
; ***** variables a OLIV *********
; Variables
#HauteurSin = 25 ; Coef qui joue sur la hauteur de la sinusoide
#LargeurSin = 50 ; Coef qui joue sur la largeur de la sinusoide
#VitesseAngle = 1 * #PI / 50 ; vitesse de modification de l'angle de départ du texte
#Vitesse = 50 ; Temps du Delay() qui ralentit/augmente l'animation.
#font =1
#font2=2
; ****************************************
; ********* tunel a SPH ***************
dw.w=320
dh.w=200
dw2.w=dw/2
dh2.w=dh/2
dkx.f=0
ff.f=0
ffm.f=ff.f
t0.f=Random(400)/10
tt0.f=0.001+Random(400)/1000000
t1.f=Random(400)/10
tt1.f=0.001+Random(400)/1000000
t2.f=Random(400)/10
tt2.f=0.001+Random(400)/1000000
t3.f=Random(400)/10
tt3.f=0.001+Random(400)/1000000
ra0=dw2/4
ra1=dh2/4
t01.f=t0.f
t11.f=t1.f
t21.f=t2.f
t31.f=t3.f
; ************************************
Structure dobro_fumee
angle.l
amplitude.f
Texte.s
pas.f
i.f
Vitesse.f
a.f
artichaut.f
artison.f
ss.f
coul.w
x.l
EndStructure
Dim dobro_fumee.dobro_fumee(1)
Structure dobro_titre
angle.l
x.l
amplitude.l
EndStructure
Dim dobro_titre.dobro_titre(1)
dobro_titre(1)\angle=0
dobro_titre(1)\amplitude=2
dobro_titre(1)\x=0
Structure balle_bleue
x.l
Y.l
xpas.l
ypas.l
EndStructure
Dim balle_bleue. balle_bleue(1)
; ********************* Star Field *************************
SSum.w = 8000 ; Amount of Stars
Cspeed.f=1
CameraZ.f=0
Gosub InitStarField
; ********************************************************
; **************************** Raster a Comtois **************************
;-Préparation Raster
Structure s_Raster
CentreX.l
CentreY.l
Vitesse.f
angle.f
amplitude.l
pas.f
Fond.l
Sprite.l[30]
EndStructure
Structure s_Texte
Texte.s
depx.l
depy.l
x.l
Y.l
mx.l
my.l
EndStructure
; ****************************************************************
Global angle1,amplitude
Global amplitude1=2
Texte.s="PUREBASIC 4.10"
Buffer$=Space(128)
mciSendString_("open 5.MID type sequencer alias mid",Buffer$,128,0)
mciSendString_("play mid",0,0,0)
InitSprite() ; Initialise les sprites
InitKeyboard() ; Initialise le clavier
LoadFont ( #font , "Arial" ,40)
LoadFont(#font2, "arial", 20 ,#PB_Font_Italic )
#sprite_balle_bleue=1 ; on donne un numero au sprite
#sprite_raster=1000
#sprite_tonton=2000
#titre=3000
#sprite_tunel=5000
depx=4 ; deplacement horizontal
depy=4 ; deplacement vertical
etx=0
ety=0
passsx=5
passsy=5
yex=2
yey=2
passsx1=6
passsy1=6
yex1=2
yey1=2
passsx2=2
passsy2=2
yex2=2
yey2=2
bpas=1
rotm.f
depmx.f
depmy.f
depmx1.f
depmy1.f
acc.f=0
depmx=200
depmy=200
Dim tableau(1500)
Dim tableau2(1500)
X1_m.f:Y1_m.f:posi_m.f:a_m.f
emp_m = -10 ; amplitude de depart
negampli_m = -70 ; amplitude inferieur
posampli_m = 70 ; amplitude superieur
decomp_m = 4 ; vitesse
z_m = 0
posi_m = 1
limite_m = posi_m * 80
zoomm = 400
If ExamineDesktops() ; Liste les bureaux
Width = DesktopWidth(0) ; Largeur actuelle
Height = DesktopHeight(0) ; Hauteur actuelle
Depth = DesktopDepth(0) ; Profondeur de couleurs actuelle
CentreX=Width/2
Rien$ = "BERNARD 13" ; Titre de l'application à B13
; *********** Creation de la balle Bleue **************************
;- creation balle bleue
If OpenScreen(Width, Height, Depth, "Intro") ; Ouvre l'écran
CreateSprite(#sprite_balle_bleue,64,64) ; on cree un sprite de 32 par 32
StartDrawing(SpriteOutput(#sprite_balle_bleue)) ; on va dessiner dedans !!
Circle(32,32,32,RGB(0,0,155)) ; un rond bleu
Circle(33,31,25,RGB(0,0,180)) ; un rond bleu
Circle(34,30,20,RGB(0,0,200)) ; un rond bleu
Circle(36,28,17,RGB(0,0,225)) ; un rond bleu
Circle(38,26,15,RGB(0,0,245)) ; un rond bleu
Circle(40,24,10,RGB(0,0,255)) ; un rond bleu
Circle(42,22,4,RGB(255,255,255)) ; un rond bleu
StopDrawing() ; voila notre sprite est pret !! :D
; on va pouvoir l'apeler par son nom !! (#sprite)
balle_bleue(1)\xpas=10 ; ceci va determiner le sens du sprite pour les X et sa vitesse de deplacement
balle_bleue(1)\ypas=10; ceci va determiner le sens du sprite pour les Y et sa vitesse de deplacement
; **********************************************************
;-creation boules a Tonton
; ************ creation d'un boule pour les boules a tonton *****************
CreateSprite(#sprite_tonton,64,64) ; on cree un sprite de 32 par 32
StartDrawing(SpriteOutput(#sprite_tonton)) ; on va dessiner dedans !!
Circle(30,32, 20 ,RGB(150,50,50))
Circle(32,30, 16 ,RGB(170,70,70))
Circle(34,28, 12 ,RGB(190,90,90))
Circle(38,26, 4 ,RGB(250,250,250))
StopDrawing() ; voila notre sprite est pret !! :D
; *******************************************************
;-creation boules pour Tunel a SPH
; ************ creation d'un boule pour les boules a tonton *****************
CreateSprite(#sprite_tunel,8,8) ; on cree un sprite de 8 par 8
StartDrawing(SpriteOutput(#sprite_tunel)) ; on va dessiner dedans !!
Circle(4,4, 4, RGB($A5,$1,$A0))
Circle(4,4, 3 ,RGB($F0,$0,$DE))
Circle(4,4, 2 ,RGB($FE,$76,$F0))
Circle(4,4, 1 ,RGB(250,250,250))
StopDrawing() ; voila notre sprite est pret !! :D
; *******************************************************
;- creation sprite pour le titre
; *********** Creation du sprite pour le titre **************************
StartDrawing( ScreenOutput()) ; on va dessiner dans une image reperé "100"
FrontColor(RGB($0,$FF,$FF)) ; couleur d'ecriture
BackColor(RGB(0, 0, 0)) ; couleur de fond
DrawingFont(FontID(#font2))
DrawingMode(1)
DrawText(0,0,Texte.s) ; on ecrit "PUREBASIC 4.10" dedans notre image
StopDrawing()
; ceci va lire l'image ligne par ligne et recreer autant d'image qu'il y a de ligne !!
For t=0 To 50
GrabSprite(#titre+t, 0, t, 250, 1) ; voila on prend un ligne et on en fait une image d'une ligne de large 1 pixel de haut
Next t ; on a un bon stock de ligne la :D 101 pour etre exact :)
; ******************************************************************
;- préparation Raster a Comtois
; ****************** Raster a Comtois **********************
Declare DeplaceTexte(*T.s_Texte)
Global Raster.s_Raster
Define.s_Texte TexteRaster
With TexteRaster
\Texte = "Comtois"
\depx = 2
\depy = 2
\x = Width/2
\Y = Height/2
\mx = Width
\my = Height
EndWith
Raster\Fond = CreateSprite(#PB_Any,480,480)
StartDrawing(SpriteOutput(Raster\Fond))
For l=0 To 479
Restore Couleur
For i = 0 To 479
Read coul
Plot(l,i,coul)
Next i
Next l
StopDrawing()
With Raster
UseBuffer(\Fond)
For i = 0 To 29
\Sprite[i] = GrabSprite(#PB_Any, i * 8, i* 16, 240 - i * 8, 16)
Next
UseBuffer(-1)
FreeSprite(\Fond)
\CentreX = (Width - SpriteWidth(\Sprite[0])) / 2
\CentreY = (Height - SpriteHeight(\Sprite[0])) / 2
\Vitesse = 6
\angle = 0
\amplitude = 120
\pas = 3.8
EndWith
; ***************************************************
; **** Buckethead dotball *******
too.l = 0
yC.c = 220
; ********************
Repeat ; Boucle
ExamineKeyboard() ; Scanne l'état du clavier
StartDrawing(ScreenOutput()) ; Démarre le dessin dans le buffer
; ************** Star Field ***************************
Gosub DrawStarField
Gosub MoveCamera
; *************************************************
;-affiche le text Bernard 13
DrawText((Width/2 - TextWidth(Rien$)/2)+a, (Height/2 - TextHeight(Rien$)/2)+b, "BERNARD 13", $FFFFFF, $000000) ; Dessine
a+depx ;on deplace la position du texte sur l horizontal
b+depy ;on deplace la position du texte sur la vertical
If (Width/2 - TextWidth(Rien$)/2)+a>Width-TextWidth(Rien$) ;si le texte depasse la largeure de l' écran
depx=-depx ;on inverse le pas horizontal en négatif
EndIf
If (Width/2 - TextWidth(Rien$)/2)+a<0 ;si le texte depasse a gauche de l' écran
depx=-depx ;on inverse le pas horizontal en positif
EndIf
If (Height/2 - TextHeight(Rien$)/2)+b>Height-TextHeight(Rien$);si le texte depasse la hauteur de l' écran
depy=-depy ;on inverse le pas vertical en negatif
EndIf
If (Height/2 - TextHeight(Rien$)/2)+b<0 ;si le texte depasse en base de l' écran
depy=-depy ;on inverse le pas vertical en positif
EndIf
;-------------debut spectre------------
avx+passsx*veroux
avy+passsy*verouy
yyex=yex*veroux
yyey=yey*verouy
varix=Random(100)
variy=Random(100)
varix1=Random(100)
variy1=Random(100)
varix2=Random(100)
variy2=Random(100)
If avx>Width-150 Or avx<0 Or varix=50
passsx=-passsx
veroux=1
verouy=0
yex=-yex
EndIf
If avy>Height-150 Or avy<0 Or variy=50
passsy=-passsy
veroux=0
verouy=1
yey=-yey
EndIf
avx0=avx
avy0=avy
yyex0=yyex
yyey0=yyey
coul=$0000FF
Gosub spectre
avx1+passsx1*veroux1
avy1+passsy1*verouy1
yyex1=yex1*veroux1
yyey1=yey1*verouy1
If avx1>Width-150 Or avx1<0 Or varix1=50
passsx1=-passsx1
veroux1=1
verouy1=0
yex1=-yex1
EndIf
If avy1>Height-150 Or avy1<0 Or variy1=50
passsy1=-passsy1
veroux1=0
verouy1=1
yey1=-yey1
EndIf
avx0=avx1
avy0=avy1
yyex0=yyex1
yyey0=yyey1
coul=$FF0000
Gosub spectre
avx2+passsx2*veroux2
avy2+passsy2*verouy2
yyex2=yex2*veroux2
yyey2=yey2*verouy2
If avx2>Width-150 Or avx2<0 Or varix2=50
passsx2=-passsx2
veroux2=1
verouy2=0
yex2=-yex2
EndIf
If avy2>Height-150 Or avy2<0 Or variy2=50
passsy2=-passsy2
veroux2=0
verouy2=1
yey2=-yey2
EndIf
avx0=avx2
avy0=avy2
yyex0=yyex2
yyey0=yyey2
coul=$00FF00
Gosub spectre
;--------------fin spetcre--------------
;debut pacman
Circle(100+deppac, 100, 25 ,RGB(250,255,00))
bo+bpas
deppac+5
If deppac>1300
deppac=0
EndIf
If bo>10 Or bo<0
bpas=-bpas
EndIf
If bo=0
bo1=0: bo2=0: bo3=0: bo4=0: bo5=0: bo6=0: bo7=0: bo8=0: bo9=0: bo10=0
EndIf
If bo=1
bo1=1: bo2=0: bo3=0: bo4=0: bo5=0: bo6=0: bo7=0: bo8=0: bo9=0: bo10=0
EndIf
If bo=2
bo1=1: bo2=1: bo3=0: bo4=0: bo5=0: bo6=0: bo7=0: bo8=0: bo9=0: bo10=0
EndIf
If bo=3
bo1=1: bo2=1: bo3=1: bo4=0: bo5=0: bo6=0: bo7=0: bo8=0: bo9=0: bo10=0
EndIf
If bo=4
bo1=1: bo2=1: bo3=1: bo4=1: bo5=0: bo6=0: bo7=0: bo8=0: bo9=0: bo10=0
EndIf
If bo=5
bo1=1: bo2=1: bo3=1: bo4=1: bo5=1: bo6=0: bo7=0: bo8=0: bo9=0: bo10=0
EndIf
If bo=6
bo1=1: bo2=1: bo3=1: bo4=1: bo5=1: bo6=1: bo7=0: bo8=0: bo9=0: bo10=0
EndIf
If bo=7
bo1=1: bo2=1: bo3=1: bo4=1: bo5=1 :bo6=1: bo7=1: bo8=0: bo9=0: bo10=0
EndIf
If bo=8
bo1=1: bo2=1: bo3=1: bo4=1: bo5=1: bo6=1: bo7=1: bo8=1: bo9=0: bo10=0
EndIf
If bo=9
bo1=1: bo2=1: bo3=1: bo4=1: bo5=1: bo6=1: bo7=1: bo8=1: bo9=1: bo10=0
EndIf
If bo=10
bo1=1: bo2=1: bo3=1: bo4=1: bo5=1: bo6=1: bo7=1: bo8=1: bo9=1: bo10=0
EndIf
LineXY(100*bo1+deppac,100*bo1,125*bo1+deppac,100*bo1,RGB(0,0,0))
LineXY(100*bo1+deppac,100*bo1,125*bo1+deppac,101*bo1,RGB(0,0,0))
LineXY(100*bo2+deppac,100*bo2,125*bo2+deppac,99*bo2,RGB(0,0,0))
LineXY(100*bo2+deppac,100*bo2,125*bo2+deppac,102*bo2,RGB(0,0,0))
LineXY(100*bo3+deppac,100*bo3,125*bo3+deppac,98*bo3,RGB(0,0,0))
LineXY(100*bo3+deppac,100*bo3,125*bo3+deppac,103*bo3,RGB(0,0,0))
LineXY(100*bo4+deppac,100*bo4,125*bo4+deppac,97*bo4,RGB(0,0,0))
LineXY(100*bo4+deppac,100*bo4,125*bo4+deppac,104*bo4,RGB(0,0,0))
LineXY(100*bo5+deppac,100*bo5,125*bo5+deppac,96*bo5,RGB(0,0,0))
LineXY(100*bo5+deppac,100*bo5,125*bo5+deppac,105*bo5,RGB(0,0,0))
LineXY(100*bo6+deppac,100*bo6,125*bo6+deppac,95*bo6,RGB(0,0,0))
LineXY(100*bo6+deppac,100*bo6,125*bo6+deppac,106*bo6,RGB(0,0,0))
LineXY(100*bo7+deppac,100*bo7,125*bo7+deppac,94*bo7,RGB(0,0,0))
LineXY(100*bo7+deppac,100*bo7,125*bo7+deppac,107*bo7,RGB(0,0,0))
LineXY(100*bo8+deppac,100*bo8,125*bo8+deppac,93*bo8,RGB(0,0,0))
LineXY(100*bo8+deppac,100*bo8,125*bo8+deppac,108*bo8,RGB(0,0,0))
LineXY(100*bo9+deppac,100*bo9,125*bo9+deppac,92*bo9,RGB(0,0,0))
LineXY(100*bo9+deppac,100*bo9,125*bo9+deppac,109*bo9,RGB(0,0,0))
LineXY(100*bo10+deppac,100*bo10,125*bo10+deppac,91*bo10,RGB(0,0,0))
LineXY(100*bo10+deppac,100*bo10,125*bo10+deppac,110*bo10,RGB(0,0,0))
;fin pacman
;--------------------- mine storm
If Random(30)=1
gau=1
dro=0
EndIf
If Random(30)=2
gau=0
dro=1
EndIf
If gau=1
rotm-0.1
Else
rotm+0.1
EndIf
If Random(100)>35
acc+0.05
If acc>5
acc=5
EndIf
depmx=depmx-Sin(rotm)*acc*acc
depmy=depmy+Cos(rotm)*acc*acc
rotm1.f=rotm
push0=1
Else
acc-0.05
depmx=depmx-Sin(rotm1)*acc*acc
depmy=depmy+Cos(rotm1)*acc*acc
push0=0
EndIf
If acc<0
acc=0
EndIf
posxm1=0
posym1=15
posxm2=10
posym2=-15
posxm3=0
posym3=-10
posxm4=-10
posym4=-15
posxm5=0
posym5=-12
posxm6=0
posym6=-40
posxm7=-5
posym7=-38
posxm8=5
posym8=-38
cosrot.f=Cos(rotm)
sinrot.f=Sin(rotm)
ixm1=cosrot * posxm1 - sinrot * posym1
iym1=sinrot * posxm1 + cosrot * posym1
ixm2=cosrot * posxm2 - sinrot * posym2
iym2=sinrot * posxm2 + cosrot * posym2
ixm3=cosrot * posxm3 - sinrot * posym3
iym3=sinrot * posxm3 + cosrot * posym3
ixm4=cosrot * posxm4 - sinrot * posym4
iym4=sinrot * posxm4 + cosrot * posym4
If depmx>Width
depmx=0
EndIf
If depmy>Height
depmy=0
EndIf
If depmx<0
depmx=Width
EndIf
If depmy<0
depmy=Height
EndIf
LineXY(ixm1+depmx,iym1+depmy,ixm2+depmx,iym2+depmy,RGB(255,255,255))
LineXY(ixm2+depmx,iym2+depmy,ixm3+depmx,iym3+depmy,RGB(255,255,255))
LineXY(ixm3+depmx,iym3+depmy,ixm4+depmx,iym4+depmy,RGB(255,255,255))
LineXY(ixm4+depmx,iym4+depmy,ixm1+depmx,iym1+depmy,RGB(255,255,255))
If push0=1
If Random(1)=1
ixm5=cosrot * posxm5 - sinrot * posym5
iym5=sinrot* posxm5 + cosrot * posym5
ixm6=cosrot * posxm6 - sinrot * posym6
iym6=sinrot * posxm6 + cosrot * posym6
ixm7=cosrot * posxm7 - sinrot * posym7
iym7=sinrot * posxm7 + cosrot * posym7
ixm8=cosrot * posxm8 - sinrot * posym8
iym8=sinrot * posxm8 + cosrot * posym8
LineXY(ixm5+depmx,iym5+depmy,ixm6+depmx,iym6+depmy,RGB(255,255,255))
LineXY(ixm5+depmx,iym5+depmy,ixm7+depmx,iym7+depmy,RGB(255,255,255))
LineXY(ixm5+depmx,iym5+depmy,ixm8+depmx,iym8+depmy,RGB(255,255,255))
EndIf
EndIf
;---------- fin mine storm ---------------------
;----------- courbe math --------------
prem_m = 0
x_m = 150
y_m = 500
a_m = 0
X1_m = -150
Y1_m = -150
emp_m + decomp_m
If emp_m > posampli_m Or emp_m < negampli_m
decomp_m = -decomp_m
EndIf
For i_m = 1 To 1000
tableau(i_m) = 1000
tableau2(i_m) = 0
Next
While a_m < limite_m
If prem_m = 0 Or tableau2(x_m) < y_m + z_m
tableau2(x_m) = y_m + z_m
EndIf
If tableau(x_m) >= y_m + z_m
tableau(x_m) = y_m + z_m
EndIf
x_m + 1
X1_m + 0.5
z1_m = (Cos((Sqr((X1_m * X1_m) / zoomm + (Y1_m * Y1_m) / zoomm)))) * emp_m
z_m = z1_m
If x_m < 760 + a_m
If y_m + z_m < tableau(x_m) Or y_m + z_m > tableau2(x_m) ; test les points à afficher
Plot(x_m, y_m + z_m, RGB( 0 , 255 , 255))
EndIf
Else
prem_m = 1
x_m = 150
X1_m = -150
Y1_m + 3.8
a_m + posi_m
y_m - 2
x_m + a_m
EndIf
Wend
;--------------------------------------------------------------------
;Moi RV et mon pixel blanc
Plot(10,10,RGB(255,255,255)) ; un point aux coordonnées 10,10 (coin en haut a gauche) de couleur rgb(255,255,255) blanc donc
; dotball ------------------------
too+1
ol.f = 100 - Abs(140 * Sin(too / 12))
zoom.f = 3 + Sin(ol / 1024 + too / 128)
aa.f = too / 40
xC = Width/2 + 128 * Sin(aa)
koa.f = Cos(aa)
sia.f = Sin(aa)
For u = 0 To 2500
uu.f = u / 200
co.f = Cos(u)
x.f = co * Cos(uu)
Y.f = co * Sin(uu)
z.f = Sin(u)
yy.f = Y * koa - z * sia
zz.f = Y * sia + z * koa
xxx.f = x * koa + zz * sia
zzz.f = zz * koa - x * sia
co = 128 + zzz * 64
If zzz > 0
Plot(256 * (xxx / (zzz + zoom)) + xC,256 * (yy / (zzz + zoom)) + yC + ol,RGB(co / 4,co / 2,co))
Else
Plot(256 * (xxx / (zzz + zoom)) + xC,256 * (yy / (zzz + zoom))+ yC + ol,RGB(co * 2,co / 2,co))
EndIf
Next u
; ------------------------------- / Dotball
StopDrawing() ; C'est fini
; on va tester si le sprite va sortir de l'ecran
; et fabriquer un rebond par inversion de la coordonée au cas ou ...
balle_bleue(1)\x=balle_bleue(1)\x + balle_bleue(1)\xpas ; on lance l'animation de la coordonées X
balle_bleue(1)\Y=balle_bleue(1)\Y + balle_bleue(1)\ypas ; on lance l'animation de la coordonées Y
; on test les sorties d'ecran
If balle_bleue(1)\x>Width-32 Or balle_bleue(1)\x<0 ; si la coordonée X du sprite est superieur a la largeur de l'ecran (sortie a droite) ou plus petit que zero (sortie a gauche)
; le "-32" sert a ce que la detection de la sortie se fasse a droite du Sprite
balle_bleue(1)\xpas=-balle_bleue(1)\xpas ; on inverse le sens des x , ce qui aura pour consequence de faire aller le Sprite dans l'autre sens des X
EndIf
If balle_bleue(1)\Y>Height-32 Or balle_bleue(1)\Y<0 ; si la coordonée Y du sprite est superieur a la lhauteur de l'ecran (sortie en bas) ou plus petit que zero (sortie en haut)
; le "-32" sert a ce que la detection de la sortie se fasse au dessous du Sprite
balle_bleue(1)\ypas=-balle_bleue(1)\ypas ; on inverse le sens des Y , ce qui aura pour consequence de faire aller le Sprite dans l'autre sens des Y
EndIf
DisplayTransparentSprite(#sprite_balle_bleue,balle_bleue(1)\x,balle_bleue(1)\Y) ; on affiche le Sprite aux coordonées
son=Random(1000)+500
oliv(1)\text.s="petite demo pour Bernard 13"
oliv(1)\xt= oliv(1)\xt+2 :If oliv(1)\xt>Width: oliv(1)\xt=-500:EndIf ; le text arrive a droite ? on le remet a gauche !!
oliv(1)\yt=Height-125 ; emplacement verticale de la sinuzoide
oliv(1)\cr=Random(255)+100
;oliv(1)\cv=Random(255)+100
oliv(1)\cb=Random(255)+100
Ondulation( oliv(1)\xt, oliv(1)\yt, oliv(1)\text.s, oliv(1)\cr, oliv(1)\cv, oliv(1)\cb) ; appel de la procedure a OLIV on donne les coordonées que l'on veux, le text, et la couleur
;-affiche Raster
With Raster
For i = 0 To 29
DisplaySprite(\Sprite[i], 10 + i * 4, \CentreY + Sin((\angle + i * \pas * 2) * 0.0174533) * \amplitude)
DisplaySprite(\Sprite[i], Width-240 + i * 4, \CentreY + Sin((\angle + i * \pas * 2) * 0.0174533) * \amplitude)
Next i
\angle + \Vitesse
EndWith
;------------- routine boulles en rotation ---------
rot.f+0.05
For colon= 0 To 8 ;nombre de ligne de boulles en rotation!! ou collone pitain je sais plus
For ligne =0 To 8 ;nombre de collone de boulles en rotation!! ou ligne repitain je sais pas
posx=(colon*50)-200 ; pfff ca me gonffle les comment...
posy=(ligne*50)-100
ix=Cos(rot) * posx - Sin(rot) * posy
iy=Sin(rot) * posx + Cos(rot) * posy
iz1=Sin(rot) * iy + Cos(rot) * 100
cix=1000*ix/(1000-iz1)
ciy=1000*(Cos(rot) * iy - Sin(rot) * 100)/(1000-iz1)
DisplayTransparentSprite(#sprite_tonton,cix+Width/2,ciy+ 100+Height/2)
Next ligne
Next colon
;-------------- fin boulles en rotation --------
;-affiche Titre
; ********************** Titre ************************************************
For y1= 0 To 50 ; on va ré afficher nos 101 lignes mais en les positionant par rapport a une sinuzoide :=
dobro_titre(1)\angle=dobro_titre(1)\angle+1 :If dobro_titre(1)\angle=360*10: dobro_titre(1)\angle=0 :EndIf
dobro_titre(1)\x+(Sin(dobro_titre(1)\angle*2*#PI/50)*dobro_titre(1)\amplitude) ; le X varie en fonction de Sin()
DisplayTransparentSprite(#titre+y1,dobro_titre(1)\x+CentreX-200,y1)
Next y1 ; voila voila !! :D
; ********************************************************************
;- affichage tunel SPH
; ***************** tunel a SPH *********************
x1=dw2
y1=dh2
r.f=70
rr.f=0.000002
cmb=300
For i=1 To 255
rvb=RGB(i,i,i)
For u=0 To cmb
x2=dw2+Cos(t0)*ra0+Cos(t2)*ra0+Cos(ff)*r
y2=dh2+Sin(t)*ra1+Sin(t3)*ra1+Sin(ff)*r
; LineXY(x1,y1,x2,y2,rvb)
; Circle(x1,y1,2,RGB(0,125,125))
DisplaySprite(#sprite_tunel,x1,y1)
;Line(x1,y1,1,1,rvb)
ff+0.1
rr*1.001
r+rr
t0+tt0
t1+tt1
t2+tt2
t3+tt3
x1=dw2+Cos(t0)*ra0+Cos(t2)*ra0+Cos(ff)*r
y1=dh2+Sin(t1)*ra1+Sin(t3)*ra1+Sin(ff)*r
;LineXY(x1,y1,x2,y2,rvb)
ff+0.1
rr*1.001
r+rr
t0+tt0
t1+tt1
t2+tt2
t3+tt3
Next
If cmb>10
cmb-26
EndIf
Next
; ************************************************
FlipBuffers() ; Inverse les buffers
ClearScreen(0) ; Efface l'écran
; *************** Tunel SPH ******************
ff=ffm+1
ffm+0.03
t01+0.03
t11+0.04
t21+0.023
t31+0.032
t0=t01
t1=t11
t2=t21
t3=t31
; ******************************************
Until KeyboardPushed(#PB_Key_Escape) ; On s'en va!!!
mciSendString_("CLOSE MIDI",0,0,0)
EndIf
EndIf
End ; Adios!
spectre:
Circle(100+avx0, 100+avy0, 20 ,coul)
Box(80+avx0,100+avy0, 40, 25 ,coul)
Circle(88+avx0, 122+avy0, 3 ,RGB(0,0,0))
Circle(100+avx0, 122+avy0, 3 ,RGB(0,0,0))
Circle(112+avx0, 122+avy0, 3 ,RGB(0,0,0))
Box(85+avx0,122+avy0, 6, 3,RGB(0,0,0))
Box(97+avx0,122+avy0, 6, 3,RGB(0,0,0))
Box(109+avx0,122+avy0, 6, 3,RGB(0,0,0))
Circle(108+avx0, 95+avy0, 5 ,RGB(255,255,255))
Circle(94+avx0, 95+avy0, 5 ,RGB(255,255,255))
Circle(108+avx0+yyex0, 95+avy0+yyey0, 3 ,RGB(0,0,0))
Circle(94+avx0+yyex0, 95+avy0+yyey0, 3 ,RGB(0,0,0))
Return
Procedure Ondulation(x,Y,Texte.s,r,v,b)
; procedure realisé par OLIV
StartDrawing ( ScreenOutput ()) ; Pour pouvoir utiliser les commandes des dessin 2D.
DrawingFont ( FontID ( #font )) ; On change la police
DrawingMode (1) ; On selectionne le mode pour ne pas avoir de fond derrière les lettres.
FrontColor ( RGB (r,v,b) ) ; On change la couleur.
oliv(1)\angle + #VitesseAngle ; Angle de départ de la sinusoide en radian
If oliv(1)\angle >= 2 * #PI
oliv(1)\angle = 0
EndIf
; On affiche toute les lettres
posx = 10 ; Position du caractère
For n = 1 To Len (Texte) ; Pour chaque lettre du texte
Lettre.s = Mid (Texte, n, 1) ; on récupère la lettre à la position n
posy = 50 + #HauteurSin * Sin ( oliv(1)\angle + posx / #LargeurSin ) ; on calcul la position en Y de la lettre
; On part du centre de l'image (50) puis on ajoute un sin
; #HauteurSin fait varier l'amplitude du mouvement
; l'angle mis dans le sinus est d'abord composé de l'angle de départ d'affichage du texte (Angle)
; puis on augmente l'angle au fur et à mesure que l'on affiche des lettres avec le coefficient #LargeurSin qui permet de faire varier la largeur de la sinusoide
DrawText (x+posx, Y+posy,Lettre)
posx + TextWidth (Lettre)
Next
StopDrawing () ; On signife que l'on arrête les fonctions dessin 2D.
EndProcedure
DataSection
Couleur :
Data.l $13, $30, $50, $70, $8E, $AE, $CF, $EC
Data.l $FF, $EB, $CF, $AF, $8E, $71, $50, $30
Data.l $0, $30914, $61632, $92454, $D3373, $104193, $144FB5, $185CD2
Data.l $1A65E7, $185CD2, $144FB4, $114193, $D3373, $A2554, $51632, $30A15
Data.l $1D2D, $314B, $4569, $5785, $6BA3, $7EC1, $90DC, $9CEE
Data.l $90DB, $7FC2, $6BA3, $5785, $4569, $314B, $1D2C, $D12
Data.l $62518, $B3E27, $F5837, $136F46, $178755, $1CA165, $1FB673, $22C67D
Data.l $20B773, $1CA166, $178755, $136F46, $F5837, $B3F28, $62518, $30F0A
Data.l $152516, $233E25, $315735, $3F6D43, $4D8652, $5B9F62, $67B56F, $70C478
Data.l $67B56E, $5BA062, $4D8752, $3E6D43, $325635, $243E26, $152417, $80F0A
Data.l $152209, $24390F, $324F15, $3F651A, $4E7C20, $5C9226, $69A62C, $72B42F
Data.l $69A62C, $5C9226, $4E7C20, $40641A, $324F15, $24390E, $152209, $90E04
Data.l $22230B, $393A13, $50511A, $666621, $7C7E29, $939631, $A7AA38, $B5B83C
Data.l $A7AA37, $939631, $7C7E2A, $656621, $50521B, $393A13, $22230B, $E0E05
Data.l $423411, $5E4919, $785D1F, $927226, $AD872D, $C89C34, $DFAE3B, $EFBB3F
Data.l $DEAE3B, $C79C34, $AD872D, $927227, $785D1F, $5D4A18, $423412, $271E0A
Data.l $251A12, $3E2C1E, $573C2A, $6E4D35, $875F41, $A0704D, $B68058, $C58A5F
Data.l $B58057, $A0704D, $875F41, $6E4D35, $573D29, $3E2B1E, $251A12, $F0A07
Data.l $211513, $372321, $4E302D, $633D39, $784C46, $8F5953, $A3665F, $B06E66
Data.l $A3655E, $8F5A53, $794B46, $623D39, $4E312D, $372220, $211514, $D0808
Data.l $C0609, $1D0F14, $311921, $44232F, $562C3B, $693649, $7D4056, $8E4961
Data.l $9A4F6A, $8E4962, $7D4056, $693648, $562C3B, $44232F, $311921, $1D0F14
Data.l $1D101B, $311B2D, $44263F, $573050, $6B3B62, $7E4673, $8F4F83, $9B568E
Data.l $8F5083, $7E4673, $6A3B61, $573050, $45263E, $301B2D, $1D101A, $C070B
Data.l $C0912, $1E142C, $31214A, $452F69, $583C84, $6D49A3, $8157C0, $9262DA
Data.l $9E6BED, $9262DB, $8157C0, $6D4AA2, $583C85, $462F69, $32224B, $1E152C
Data.l $211D42, $2E2A5D, $3B3676, $484190, $564EAB, $635AC5, $6E63DC, $766BEC
Data.l $6E64DC, $6259C6, $554EAB, $48418F, $3B3676, $2F2A5C, $211D41, $141227
Data.l $18003F, $220058, $2C0070, $350089, $3F00A3, $4900BD, $5100D2, $5700E1
Data.l $5100D1, $4800BC, $3F00A3, $350089, $2C0070, $220059, $18003E, $E0025
Data.l $23003E, $320059, $3F0071, $4D008A, $5C00A3, $6A00BD, $7600D3, $7F00E2
Data.l $7700D2, $6A00BD, $5C00A4, $4D0089, $400071, $320058, $23003F, $150025
Data.l $220029, $310039, $3E0049, $4B0059, $59006A, $66007A, $720088, $7B0092
Data.l $730088, $67007A, $59006A, $4A0059, $3E0049, $300039, $220028, $140018
Data.l $22031C, $310328, $3D0433, $4B053E, $59064A, $670755, $73085F, $7B0966
Data.l $73085F, $670855, $590649, $4A053E, $3D0433, $300428, $22021C, $140111
Data.l $220511, $300718, $3E081E, $4A0B25, $590D2C, $670E33, $721038, $7B113D
Data.l $721039, $670E33, $590C2C, $4A0A25, $3E091F, $300718, $220510, $14030A
Data.l $29130E, $3A1B13, $4B2219, $5A291F, $6C3125, $7C382A, $8B3E2F, $954332
Data.l $8B3F2F, $7C382A, $6C3025, $5A291E, $4A2219, $3B1A14, $2A130E, $190B08
Data.l $E0800, $221400, $382100, $4F2F00, $643B00, $7A4800, $915500, $A56100
Data.l $B36900, $A56000, $925600, $7B4800, $643B00, $4F2F00, $382100, $221300
Data.l $120D00, $2C2100, $4A3800, $684E00, $836300, $A17A00, $BF9000, $D9A400
Data.l $EBB200, $D9A400, $BF9100, $A17A00, $836400, $684E00, $4A3900, $2C2200
Data.l $D0D00, $1D1F00, $323400, $464900, $595C00, $6C7100, $808500, $929700
Data.l $9EA400, $919700, $808600, $6C7100, $585B00, $464800, $323300, $1E1F00
Data.l $1B2C00, $273E00, $314F00, $3B6000, $477300, $528500, $5C9400, $629F00
Data.l $5B9400, $518500, $477300, $3C6100, $315000, $263E00, $1B2C00, $101A00
Data.l $50E00, $B2100, $133700, $1A4D00, $216200, $287800, $308F00, $36A200
Data.l $3BB000, $37A200, $308E00, $297900, $216200, $1A4E00, $133800, $B2100
Data.l $93722, $D4D31, $11633F, $15794C, $198F5A, $1DA669, $20B975, $22C67D
Data.l $20B975, $1CA568, $18905B, $15784C, $11633E, $D4E30, $93723, $62114
Data.l $4344, $5F62, $7A7D, $9497, $B0B4, $CCD0, $E3E8, $F4F9
Data.l $E3E8, $CCD0, $B1B5, $9597, $7A7D, $6062, $4344, $2829
Data.l $2B42, $3E5E, $4E77, $5F90, $71AC, $82C7, $91DD, $9CEE
Data.l $92DE, $83C7, $71AD, $5F91, $4E77, $3D5D, $2B41, $1A27
Data.l $20812, $4132C, $81F48, $B2C66, $F3881, $12469E, $1552BC, $185DD5
Data.l $1A65E7, $185DD5, $1552BB, $12459F, $F3881, $B2D66, $82049, $5132C
Data.l $40011, $8002A, $D0046, $120063, $17007C, $1C0099, $2200B5, $2600CE
Data.l $2900DF, $2500CE, $2100B5, $1C0099, $17007C, $120063, $D0046, $80029
EndDataSection
; #### INITSTARFIELD ####
InitStarField:
; Structure of a star ...
Structure a3DStar
x.f ; X-Coordinate
Y.f ; Y-Coordinate
z.f ; Z-Coordinate
EndStructure
; Init Starfield ...
Dim Stars.a3DStar(SSum)
For dummy = 0 To SSum
Stars(dummy)\x = Random(10000)-5000
Stars(dummy)\Y = Random(10000)-5000
Stars(dummy)\z = 100 + Random(1000)
Next dummy
Return
; ### Move Camera ###
MoveCamera:
If CameraZ>1000
Direction=-1
ElseIf CameraZ<-1000
Direction=1
EndIf
If Direction=1 And Cspeed<20
Cspeed=Cspeed+0.01
ElseIf Direction=-1 And Cspeed>-20
Cspeed=Cspeed-0.01
EndIf
CameraZ=CameraZ+Cspeed
Return
; #### Draw StarField ####
DrawStarField:
For dummy = 0 To SSum
If Stars(dummy)\z<CameraZ
Stars(dummy)\z=CameraZ+1000
ElseIf Stars(dummy)\z>(CameraZ+1000)
Stars(dummy)\z=CameraZ
EndIf
sx = Stars(dummy)\x / (Stars(dummy)\z-CameraZ)*100+EcranX/2
sy = Stars(dummy)\Y / (Stars(dummy)\z-CameraZ)*100+EcranY/2
If sx<Width And sy<Height And sx>0 And sy>0
star_b.f = 255-(((Stars(dummy)\z)-CameraZ)*(255./1000.))
c=Int(star_b)
Rouge =Random(255)+1
Vert=Random(255)+1
Bleu=Random(255)+1
Circle(sx, sy, 1 ,RGB(Rouge,Vert,Bleu) )
EndIf
Next dummy
Return