Page 1 sur 1

vieille idée

Publié : sam. 25/août/2007 13:07
par venom
bonjour a tous,

voila sa fait un petit moment que je suis sur purebasic mais pas assez fort pour réalisé un vieu projet que j'ai en tête .

il s'agie de faire comme le jeux magic light pour ceux qui connaisse.

en faite on a un tableau avec des trous ex:

http://purebasic.myftp.org/files/226/mlight0.bmp.

puis on met des pions de couleurs dans les trous et on allume ex:

http://purebasic.myftp.org/files/226/mlight1.bmp.

voila en gros se que je souhaiterais faire.

et donc comme j'ai eu le temps de reflechir j'ai penser a compiler sa dans un fichier texte avec des 0 et des 1.
je pense que c'est la meilleur methode, a moin que vous avez mieu ?

ce qui donne ceux-ci :

http://www.penguinbyte.com/apps/pbwebst ... mlight.txt

bien evidament par la suite crée un editeur qui va avec :D .

pensez vous que c'est difficile a réalisé ou pas ?

perso je n'est même pas commencer un petit bout de code je préfere demander la meilleur solution et aussi de l'aide avant de me lancer :wink: .

car vu que je ne suis pas déja fort dans la prog de logiciel :? n'en parlons pas coté 2DDrawing :D .

voila j'espert que vous avez bien compris se que je souhaité faire.

cordialement venom


@++

Publié : sam. 25/août/2007 14:07
par Backup
en fait tu veux simuler un tableau de Diode electroluminescente !!


c'est assez simple :D

effectivement tu vas utiliser soit des data soit un fichier text pour ecrire
les diode qui sont allumées, (1) et celle qui sont éteintes (0)

ensuite tu met en place a l'ecran, ton tableau de diode toutes diode eteintes !
(la premiere image)

puis il te faudra avoir la coordonée centrale x,y de chaques "trous" bref de chaques diodes eteintes :D

puis a l'aide d'une fonction "fill" remplissage , tu te mettra au centre de chaqu'une des diodes (grace aux coordonées connus), coordonées que tu peux relever avec un soft de dessin (paint shop pro par ex)

puis tu lira dans ton fichier ou data , si cela correspond a un "1" ou un "0"
si c'est "1", tu remplis avec la couleur que tu veux :D
sinon tu ne touche a rien :D
tu passe a la diode suivante :D

