Les horloges de SPH

Programmation d'applications complexes
Avatar de l’utilisateur
SPH
Messages : 4722
Inscription : mer. 09/nov./2005 9:53

Les horloges de SPH

Message par SPH »

Code : Tout sélectionner

; SPH(2021)
; PB573

InitSprite() 
InitMouse() 
InitKeyboard() 

;SetPriorityClass_ ( GetCurrentProcess_ (), #IDLE_PRIORITY_CLASS ) 

If ExamineDesktops() 
   dw.w=DesktopWidth(0) 
   dh.w=DesktopHeight(0)
   do.b=DesktopDepth(0)
Else 
   dw.w=1024 
   dh.w=768 
EndIf 

OpenScreen(dw,dh,do,"Les horloges de SPH") 


xx=dw/2
yy=dh/2
pis.f=ATan(1)*12.1585
pim.f=ATan(1)*12.1585
pih.f=ATan(1)*2.4317
echp=yy/1.4
;echh=yy/2.4
echm=yy/1.5
col=RGB(33,33,33)
ii.f=Random(20)/100
uu.f=Random(20)/100
ii2.f=Random(20)/100
uu2.f=Random(20)/100

;;;;;;;;;;;
;;;;;;;;;;;
;;;;;;;;;;;


Repeat ; Boucle principale

xxx=Cos(ii)*45+Sin(ii2)*40
yyy=Sin(uu)*45-Cos(uu2)*40
decx.f=Cos(ii)/18+Sin(uu2)/15

ExamineMouse() 
xmouse=MouseDeltaX()/45 ; /x : x= sensibilité
ymouse=MouseDeltaY()/45 ; /x : x= sensibilité

If MouseButton(#PB_MouseButton_Left)<>0
s+1:If s>=60:s-60:m+1:EndIf:If m=60:m=0:h+1:EndIf:If h=12:h=0:EndIf
Else
h=Hour(Date()):m=Minute(Date()):s=Second(Date())
EndIf


;*****
ClearScreen(0)
StartDrawing(ScreenOutput()) 
;;;;;;;;;;;
ss.f=decx+s/pis
mm.f=decx+(m+s/60)/pim
hh.f=decx+(h+m/60)/pih
For i=0 To 11
If i=0 Or i=3 Or i=6 Or i=9
co=RGB(255,255,255)
Else
co=RGB(170,180,190)
EndIf
For u=1 To 5
Plot(xx+Sin(decx+i/pih)*(echp+xxx)+Random(6)-3,yy-Cos(decx+i/pih)*(echp+yyy)+Random(6)-3,co)
Next
Next


x1=Sin(mm)*(echm+xxx)
y1=-Cos(mm)*(echm+yyy)
;Line(xx,yy,x1,y1,RGB(200,200,0))
dist=Sqr(x1*x1+y1*y1)
xx1.f=x1/dist
yy1.f=y1/dist
xx2.f=xx
yy2.f=yy
u=0
For i=0 To dist/3
r=255;Random(255)
Plot(xx2-u/32+Random(u/16),yy2-u/32+Random(u/16),RGB(r,r,0))
xx2+xx1
yy2+yy1
u+2
Next
For i=0 To dist/2
u-1
r=255;Random(255)
Plot(xx2-u/32+Random(u/16),yy2-u/32+Random(u/16),RGB(r,r,0))
xx2+xx1
yy2+yy1
Next


x1=Sin(hh)*(echm+xxx)
y1=-Cos(hh)*(echm+yyy)
;Line(xx,yy,x1,y1,RGB(200,0,0))
dist=Sqr(x1*x1+y1*y1)
xx1.f=x1/dist
yy1.f=y1/dist
xx2.f=xx
yy2.f=yy
u=0
For i=0 To dist/8
r=255;Random(255)
Plot(xx2-u/8+Random(u/4),yy2-u/8+Random(u/4),RGB(r,20,r/3))
xx2+xx1
yy2+yy1
u+2
Next
For i=0 To dist/4
u-1
r=255;Random(255)
Plot(xx2-u/8+Random(u/4),yy2-u/8+Random(u/4),RGB(r,20,r/3))
xx2+xx1
yy2+yy1
Next

x1=Sin(ss)*(echm+xxx)
y1=-Cos(ss)*(echm+yyy)
dist=Sqr(x1*x1+y1*y1)
xx1.f=x1/dist
yy1.f=y1/dist
xx2.f=xx-2
yy2.f=yy-2
For i=0 To dist
If Random(2)=1
Plot(xx2+Random(4),yy2+Random(4),RGB(0,0,255));Random(255)))
EndIf
xx2+xx1
yy2+yy1
Next

