Des petits effets :)
Publié : dim. 26/juin/2005 1:42


Un petit cercle haut en couleur

Code : Tout sélectionner
; ---------------------------------------
; - Auteur : Garzul -
; - Date : 4 Juin 2005 -
; - Type de programme : Effets -
; - Version de PB : PureBasic v3.92 -
; ---------------------------------------
InitSprite() : InitKeyboard()
OpenScreen(1024,768,32,"Algorythme")
; - Définition de diverse variables servant au programmes !
x = 512
y = 364
Angle = 0
Rayon = 350
; - Définition des Couleurs.
Red = 0
Green = 0
Blue = 0
; - Définition de PI.
#pi = 3.1415
Repeat
ExamineKeyboard()
ClearScreen(0,0,0)
StartDrawing(ScreenOutput())
For i = 0 To Rayon
For Vit = 0 To 200
Green + 1 / Cos(i)
Blue + 1
Plot(x + i * Cos(Vit),y + i * Sin(Vit),RGB(Red,Green,Blue))
Next Vit
Next i
DrawingMode(1)
FrontColor($00,$FF,$FF)
DrawText("Arguments de Debuggages : ")
FrontColor($8C,$FF,$73)
Locate(0,20)
DrawText("Angle : " + Str(Angle))
FrontColor($00,$FF,$FF)
Locate(0,60)
DrawText("Debug Couleur : ")
FrontColor($FF,$01,$00)
Locate(0,80)
DrawText("Vert : " + Str(Green))
Locate(0,100)
DrawText("Bleu : " + Str(Blue))
StopDrawing()
Angle + 1
FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape)
End

Code : Tout sélectionner
; --------------------------------------------------
; - Auteur : Garzul -
; - Date : 4 Juin 2005 -
; - Type de programme : Algorythme de brouillage -
; - Version de PB : PureBasic v3.92 -
; --------------------------------------------------
InitSprite() : InitKeyboard()
OpenScreen(1024,768,32,"Algorythme")
; - Définition de diverse variables servant au programmes !
x = 0
y = 0
Rayon = 0
Red = 0
Green = 0
Blue = 0
Repeat
ExamineKeyboard()
ClearScreen(0,0,0)
StartDrawing(ScreenOutput())
For x = 0 To 1024
For y = 0 To 768 Step 3
Green + Sin(x)
;Red+y/4
Plot(x,y,RGB(Red,Green,Blue))
Next y
Next x
Rayon + 1
DrawingMode(1)
FrontColor($FF,$01,$00)
DrawText("Debug Couleur : ")
Locate(0,30)
DrawText("Vert : " + Str(Green))
StopDrawing()
FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape)
End

Code : Tout sélectionner
InitSprite() : InitKeyboard() : InitMouse()
OpenScreen(1024,768,32,"Formules")
x1 = 700
y1 = 340
xx = Random(1024)
yy = 760
Rayon = 10
PI = 3.1415
AffichExplo = 0
Angle2 = 0
delay = 40 + Random(750)
MouseLocate(x1, y1)
Repeat
ExamineKeyboard()
ExamineMouse()
ClearScreen(0,0,0)
x = MouseX()
y = MouseY()
If MouseButton(1)
Rayon = 10
AffichExplo = 0
xx = Random(1024)
yy = 760
delay = 40 + Random(750)
EndIf
For Angle = 0 To 380
Red = 255
Green = 50
Blue = 150
StartDrawing(ScreenOutput())
If AffichExplo = 1
Box(xx + Rayon * Cos(Angle),yy + Rayon * Sin(Angle) * Sin(Sqr(Angle)),2,1,RGB(Red,Green,Blue))
EndIf
StopDrawing()
Next Angle
StartDrawing(ScreenOutput())
DrawText("Clicker sur le bouton 1 de la souris pour recommencer !")
Locate(0,20)
DrawText("PosY : " + Str(PositionY))
Locate(0,40)
DrawText("RandomY : " + Str(delay))
Locate(0,60)
DrawText("Ca pete dans : " + Str(DelayElapsed))
DelayElapsed = yy - delay
PositionY = yy
If DelayElapsed < 0
DelayElapsed = 0
EndIf
If AffichExplo = 0
Box(xx + Cos(Angle2),yy,3,10,RGB($00,$00,$FF))
EndIf
If yy = delay
AffichExplo = 1
EndIf
If AffichExplo = 1
Rayon + 3
PositionY = 0
EndIf
StopDrawing()
;xx - 1
yy - 1
Angle2 + 1
FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape)
End
Un truc incompréhensible mais jolie

Code : Tout sélectionner
InitSprite() : InitKeyboard()
OpenScreen(1024,768,32,"Formules")
x = 350
y = 340
Rayon = 10
Repeat
ExamineKeyboard()
ClearScreen(0,0,0)
StartDrawing(ScreenOutput())
For Angle = 0 To 380
Red = Random(244)
Green = Random(244)
Blue = Random(254)
Box(x + Rayon * Cos(Angle) + Angle,y + Rayon * Sin(Angle),1,1,RGB(Red,Green,Blue))
LineXY(x + Rayon * Cos(Angle) + Angle,y + Rayon * Sin(Angle),x - Rayon * Cos(Angle) + Angle,y - Rayon * Sin(Angle),RGB(20,Green,Blue))
Next Angle
StopDrawing()
Rayon + 1
FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape)
End
