Page 1 sur 2

...

Publié : dim. 29/août/2004 21:40
par Psycode
...

Publié : dim. 29/août/2004 22:40
par Backup
:oops:

:lol: :lol:

Merci comtois !!


j'ai oublié que le pure prefere travailler avec des sprites !! bien vu ! :D

Publié : dim. 29/août/2004 22:50
par comtois

Code : Tout sélectionner

#scrw = 800 
#scrh = 600 
#scrd = 32 


;-------- Init all needed Stuff -------- 
If InitSprite() = 0 Or InitKeyboard() = 0 Or InitMouse() = 0 
  MessageBox_ (0,"Can't open DirectX 7 or later", "0", #MB_ICONINFORMATION|#MB_OK) 
  End 
EndIf 
If OpenScreen(#scrw,#scrh,#scrd,"0") = 0 
  MessageBox_ (0,"Could not open  screen", "0", #MB_ICONINFORMATION|#MB_OK) 
  End                                                                                      
EndIf 



CreateSprite(0,#scrw,#scrh)
StartDrawing(SpriteOutput(0)) 
Circle(31,31,31,1) 
chaine$="" 
For u= 0 To 63 
  For i=0 To 63 
    If Point (i,u)>0 
      chaine$+"1" 
    Else 
      chaine$+"0" 
    EndIf 
  Next 
Next 
StopDrawing() 

Repeat 
  DisplaySprite(0,0,0)
  x = Random (200) : y = Random (150) 
  x + Random (200) : y + Random (150) 
  x = x + Random (300) : y = y + Random(200) 
  x = x + 50 : y = y + 50 
  pos=1 
  
  StartDrawing(SpriteOutput(0)) 
  zz = Random(5000) + 1000 
  For u= 0 To 63 
    For i=0 To 63 
      a$=Mid(chaine$,pos,1) : pos+1 
      If a$="1" 
        z=Point (x + i,y + u) 
        If z>=0 
          Plot (x + i, y + u, z + zz) 
        EndIf 
      EndIf 
    Next 
  Next 
  StopDrawing() 
  
  FlipBuffers() 
  
  ExamineKeyboard() 
Until KeyboardPushed(#PB_Key_Escape) 

Publié : dim. 29/août/2004 23:06
par Psycode
...

Publié : dim. 29/août/2004 23:38
par Psycode
...

Publié : dim. 29/août/2004 23:56
par Le Soldat Inconnu
bien joué Comtois :wink: tout simple

autre remarque avant que tu ne rale sur la lenteur de ton code :
pourquoi utilises tu une chaine et pas un tableau ? un string est super lent à gérer

et à quoi sert le test If z >= 0
une couleur peut-ête négative ???

il manque la vérification du dépassement de format de la couleur aussi

Code : Tout sélectionner

#scrw = 800
#scrh = 600
#scrd = 32


;- ------- Init all needed Stuff --------
If InitSprite() = 0 Or InitKeyboard() = 0 Or InitMouse() = 0
  MessageBox_ (0, "Can't open DirectX 7 or later", "0", #MB_ICONINFORMATION | #MB_OK)
  End
EndIf
If OpenScreen(#scrw, #scrh, #scrd, "0") = 0
  MessageBox_ (0, "Could not open  screen", "0", #MB_ICONINFORMATION | #MB_OK)
  End
EndIf

Dim Tableau.b(63, 63)

CreateSprite(0, #scrw, #scrh)
StartDrawing(SpriteOutput(0))
  Circle(31, 31, 31, 1)
  For u = 0 To 63
    For i = 0 To 63
      Tableau(u, i) = Point(u, i)
    Next
  Next
StopDrawing()

Repeat
  DisplaySprite(0, 0, 0)
  x = Random(800) : y = Random(600)
  
  StartDrawing(SpriteOutput(0))
    zz = Random(5000)
    For u = 0 To 63
      For i = 0 To 63
        If Tableau(u, i)
          z = Point(x + i, y + u) + zz
          If z > $FFFFFF ; En cas de dépassement de format pour la couleur qui doit être comprise entre 0 et $FFFFFF
            z = z - $FFFFFF
          EndIf
          Plot(x + i, y + u, z)
        EndIf
      Next
    Next
  StopDrawing()
  
  FlipBuffers()
  
  ExamineKeyboard()
Until KeyboardPushed(#PB_Key_Escape)
chez moi, ça va a vu d'oeil 2 fois plus vite sur mon 500mhz

Publié : lun. 30/août/2004 0:06
par Psycode
...

Publié : lun. 30/août/2004 0:07
par Psycode
...

Publié : lun. 30/août/2004 0:09
par Le Soldat Inconnu
et pourquoi tu n'utilse pas la fonction RGB au lieu de faire coulr+zz1+256*(coulv+zz2)+65536*(coulb+zz3))
tu aimes vraiment la complication ... :lol:

Publié : lun. 30/août/2004 0:10
par Psycode
...

Publié : lun. 30/août/2004 0:20
par garzul
:D Et psycode tu aimes le demomaking moi aussi ^^ j'adore sa

Publié : lun. 30/août/2004 0:22
par Psycode
...

Publié : lun. 30/août/2004 0:24
par garzul
:D Cool laquelle ?

Publié : lun. 30/août/2004 0:27
par Psycode
...

Publié : lun. 30/août/2004 0:29
par garzul
:D Je pourrai la voir stp autremtn j'ai coder sa ya au moin 2 semaine c'est une petite demos juste comme sa http://consolpcgame.ifrance.com/consolpcgame/demo.rar dis moi ce que tu en pense et ya pas de musique pas le temps ^^