;ii+0.024
;uu+0.0189
;ii2+0.013
;uu2+0.021
ii+0.007
uu+0.0059
ii2+0.0043
uu2+0.0031

;;;;;;;;;;;
StopDrawing() 
;*****

FlipBuffers() 

Delay(1)

ExamineKeyboard() 
Until KeyboardPushed(#PB_Key_All) 
End 

http://HexaScrabble.com/
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
Avatar de l’utilisateur
threedslider
Messages : 381
Inscription : dim. 01/juil./2018 22:38

Re: Les horloges de SPH

Message par threedslider »

Superbe et bien faite !

Merci de ton partage, c'est super que ça marche :)
Avatar de l’utilisateur
SPH
Messages : 4722
Inscription : mer. 09/nov./2005 9:53

Re: Les horloges de SPH

Message par SPH »

Thank you (ca veux dire "merci" en anglais) 😊
http://HexaScrabble.com/
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
Avatar de l’utilisateur
Micoute
Messages : 2522
Inscription : dim. 02/oct./2011 16:17
Localisation : 35520 La Mézière

Re: Les horloges de SPH

Message par Micoute »

Bonjour SPH, c'est joli et original, je te remercie pour le partage.
Microsoft Windows 10 Famille 64 bits : Carte mère : ASRock 970 Extreme3 R2.0 : Carte Graphique NVIDIA GeForce RTX 3080 : Processeur AMD FX 6300 6 cœurs 12 threads 3,50 GHz PB 5.73 PB 6.00 LTS (x64)
Un homme doit être poli, mais il doit aussi être libre !
Avatar de l’utilisateur
falsam
Messages : 7244
Inscription : dim. 22/août/2010 15:24
Localisation : IDF (Yvelines)
Contact :

Re: Les horloges de SPH

Message par falsam »

Merci pour ce partage SPH. Mais parfois je me demande ce que tu prends comme hallucinogènes :mrgreen:
Configuration : Windows 11 Famille 64-bit - PB 6.03 x64 - AMD Ryzen 7 - 16 GO RAM
Vidéo NVIDIA GeForce GTX 1650 Ti - Résolution 1920x1080 - Mise à l'échelle 125%
Avatar de l’utilisateur
venom
Messages : 3071
Inscription : jeu. 29/juil./2004 16:33
Localisation : Klyntar
Contact :

Re: Les horloges de SPH

Message par venom »

falsam a écrit : sam. 18/sept./2021 10:51Mais parfois je me demande ce que tu prends comme hallucinogènes :mrgreen:
:roll: Cherche pas, il a passé la soirée devant danse avec les stars en buvant du thé :lol:

Bon j'ai test :wink: Sympa merci du partage SPH







@++
Windows 10 x64, PureBasic 5.73 x86 & x64
GPU : radeon HD6370M, CPU : p6200 2.13Ghz
Avatar de l’utilisateur
SPH
Messages : 4722
Inscription : mer. 09/nov./2005 9:53

Re: Les horloges de SPH

Message par SPH »

falsam a écrit : sam. 18/sept./2021 10:51 Merci pour ce partage SPH. Mais parfois je me demande ce que tu prends comme hallucinogènes :mrgreen:
Zolpidem :P
http://HexaScrabble.com/
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
Avatar de l’utilisateur
Kwai chang caine
Messages : 6962
Inscription : sam. 23/sept./2006 18:32
Localisation : Isere

Re: Les horloges de SPH

Message par Kwai chang caine »

Sympa cette horloge au clic gauche à la "Doc" :mrgreen:

Image

Merci pour le partage 8)
ImageLe bonheur est une route...
Pas une destination

PureBasic Forum Officiel - Site PureBasic
Avatar de l’utilisateur
SPH
Messages : 4722
Inscription : mer. 09/nov./2005 9:53

Re: Les horloges de SPH

Message par SPH »

Voici une horloge qui bouge avec la souris. Et elle peux se "plier" sur les bords de l'ecran...

Code : Tout sélectionner

; SPH(2021)
; PB573

InitSprite() 
InitMouse() 
InitKeyboard() 