voici la procedure de remplissage :D
(c'est celle qui me sert dans mon pureGolo :D )

Code : Tout sélectionner

; hdc= StartDrawing(ImageOutput())


Procedure remplis(*hdc,x,Y,couleur_remplissage)
    pinceau=CreateSolidBrush_(couleur_remplissage)
    If pinceau
        AncienneBrush = SelectObject_(*hdc,pinceau)
        If AncienneBrush
            ExtFloodFill_(*hdc,x,Y,GetPixel_(*hdc,x,Y),#FLOODFILLSURFACE)
            SelectObject_(*hdc,AncienneBrush)
        EndIf
        DeleteObject_(pinceau)
    EndIf
EndProcedure
pour le reste c'est assez simple non ?

Publié : sam. 25/août/2007 14:10
par venom
merci je vais essayé de voir d'aprés se que tu me dit

par contre bien vu pour les datas :wink: j'y avais pas penser a sa .


@++

Publié : sam. 25/août/2007 14:12
par flaith
ou un truc dans ce genre :

Code : Tout sélectionner

#SCREEN_WIDTH	=	640
#SCREEN_HEIGHT  =	480
#CELL_WIDTH  	=	30
#CELL_HEIGHT 	=	20

Global frame.l

InitSprite()
InitKeyboard()

Procedure flip()                        ;by polux
  FlipBuffers()
  If IsScreenActive()=0
    Repeat
      Delay(25)
      FlipBuffers()
    Until IsScreenActive()
  EndIf
EndProcedure

OpenScreen(#SCREEN_WIDTH,#SCREEN_HEIGHT,32,"XMAS")

Restore map_text
Read gridwidth
Read gridheight
Global Dim grid(gridwidth,gridheight)
For rows=0 To gridheight
	For cols=0 To gridwidth
		Read TheData
		grid(cols,rows)=TheData
	Next
Next

Restore map_heart
Read gridwidth1
Read gridheight1
Global Dim grid_heart(gridwidth1,gridheight1)
For rows=0 To gridheight1
	For cols=0 To gridwidth1
		Read TheData_heart
		grid_heart(cols,rows)=TheData_heart
	Next
Next

CreateSprite (0,#CELL_WIDTH, #CELL_HEIGHT)
CreateSprite (1,#CELL_WIDTH-10, #CELL_HEIGHT)
CreateSprite (2,#CELL_WIDTH-10, #CELL_HEIGHT)
CreateSprite (3,#CELL_WIDTH-10, #CELL_HEIGHT)
CreateSprite (4,#CELL_WIDTH-10, #CELL_HEIGHT)
CreateSprite (5,#CELL_WIDTH-10, #CELL_HEIGHT)

StartDrawing(SpriteOutput(0))
  Ellipse((#CELL_WIDTH/2)  , (#CELL_HEIGHT/2)  , 14, 10, RGB(50,50,100))
  Ellipse((#CELL_WIDTH/2)-2, (#CELL_HEIGHT/2)-2, 10, 7 , RGB(50,50,150))
  Ellipse((#CELL_WIDTH/2)-3, (#CELL_HEIGHT/2)-3, 8 , 4 , RGB(50,50,200))
  Ellipse((#CELL_WIDTH/2)-4, (#CELL_HEIGHT/2)-4, 5 , 2 , RGB(50,50,250))
StopDrawing()

StartDrawing(SpriteOutput(1))
  Box(0,0,19,19,RGB(140,2,54))
  Box(2,2,14,14,RGB(180,2,54))
  Box(4,4,7,7,RGB(210,2,54))
  Box(6,6,3,3,RGB(250,2,54))
StopDrawing()

StartDrawing(SpriteOutput(2))
  Box(0,0,19,19,RGB(140,32,54))
  Box(2,2,14,14,RGB(180,32,54))
  Box(4,4,7,7,RGB(210,32,54))
  Box(6,6,3,3,RGB(250,32,54))
StopDrawing()

StartDrawing(SpriteOutput(3))
  Box(0,0,19,19,RGB(140,72,54))
  Box(2,2,14,14,RGB(180,72,54))
  Box(4,4,7,7,RGB(210,72,54))
  Box(6,6,3,3,RGB(250,72,54))
StopDrawing()

StartDrawing(SpriteOutput(4))
  Box(0,0,19,19,RGB(140,112,54))
  Box(2,2,14,14,RGB(180,112,54))
  Box(4,4,7,7,RGB(210,112,54))
  Box(6,6,3,3,RGB(250,112,54))
StopDrawing()

StartDrawing(SpriteOutput(5))
  Box(0,0,19,19,RGB(140,152,54))
  Box(2,2,14,14,RGB(180,152,54))
  Box(4,4,7,7,RGB(210,152,54))
  Box(6,6,3,3,RGB(250,152,54))
StopDrawing()

frame = 1

Repeat
  ExamineKeyboard()
  ClearScreen(0)
  For rows=0 To gridheight1
	  For cols=0 To gridwidth1
		  TheData_heart=grid_heart(cols,rows)
		  Rand0 = 0 ;Rand(0,2)-1
		  Rand1 = 0 ;Rand(0,2)-1
		
		  Select TheData_heart
			  Case 1:	DisplayTransparentSprite(1, cols*(#CELL_WIDTH-10)+rand0, rows*#CELL_HEIGHT+rand1)
			  Case 2:	DisplayTransparentSprite(2, cols*(#CELL_WIDTH-10)+rand0, rows*#CELL_HEIGHT+rand1)
			  Case 3:	DisplayTransparentSprite(3, cols*(#CELL_WIDTH-10)+rand0, rows*#CELL_HEIGHT+rand1)
			  Case 4:	DisplayTransparentSprite(4, cols*(#CELL_WIDTH-10)+rand0, rows*#CELL_HEIGHT+rand1)
			  Case 5:	DisplayTransparentSprite(5, cols*(#CELL_WIDTH-10)+rand0, rows*#CELL_HEIGHT+rand1)
		  EndSelect

	  Next
  Next

  For rows=0 To gridheight
	  For cols=0 To gridwidth
		  TheData=grid(cols,rows)
		  Rand0 = Random(4)-1
		  Rand1 = Random(4)-1
		
		  Select TheData
			  Case 1:	DisplayTransparentSprite(0, cols*(#CELL_WIDTH-11)+rand0, rows*(#CELL_HEIGHT-8)+rand1)
		  EndSelect 
	  Next
  Next

  frame + 1

  Flip()
Until KeyboardPushed(#PB_Key_Escape)
End

DataSection
map_text:
Data.l 31,23
Data.l 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
Data.l 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
Data.l 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
Data.l 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
Data.l 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
Data.l 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
Data.l 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
Data.l 0,0,1,0,0,0,1,0,1,1,1,1,1,0,1,1,1,1,0,0,1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0,1,2,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,3,2,1,0,0,0
Data.l 0,0,0,0,1,2,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,3,3,2,1,0,0,0,0
Data.l 0,0,0,0,1,1,2,2,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,3,2,2,1,1,0,0,0,0
Data.l 0,0,0,0,0,1,1,1,2,3,4,4,4,4,4,4,4,4,4,4,4,4,3,2,1,1,1,0,0,0,0,0
Data.l 0,0,0,0,0,0,0,1,1,2,3,4,4,4,4,4,4,4,4,4,4,3,2,1,1,0,0,0,0,0,0,0
Data.l 0,0,0,0,0,0,0,0,1,1,2,3,4,4,4,4,4,4,4,4,3,2,1,1,0,0,0,0,0,0,0,0
Data.l 0,0,0,0,0,0,0,0,0,1,1,2,3,4,4,4,4,4,4,3,2,1,1,0,0,0,0,0,0,0,0,0
Data.l 0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,4,4,4,3,2,1,0,0,0,0,0,0,0,0,0,0,0
Data.l 0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,4,3,2,1,0,0,0,0,0,0,0,0,0,0,0,0
Data.l 0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,2,2,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0
Data.l 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0

EndDataSection

Publié : sam. 25/août/2007 14:31
par venom
8O
ouai dans ce genre la fin sa ne sera pas le meme resultat :wink: .

je ne sais pas si c'est bien mais pour l'instant j'ai fait sa

Code : Tout sélectionner

Enumeration
#windows_0
EndEnumeration

If OpenWindow(#windows_0, 0, 0, 310, 310, "PB Light", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
 SetWindowColor(#windows_0, RGB(0,0,0))
  If CreateImage(0, 310, 310)
    If StartDrawing(ImageOutput(0))
       Circle(20,20,10,RGB(0,0,255)) 
       Circle(50,20,10,RGB(0,0,255))
       Circle(80,20,10,RGB(0,0,255))
       Circle(110,20,10,RGB(0,0,255))
       Circle(140,20,10,RGB(0,0,255))
       Circle(170,20,10,RGB(0,0,255))
       Circle(200,20,10,RGB(0,0,255))
       Circle(230,20,10,RGB(0,0,255))
       Circle(260,20,10,RGB(0,0,255))
       Circle(290,20,10,RGB(0,0,255))
       
       Circle(20,50,10,RGB(0,0,255)) 
       Circle(50,50,10,RGB(0,0,255))
       Circle(80,50,10,RGB(0,0,255))
       Circle(110,50,10,RGB(0,0,255))
       Circle(140,50,10,RGB(0,0,255))
       Circle(170,50,10,RGB(0,0,255))
       Circle(200,50,10,RGB(0,0,255))
       Circle(230,50,10,RGB(0,0,255))
       Circle(260,50,10,RGB(0,0,255))
       Circle(290,50,10,RGB(0,0,255))
       
       Circle(20,80,10,RGB(0,0,255)) 
       Circle(50,80,10,RGB(0,0,255))
       Circle(80,80,10,RGB(0,0,255))
       Circle(110,80,10,RGB(0,0,255))
       Circle(140,80,10,RGB(0,0,255))
       Circle(170,80,10,RGB(0,0,255))
       Circle(200,80,10,RGB(0,0,255))
       Circle(230,80,10,RGB(0,0,255))
       Circle(260,80,10,RGB(0,0,255))
       Circle(290,80,10,RGB(0,0,255))
       
       Circle(20,110,10,RGB(0,0,255)) 
       Circle(50,110,10,RGB(0,0,255))
       Circle(80,110,10,RGB(0,0,255))
       Circle(110,110,10,RGB(0,0,255))
       Circle(140,110,10,RGB(0,0,255))
       Circle(170,110,10,RGB(0,0,255))
       Circle(200,110,10,RGB(0,0,255))
       Circle(230,110,10,RGB(0,0,255))
       Circle(260,110,10,RGB(0,0,255))
       Circle(290,110,10,RGB(0,0,255))
       
       Circle(20,140,10,RGB(0,0,255)) 
       Circle(50,140,10,RGB(0,0,255))
       Circle(80,140,10,RGB(0,0,255))
       Circle(110,140,10,RGB(0,0,255))
       Circle(140,140,10,RGB(0,0,255))
       Circle(170,140,10,RGB(0,0,255))
       Circle(200,140,10,RGB(0,0,255))
       Circle(230,140,10,RGB(0,0,255))
       Circle(260,140,10,RGB(0,0,255))
       Circle(290,140,10,RGB(0,0,255))
       
       Circle(20,170,10,RGB(0,0,255)) 
       Circle(50,170,10,RGB(0,0,255))
       Circle(80,170,10,RGB(0,0,255))
       Circle(110,170,10,RGB(0,0,255))
       Circle(140,170,10,RGB(0,0,255))
       Circle(170,170,10,RGB(0,0,255))
       Circle(200,170,10,RGB(0,0,255))
       Circle(230,170,10,RGB(0,0,255))
       Circle(260,170,10,RGB(0,0,255))
       Circle(290,170,10,RGB(0,0,255))
       
       Circle(20,200,10,RGB(0,0,255)) 
       Circle(50,200,10,RGB(0,0,255))
       Circle(80,200,10,RGB(0,0,255))
       Circle(110,200,10,RGB(0,0,255))
       Circle(140,200,10,RGB(0,0,255))
       Circle(170,200,10,RGB(0,0,255))
       Circle(200,200,10,RGB(0,0,255))
       Circle(230,200,10,RGB(0,0,255))
       Circle(260,200,10,RGB(0,0,255))
       Circle(290,200,10,RGB(0,0,255))
       
       Circle(20,230,10,RGB(0,0,255)) 
       Circle(50,230,10,RGB(0,0,255))
       Circle(80,230,10,RGB(0,0,255))
       Circle(110,230,10,RGB(0,0,255))
       Circle(140,230,10,RGB(0,0,255))
       Circle(170,230,10,RGB(0,0,255))
       Circle(200,230,10,RGB(0,0,255))
       Circle(230,230,10,RGB(0,0,255))
       Circle(260,230,10,RGB(0,0,255))
       Circle(290,230,10,RGB(0,0,255))
       
       Circle(20,260,10,RGB(0,0,255)) 
       Circle(50,260,10,RGB(0,0,255))
       Circle(80,260,10,RGB(0,0,255))
       Circle(110,260,10,RGB(0,0,255))
       Circle(140,260,10,RGB(0,0,255))
       Circle(170,260,10,RGB(0,0,255))
       Circle(200,260,10,RGB(0,0,255))
       Circle(230,260,10,RGB(0,0,255))
       Circle(260,260,10,RGB(0,0,255))
       Circle(290,260,10,RGB(0,0,255))
       
       Circle(20,290,10,RGB(0,0,255)) 
       Circle(50,290,10,RGB(0,0,255))
       Circle(80,290,10,RGB(0,0,255))
       Circle(110,290,10,RGB(0,0,255))
       Circle(140,290,10,RGB(0,0,255))
       Circle(170,290,10,RGB(0,0,255))
       Circle(200,290,10,RGB(0,0,255))
       Circle(230,290,10,RGB(0,0,255))
       Circle(260,290,10,RGB(0,0,255))
       Circle(290,290,10,RGB(0,0,255))

      StopDrawing()
    EndIf
  EndIf

  CreateGadgetList(WindowID(0))
    ImageGadget(0, 0, 0, 0, 0, ImageID(0))

  Repeat
    EventID = WaitWindowEvent() 
  Until EventID = #PB_Event_CloseWindow
 
EndIf
End
.

voila


@++

Publié : sam. 25/août/2007 15:04
par flaith
c'est nikel, petite modif pour faire moins de codes :

Code : Tout sélectionner

    If StartDrawing(ImageOutput(0))
      y = 20
      For i = 1 To 10    ;10 lignes
        For x = 20 To 290 Step 30
          Circle(x,y,10,RGB(0,0,255))
        Next x
        y + 30 ;position ligne suivante
      Next i
      StopDrawing()
    EndIf

Publié : sam. 25/août/2007 15:22
par venom
et bien j'y est penser mais c'est pour apres avec les datas je ne voie pas comment dire au prog c quel cercle a moin que tout se fait avec la position ?

c'est pour sa que j'ai penser a faire sa un par un en pensant que sa serais plus simple mais si tu me dit que sa fonctionne comme sa :wink: .
merci



@++

Publié : sam. 25/août/2007 16:16
par Backup
comme ça :D

je suis passé en openwindowscreen !!


Enumeration
     #windows_0
     #image_0
EndEnumeration
InitSprite ()

If OpenWindow ( #windows_0 , 0, 0, 310, 310, "PB Light" , #PB_Window_SystemMenu|#PB_Window_ScreenCentered )
     CreateGadgetList ( WindowID ( #windows_0 ))
    
     If CreateImage ( #image_0 , 310, 310,32)
     EndIf
    
     OpenWindowedScreen ( WindowID ( #windows_0 ), 0, 0, 310, 310, 0, 0, 0)
     Repeat
        EventID = WindowEvent ()
         If StartDrawing ( ImageOutput ( #image_0 ))
            Y = 20
             Restore debut
             For i = 1 To 10 ;10 lignes
                 For x = 20 To 290 Step 30
                     Read etat.b
                     If etat=1
                         Circle (x,Y,10, RGB (255,0,0))
                     Else
                         Circle (x,Y,10, RGB (0,0,255))
                     EndIf
                 Next x
                Y + 30 ;position ligne suivante
             Next i
             StopDrawing ()
         EndIf
        
         If StartDrawing ( ScreenOutput ())
             DrawImage ( ImageID ( #image_0 ),0, 0)
            
             StopDrawing ()
         EndIf
         FlipBuffers ()
         Delay (2)
     Until EventID = #PB_Event_CloseWindow
EndIf
End
    
DataSection
debut:
Data.b 0,0,0,1,1,1,1,0,0,0
Data.b 0,0,1,1,0,0,1,1,0,0
Data.b 0,1,1,0,0,0,0,1,1,0
Data.b 1,1,0,0,0,0,0,0,1,1
Data.b 1,1,1,1,1,1,1,1,1,1
Data.b 1,1,1,1,1,1,1,1,1,1
Data.b 1,0,0,0,0,0,0,0,0,1
Data.b 1,0,0,0,0,0,0,0,0,1
Data.b 1,0,0,0,0,0,0,0,0,1
Data.b 1,0,0,0,0,0,0,0,0,1
EndDataSection

Publié : sam. 25/août/2007 23:38
par Frenchy Pilou
Un casse-tête de ce style?
http://enlights60.feejo-soft.qarchive.org/

Publié : dim. 26/août/2007 17:25
par venom
et bien je vous remercie grandement car vous avez un peut fait tout le travaille :? .

il me reste plus qu'a voir pour un editeur pour compiler en data puis sa sera bon :wink: .

Frenchy Pilou
Un casse-tête de ce style?
et bien c'est vrai j'ai mi sa dans jeux mais je ne compte pas en faire un jeux mais juste un tableau a dessin .

aller un petit exemple de modification :wink: :

Code : Tout sélectionner

Enumeration
#windows_0
EndEnumeration

If OpenWindow(#windows_0, 0, 0, 820, 820, "PB Light", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
 SetWindowColor(#windows_0, RGB(0,0,0))
  If CreateImage(0, 820, 820)
    If StartDrawing(ImageOutput(0))
      y = 20
      For i = 1 To 40   ;10 lignes
        For x = 20 To 800 Step 20
          Read etat.b
           If etat=1
            Circle (x,Y,5, RGB (255,0,0))
           Else
            Circle (x,Y,5, RGB (0,0,60))
           EndIf
        Next x
        y + 20 ;position ligne suivante
      Next i
      StopDrawing()
    EndIf
  EndIf

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