;SetPriorityClass_ ( GetCurrentProcess_ (), #IDLE_PRIORITY_CLASS ) 

If ExamineDesktops()
   dw.w=DesktopWidth(0) 
   dh.w=DesktopHeight(0)
   do.b=DesktopDepth(0)
Else 
   dw.w=1024 
   dh.w=768
   do.b=32
EndIf 

OpenScreen(dw,dh,do,"Les horloges de SPH") 


xx=dw/2
yy=dh/2
pis.f=ATan(1)*12.1585
pim.f=ATan(1)*12.1585
pih.f=ATan(1)*2.4317
echp=yy/1.4
;echh=yy/2.4
echm=yy/1.5
col=RGB(33,33,33)
ii.f=Random(20)/100
uu.f=Random(20)/100
ii2.f=Random(20)/100
uu2.f=Random(20)/100

;;;;;;;;;;;
;;;;;;;;;;;
;;;;;;;;;;;


Repeat ; Boucle principale

xxx=Cos(ii)*45+Sin(ii2)*40
yyy=Sin(uu)*45-Cos(uu2)*40
decx.f=Cos(ii)/18+Sin(uu2)/15

ExamineMouse() 
xmouse=MouseDeltaX()/45 ; /x : x= sensibilité
ymouse=MouseDeltaY()/45 ; /x : x= sensibilité
xx=MouseX()
yy=MouseY()


If MouseButton(#PB_MouseButton_Left)<>0
s+1:If s>=60:s-60:m+1:EndIf:If m=60:m=0:h+1:EndIf:If h=12:h=0:EndIf
Else
h=Hour(Date()):m=Minute(Date()):s=Second(Date())
EndIf


;*****
ClearScreen(0)
StartDrawing(ScreenOutput()) 
;;;;;;;;;;;
ss.f=decx+s/pis
mm.f=decx+(m+s/60)/pim
hh.f=decx+(h+m/60)/pih
For i=0 To 11
If i=0 Or i=3 Or i=6 Or i=9
co=RGB(255,255,255)
Else
co=RGB(170,180,190)
EndIf
For u=1 To 5
  sphx=xx+Sin(decx+i/pih)*(echp+xxx)+Random(6)-3
  sphy=yy-Cos(decx+i/pih)*(echp+yyy)+Random(6)-3
  
  If sphx<0
  sphx=(sphx*-1)/2
  EndIf
  If sphx>=dw
    sphx=dw-1-Abs(dw-sphx)/2
  EndIf
  
  If sphy<0
  sphy=(sphy*-1)/2
  EndIf
  If sphy>=dh
    sphy=dh-1-Abs(dh-sphy)/2
  EndIf
  
  Plot(sphx,sphy,co)
Next
Next


x1=Sin(mm)*(echm+xxx)
y1=-Cos(mm)*(echm+yyy)
;Line(xx,yy,x1,y1,RGB(200,200,0))
dist=Sqr(x1*x1+y1*y1)
xx1.f=x1/dist
yy1.f=y1/dist
xx2.f=xx
yy2.f=yy
u=0
r=255;Random(255)
For i=0 To dist/3
  sphx=xx2-u/32+Random(u/16)
  sphy=yy2-u/32+Random(u/16)
  If sphx<0
  sphx=(sphx*-1)/2
  EndIf
  If sphx>=dw
    sphx=dw-1-Abs(dw-sphx)/2
  EndIf
  
  If sphy<0
  sphy=(sphy*-1)/2
  EndIf
  If sphy>=dh
    sphy=dh-1-Abs(dh-sphy)/2
  EndIf
  
Plot(sphx,sphy,RGB(r,r,0))
xx2+xx1
yy2+yy1
u+2
Next
r=255;Random(255)
For i=0 To dist/2
  u-1
    sphx=xx2-u/32+Random(u/16)
  sphy=yy2-u/32+Random(u/16)
  If sphx<0
  sphx=(sphx*-1)/2
  EndIf
  If sphx>=dw
    sphx=dw-1-Abs(dw-sphx)/2
  EndIf
  
  If sphy<0
  sphy=(sphy*-1)/2
  EndIf
  If sphy>=dh
    sphy=dh-1-Abs(dh-sphy)/2
  EndIf
  
Plot(sphx,sphy,RGB(r,r,0))
xx2+xx1
yy2+yy1
Next


x1=Sin(hh)*(echm+xxx)
y1=-Cos(hh)*(echm+yyy)
dist=Sqr(x1*x1+y1*y1)
xx1.f=x1/dist
yy1.f=y1/dist
xx2.f=xx
yy2.f=yy
u=0
r=255;Random(255)
For i=0 To dist/8
    sphx=xx2-u/8+Random(u/4)
  sphy=yy2-u/8+Random(u/4)
  If sphx<0
  sphx=(sphx*-1)/2
  EndIf
  If sphx>=dw
    sphx=dw-1-Abs(dw-sphx)/2
  EndIf
  
  If sphy<0
  sphy=(sphy*-1)/2
  EndIf
  If sphy>=dh
    sphy=dh-1-Abs(dh-sphy)/2
  EndIf
  
Plot(sphx,sphy,RGB(r,20,r/3))
xx2+xx1
yy2+yy1
u+2
Next
r=255;Random(255)
For i=0 To dist/4
u-1
    sphx=xx2-u/8+Random(u/4)
  sphy=yy2-u/8+Random(u/4)
  If sphx<0
  sphx=(sphx*-1)/2
  EndIf
  If sphx>=dw
    sphx=dw-1-Abs(dw-sphx)/2
  EndIf
  
  If sphy<0
  sphy=(sphy*-1)/2
  EndIf
  If sphy>=dh
    sphy=dh-1-Abs(dh-sphy)/2
  EndIf
  
Plot(sphx,sphy,RGB(r,20,r/3))
xx2+xx1
yy2+yy1
Next

x1=Sin(ss)*(echm+xxx)
y1=-Cos(ss)*(echm+yyy)
dist=Sqr(x1*x1+y1*y1)
xx1.f=x1/dist
yy1.f=y1/dist
xx2.f=xx-2
yy2.f=yy-2
For i=0 To dist
If Random(2)=1
    sphx=xx2+Random(4)
  sphy=yy2+Random(4)
  If sphx<0
  sphx=(sphx*-1)/2
  EndIf
  If sphx>=dw
    sphx=dw-1-Abs(dw-sphx)/2
  EndIf
  
  If sphy<0
  sphy=(sphy*-1)/2
  EndIf
  If sphy>=dh
    sphy=dh-1-Abs(dh-sphy)/2
  EndIf
  
Plot(sphx,sphy,RGB(0,0,255))
EndIf
xx2+xx1
yy2+yy1
Next

;ii+0.024
;uu+0.0189
;ii2+0.013
;uu2+0.021
ii+0.007
uu+0.0059
ii2+0.0043
uu2+0.0031

;;;;;;;;;;;
StopDrawing() 
;*****

FlipBuffers() 

Delay(1)

ExamineKeyboard() 
Until KeyboardPushed(#PB_Key_All) 
End 
Dernière modification par SPH le mer. 29/sept./2021 10:26, modifié 1 fois.
http://HexaScrabble.com/
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
Avatar de l’utilisateur
Micoute
Messages : 2522
Inscription : dim. 02/oct./2011 16:17
Localisation : 35520 La Mézière

Re: Les horloges de SPH

Message par Micoute »

Merveilleux.
Microsoft Windows 10 Famille 64 bits : Carte mère : ASRock 970 Extreme3 R2.0 : Carte Graphique NVIDIA GeForce RTX 3080 : Processeur AMD FX 6300 6 cœurs 12 threads 3,50 GHz PB 5.73 PB 6.00 LTS (x64)
Un homme doit être poli, mais il doit aussi être libre !
Avatar de l’utilisateur
SPH
Messages : 4722
Inscription : mer. 09/nov./2005 9:53

Re: Les horloges de SPH

Message par SPH »

Voilà, ce sera mon dernier post sur les horloges. Mon code pourrait être un économiseur d'écran...
(MouseBouton droit : change la "balade" de l'horloge)

Code : Tout sélectionner

; SPH(2021)
; PB573

InitSprite() 
InitMouse() 
InitKeyboard() 

;SetPriorityClass_ ( GetCurrentProcess_ (), #IDLE_PRIORITY_CLASS ) 

If ExamineDesktops()
   dw.w=DesktopWidth(0) 
   dh.w=DesktopHeight(0)
   do.b=DesktopDepth(0)
Else 
   dw.w=1024 
   dh.w=768
   do.b=32
EndIf 

OpenScreen(dw,dh,do,"Les horloges de SPH") 


xx=dw/2
yy=dh/2
pis.f=ATan(1)*12.1585
pim.f=ATan(1)*12.1585
pih.f=ATan(1)*2.4317
echp=yy/1.4
;echh=yy/2.4
echm=yy/1.5
col=RGB(33,33,33)
ii.f=Random(20)/100
uu.f=Random(20)/100
ii2.f=Random(20)/100
uu2.f=Random(20)/100

;;;;;;;;;;;
sphii.f=0
sphuu.f=0
sphii2.f=0
sphuu2.f=0
sphiii.f=Random(1000)/200000
sphuuu.f=Random(1000)/200000
sphiii2.f=Random(1000)/200000
sphuuu2.f=Random(1000)/200000
rayonx=dw/5
rayony=dh/6

;;;;;;;;;;;
;;;;;;;;;;;


Repeat ; Boucle principale

xxx=Cos(ii)*45+Sin(ii2)*40
yyy=Sin(uu)*45-Cos(uu2)*40
decx.f=Cos(ii)/18+Sin(uu2)/15

ExamineMouse() 
xmouse=Cos(sphii)*rayonx+Sin(sphii2)*rayonx
ymouse=Sin(sphuu)*rayony+Cos(sphuu2)*rayony

xx2021=xx+xmouse
yy2021=yy+ymouse

;MouseLocate(xx2021,yy2021)
; xx=MouseX()
; yy=MouseY()
; Debug xx
; Debug yy
; End



If MouseButton(#PB_MouseButton_Left)<>0
s+1:If s>=60:s-60:m+1:EndIf:If m=60:m=0:h+1:EndIf:If h=12:h=0:EndIf
Else
h=Hour(Date()):m=Minute(Date()):s=Second(Date())
EndIf

If MouseButton(#PB_MouseButton_Right)<>0
sphiii.f=Random(1000)/200000
sphuuu.f=Random(1000)/200000
sphiii2.f=Random(1000)/200000
sphuuu2.f=Random(1000)/200000
EndIf


;*****
ClearScreen(0)
StartDrawing(ScreenOutput()) 
;;;;;;;;;;;
ss.f=decx+s/pis
mm.f=decx+(m+s/60)/pim
hh.f=decx+(h+m/60)/pih
For i=0 To 11
If i=0 Or i=3 Or i=6 Or i=9
co=RGB(255,255,255)
Else
co=RGB(100,100,100)
EndIf
For u=1 To 5
  sphx=xx2021+Sin(decx+i/pih)*(echp+xxx)+Random(6)-3 ;;;;;;;;;;;;xx
  sphy=yy2021-Cos(decx+i/pih)*(echp+yyy)+Random(6)-3 ;;;;;;;;;;;;yy
  
  If sphx<0
  sphx=(sphx*-1)/2
  EndIf
  If sphx>=dw
    sphx=dw-1-Abs(dw-sphx)/2
  EndIf
  
  If sphy<0
  sphy=(sphy*-1)/2
  EndIf
  If sphy>=dh
    sphy=dh-1-Abs(dh-sphy)/2
  EndIf
  
  Plot(sphx,sphy,co)
Next
Next


x1=Sin(mm)*(echm+xxx)
y1=-Cos(mm)*(echm+yyy)
;Line(xx,yy,x1,y1,RGB(200,200,0))
dist=Sqr(x1*x1+y1*y1)
xx1.f=x1/dist
yy1.f=y1/dist
xx2.f=xx2021;;;;;;;xx
yy2.f=yy2021;;;;;;;yy
u=0
r=255;Random(255)
For i=0 To dist/3
  sphx=xx2-u/32+Random(u/16)
  sphy=yy2-u/32+Random(u/16)
  If sphx<0
  sphx=(sphx*-1)/2
  EndIf
  If sphx>=dw
    sphx=dw-1-Abs(dw-sphx)/2
  EndIf
  
  If sphy<0
  sphy=(sphy*-1)/2
  EndIf
  If sphy>=dh
    sphy=dh-1-Abs(dh-sphy)/2
  EndIf
  
Plot(sphx,sphy,RGB(r,r,0))
xx2+xx1
yy2+yy1
u+2
Next
r=255;Random(255)
For i=0 To dist/2
  u-1
    sphx=xx2-u/32+Random(u/16)
  sphy=yy2-u/32+Random(u/16)
  If sphx<0
  sphx=(sphx*-1)/2
  EndIf
  If sphx>=dw
    sphx=dw-1-Abs(dw-sphx)/2
  EndIf
  
  If sphy<0
  sphy=(sphy*-1)/2
  EndIf
  If sphy>=dh
    sphy=dh-1-Abs(dh-sphy)/2
  EndIf
  
Plot(sphx,sphy,RGB(r,r,0))
xx2+xx1
yy2+yy1
Next


x1=Sin(hh)*(echm+xxx)
y1=-Cos(hh)*(echm+yyy)
dist=Sqr(x1*x1+y1*y1)
xx1.f=x1/dist
yy1.f=y1/dist
xx2.f=xx2021;;;;;;;xx
yy2.f=yy2021;;;;;;;yy
u=0
r=255;Random(255)
For i=0 To dist/8
    sphx=xx2-u/8+Random(u/4)
  sphy=yy2-u/8+Random(u/4)
  If sphx<0
  sphx=(sphx*-1)/2
  EndIf
  If sphx>=dw
    sphx=dw-1-Abs(dw-sphx)/2
  EndIf
  
  If sphy<0
  sphy=(sphy*-1)/2
  EndIf
  If sphy>=dh
    sphy=dh-1-Abs(dh-sphy)/2
  EndIf
  
Plot(sphx,sphy,RGB(r,20,r/3))
xx2+xx1
yy2+yy1
u+2
Next
r=255;Random(255)
For i=0 To dist/4
u-1
    sphx=xx2-u/8+Random(u/4)
  sphy=yy2-u/8+Random(u/4)
  If sphx<0
  sphx=(sphx*-1)/2
  EndIf
  If sphx>=dw
    sphx=dw-1-Abs(dw-sphx)/2
  EndIf
  
  If sphy<0
  sphy=(sphy*-1)/2
  EndIf
  If sphy>=dh
    sphy=dh-1-Abs(dh-sphy)/2
  EndIf
  
Plot(sphx,sphy,RGB(r,20,r/3))
xx2+xx1
yy2+yy1
Next

x1=Sin(ss)*(echm+xxx)
y1=-Cos(ss)*(echm+yyy)
dist=Sqr(x1*x1+y1*y1)
xx1.f=x1/dist
yy1.f=y1/dist
xx2.f=xx2021-2;;;;;;;xx-2
yy2.f=yy2021-2;;;;;;;yy-2
For i=0 To dist
If Random(2)=1
    sphx=xx2+Random(4)
  sphy=yy2+Random(4)
  If sphx<0
  sphx=(sphx*-1)/2
  EndIf
  If sphx>=dw
    sphx=dw-1-Abs(dw-sphx)/2
  EndIf
  
  If sphy<0
  sphy=(sphy*-1)/2
  EndIf
  If sphy>=dh
    sphy=dh-1-Abs(dh-sphy)/2
  EndIf
  
Plot(sphx,sphy,RGB(0,0,255))
EndIf
xx2+xx1
yy2+yy1
Next

;ii+0.024
;uu+0.0189
;ii2+0.013
;uu2+0.021
ii+0.007
uu+0.0059
ii2+0.0043
uu2+0.0031

sphii.f+sphiii.f
sphuu.f+sphuuu.f
sphii2.f+sphiii2.f
sphuu2.f+sphuuu2.f

;Plot(xx,yy,RGB(255,255,255))

;;;;;;;;;;;
StopDrawing() 
;*****

FlipBuffers() 

Delay(1)

ExamineKeyboard() 
Until KeyboardPushed(#PB_Key_All) 
End 

Dernière modification par SPH le dim. 10/oct./2021 16:47, modifié 1 fois.
http://HexaScrabble.com/
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
Avatar de l’utilisateur
Micoute
Messages : 2522
Inscription : dim. 02/oct./2011 16:17
Localisation : 35520 La Mézière

Re: Les horloges de SPH

Message par Micoute »

Superbe.
Microsoft Windows 10 Famille 64 bits : Carte mère : ASRock 970 Extreme3 R2.0 : Carte Graphique NVIDIA GeForce RTX 3080 : Processeur AMD FX 6300 6 cœurs 12 threads 3,50 GHz PB 5.73 PB 6.00 LTS (x64)
Un homme doit être poli, mais il doit aussi être libre !
Avatar de l’utilisateur
Ar-S
Messages : 9472
Inscription : dim. 09/oct./2005 16:51
Contact :

Re: Les horloges de SPH

Message par Ar-S »

J'aime bien ta dernière. Merci du parrtage
~~~~Règles du forum ~~~~
⋅.˳˳.⋅ॱ˙˙ॱ⋅.˳Ar-S ˳.⋅ॱ˙˙ॱ⋅.˳˳.⋅
W11x64 PB 6.x
Section HORS SUJET : ICI
LDV MULTIMEDIA : Dépannage informatique & mes Logiciels PB
UPLOAD D'IMAGES : Uploader des images de vos logiciels
Avatar de l’utilisateur
SPH
Messages : 4722
Inscription : mer. 09/nov./2005 9:53

Les horloges de SPH (V1.0)

Message par SPH »

Je sais, j'avais dit que je ne toucherais plus le code. Mais mon obsession m'a rattrapé : 8O

Code : Tout sélectionner

; SPH(2021)
; PB573

InitSprite() 
InitMouse() 
InitKeyboard() 

;SetPriorityClass_ ( GetCurrentProcess_ (), #IDLE_PRIORITY_CLASS ) 

If ExamineDesktops()
   dw.w=DesktopWidth(0) 
   dh.w=DesktopHeight(0)
   do.b=DesktopDepth(0)
Else 
   dw.w=1024 
   dh.w=768
   do.b=32
EndIf 

OpenScreen(dw,dh,do,"Les horloges de SPH") 


xx=dw/2
yy=dh/2
pis.f=ATan(1)*12.1585
pim.f=ATan(1)*12.1585
pih.f=ATan(1)*2.4317
echp=yy/1.4
;echh=yy/2.4
echm=yy/1.5
col=RGB(33,33,33)
ii.f=Random(20)/100
uu.f=Random(20)/100
ii2.f=Random(20)/100
uu2.f=Random(20)/100

;;;;;;;;;;;
sphii.f=0
sphuu.f=0
sphii2.f=0
sphuu2.f=0
sphiii.f=Random(1000)/200000
sphuuu.f=Random(1000)/200000
sphiii2.f=Random(1000)/200000
sphuuu2.f=Random(1000)/200000
rayonx=dw/5
rayony=dh/6

;;;;;;;;;;;
;;;;;;;;;;;

MouseLocate(xx,yy)

Repeat ; Boucle principale

xxx=Cos(ii)*45+Sin(ii2)*40
yyy=Sin(uu)*45-Cos(uu2)*40
decx.f=Cos(ii)/18+Sin(uu2)/15

ExamineMouse()
x2mouse=MouseX()
y2mouse=MouseY()

xmouse=Cos(sphii)*rayonx+Sin(sphii2)*rayonx
ymouse=Sin(sphuu)*rayony+Cos(sphuu2)*rayony

xx2021=xmouse+x2mouse
yy2021=ymouse+y2mouse



If MouseButton(#PB_MouseButton_Left)<>0
s+1:If s>=60:s-60:m+1:EndIf:If m=60:m=0:h+1:EndIf:If h=12:h=0:EndIf
Else
h=Hour(Date()):m=Minute(Date()):s=Second(Date())
EndIf

If MouseButton(#PB_MouseButton_Right)<>0
sphiii.f=Random(1000)/200000
sphuuu.f=Random(1000)/200000
sphiii2.f=Random(1000)/200000
sphuuu2.f=Random(1000)/200000
EndIf


;*****
ClearScreen(0)
StartDrawing(ScreenOutput()) 
;;;;;;;;;;;
ss.f=decx+s/pis
mm.f=decx+(m+s/60)/pim
hh.f=decx+(h+m/60)/pih
For i=0 To 11
For u=1 To 5
If i=0 Or i=3 Or i=6 Or i=9
co=RGB(255,255,255)
Else
co=RGB(80,80,80)
EndIf

  sphx=xx2021+Sin(decx+i/pih)*(echp+xxx)+Random(6)-3 ;;;;;;;;;;;;xx
  sphy=yy2021-Cos(decx+i/pih)*(echp+yyy)+Random(6)-3 ;;;;;;;;;;;;yy
  
  If sphx<0
    co=RGB(00,80,00)
  sphx=(sphx*-1)/2
  EndIf
  If sphx>=dw
    co=RGB(00,80,00)
    sphx=dw-1-Abs(dw-sphx)/2
  EndIf
  
  If sphy<0
    co=RGB(00,80,00)
  sphy=(sphy*-1)/2
  EndIf
  If sphy>=dh
    co=RGB(00,80,00)
  sphy=dh-1-Abs(dh-sphy)/2
  EndIf
  
  Plot(sphx,sphy,co)
Next
Next


x1=Sin(mm)*(echm+xxx)
y1=-Cos(mm)*(echm+yyy)
;Line(xx,yy,x1,y1,RGB(200,200,0))
dist=Sqr(x1*x1+y1*y1)
xx1.f=x1/dist
yy1.f=y1/dist
xx2.f=xx2021;;;;;;;xx
yy2.f=yy2021;;;;;;;yy
u=0
;r=255;Random(255)
For i=0 To dist/3
  co=RGB(255,255,00)
  sphx=xx2-u/32+Random(u/16)
  sphy=yy2-u/32+Random(u/16)
  If sphx<0
    co=RGB(00,80,00)
  sphx=(sphx*-1)/2
  EndIf
  If sphx>=dw
    co=RGB(00,80,00)
    sphx=dw-1-Abs(dw-sphx)/2
  EndIf
  
  If sphy<0
    co=RGB(00,80,00)
  sphy=(sphy*-1)/2
  EndIf
  If sphy>=dh
    co=RGB(00,80,00)
    sphy=dh-1-Abs(dh-sphy)/2
  EndIf
  
Plot(sphx,sphy,co)
xx2+xx1
yy2+yy1
u+2
Next
;r=255;Random(255)
For i=0 To dist/2
  co=RGB(255,255,00)
  u-1
  sphx=xx2-u/32+Random(u/16)
  sphy=yy2-u/32+Random(u/16)
  If sphx<0
    co=RGB(00,80,00)
  sphx=(sphx*-1)/2
  EndIf
  If sphx>=dw
    co=RGB(00,80,00)
    sphx=dw-1-Abs(dw-sphx)/2
  EndIf
  
  If sphy<0
    co=RGB(00,80,00)
  sphy=(sphy*-1)/2
  EndIf
  If sphy>=dh
    co=RGB(00,80,00)
    sphy=dh-1-Abs(dh-sphy)/2
  EndIf
  
Plot(sphx,sphy,co)
xx2+xx1
yy2+yy1
Next


x1=Sin(hh)*(echm+xxx)
y1=-Cos(hh)*(echm+yyy)
dist=Sqr(x1*x1+y1*y1)
xx1.f=x1/dist
yy1.f=y1/dist
xx2.f=xx2021;;;;;;;xx
yy2.f=yy2021;;;;;;;yy
u=0
;r=255;Random(255)
For i=0 To dist/8
  co=RGB(255,20,86)
  sphx=xx2-u/8+Random(u/4)
  sphy=yy2-u/8+Random(u/4)
  If sphx<0
    co=RGB(00,80,00)
  sphx=(sphx*-1)/2
  EndIf
  If sphx>=dw
    co=RGB(00,80,00)
    sphx=dw-1-Abs(dw-sphx)/2
  EndIf
  
  If sphy<0
    co=RGB(00,80,00)
  sphy=(sphy*-1)/2
  EndIf
  If sphy>=dh
    co=RGB(00,80,00)
    sphy=dh-1-Abs(dh-sphy)/2
  EndIf
  
Plot(sphx,sphy,co)
xx2+xx1
yy2+yy1
u+2
Next
r=255;Random(255)
For i=0 To dist/4
  u-1
    co=RGB(255,20,86)
    sphx=xx2-u/8+Random(u/4)
  sphy=yy2-u/8+Random(u/4)
  If sphx<0
    co=RGB(00,80,00)
  sphx=(sphx*-1)/2
  EndIf
  If sphx>=dw
    co=RGB(00,80,00)
    sphx=dw-1-Abs(dw-sphx)/2
  EndIf
  
  If sphy<0
    co=RGB(00,80,00)
  sphy=(sphy*-1)/2
  EndIf
  If sphy>=dh
    co=RGB(00,80,00)
    sphy=dh-1-Abs(dh-sphy)/2
  EndIf
  
Plot(sphx,sphy,co)
xx2+xx1
yy2+yy1
Next

x1=Sin(ss)*(echm+xxx)
y1=-Cos(ss)*(echm+yyy)
dist=Sqr(x1*x1+y1*y1)
xx1.f=x1/dist
yy1.f=y1/dist
xx2.f=xx2021-2;;;;;;;xx-2
yy2.f=yy2021-2;;;;;;;yy-2
For i=0 To dist
  If Random(2)=1
    co=RGB(86,20,255)
    sphx=xx2+Random(4)
  sphy=yy2+Random(4)
  If sphx<0
    co=RGB(00,80,00)
  sphx=(sphx*-1)/2
  EndIf
  If sphx>=dw
    co=RGB(00,80,00)
    sphx=dw-1-Abs(dw-sphx)/2
  EndIf
  
  If sphy<0
    co=RGB(00,80,00)
  sphy=(sphy*-1)/2
  EndIf
  If sphy>=dh
    co=RGB(00,80,00)
    sphy=dh-1-Abs(dh-sphy)/2
  EndIf
  
Plot(sphx,sphy,co)
EndIf
xx2+xx1
yy2+yy1
Next

;ii+0.024
;uu+0.0189
;ii2+0.013
;uu2+0.021
ii+0.007
uu+0.0059
ii2+0.0043
uu2+0.0031

sphii.f+sphiii.f
sphuu.f+sphuuu.f
sphii2.f+sphiii2.f
sphuu2.f+sphuuu2.f

;Plot(xx,yy,RGB(255,255,255))

;;;;;;;;;;;
StopDrawing() 
;*****

FlipBuffers() 

Delay(1)

ExamineKeyboard() 
Until KeyboardPushed(#PB_Key_All) 
End 

http://HexaScrabble.com/
!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Intel Core i7 4770 64 bits - GTX 650 Ti
Version de PB : 6.00 - 64 bits
Répondre