autre Space invalideur

Programmation avancée de jeux en PureBasic
dlolo
Messages : 118
Inscription : ven. 18/févr./2005 16:29

Message par dlolo »

graph100 a écrit :@dlolo

euh... oui j'ai repris le dessin car je ne sais absolument pas dessiner :oops:
si tu veut pas dis le moi je les enleve
au debut le vaisseau etais de gros rectangles bleus
pas génial génial
Non non vas-y y a pas de probleme (moi aussi ch'uis zero en dessin j'ai fait ce petit vaisseau avec un log 3D)
Avatar de l’utilisateur
graph100
Messages : 1318
Inscription : sam. 21/mai/2005 17:50

Message par graph100 »

OK merci :D :D :D

euh ...
avec quel logiciel :?
ca m'eviterai de prendre les dessin des autres :lol:
Dernière modification par graph100 le dim. 10/juil./2005 17:56, modifié 1 fois.
Avatar de l’utilisateur
graph100
Messages : 1318
Inscription : sam. 21/mai/2005 17:50

Message par graph100 »

nouvelle version :

Code : Tout sélectionner

;- str bullet
Structure bullet
  x.l
  y.l
  a.l
  b.l
  arm.l
  type.l
EndStructure

;- str pointfloat
Structure pointfloat
  x.f
  y.f
EndStructure

;- str etoile
Structure star
  x.l
  y.l
  vitesse.l
  lum.l
  sens.l
EndStructure

Case_depart :

;- police
Global FontID1
FontID1 = LoadFont(1, "Arial", 36, #PB_Font_Underline)
Global FontID2
FontID2 = LoadFont(2, "Bookman Old Style", 18)
Global FontID3
FontID3 = LoadFont(3, "Arial", 12, #PB_Font_Underline)
Global FontID4
FontID4 = LoadFont(4, "Bookman Old Style", 16)


;- proc SaveHightScore
Procedure SaveHightScore(filename.s, score, niveau, podium, version.s) ; sauvegarde le score et le niveau des x meilleurs dans un fichier
  Protected place, a, score, podium, filename, name.s, niveau
  
  If OpenFile(0, filename)
    
    If ReadString() <> version
      CloseFile(0)
      If CreateFile(0, filename)
        WriteStringN(version.s)
      EndIf
    EndIf
    
    
    Dim nom.s(podium)
    Dim score.s(podium)
    Dim niveau.s(podium)
    
    place = 0
        
    For a = 1 To podium
      nom(a) = ReadString()
      score(a) = ReadString()
      niveau(a) = ReadString()
      If score > Val(score(a)) And place = 0
        place = a
      EndIf
      If score(a) = "" : score(a) = "0" : EndIf
      If niveau(a) = "" : niveau(a) = "0" : EndIf
    Next
    
    CloseFile(0)
    
    If place <> 0
      name.s = InputRequester("Vous êtes " + Str(place) + " ème", "Entrez votre nom", "")
      For a = podium To 1 Step -1
        If a = place
          nom(a) = name
          score(a) = Str(score)
          niveau(a) = Str(niveau)
        EndIf
        If a > place
          nom(a) = nom(a - 1)
          score(a) = score(a - 1)
          niveau(a) = niveau(a - 1)
        EndIf
      Next
      
      If CreateFile(0, filename)
        WriteStringN(version)
        For a = 1 To podium
          WriteStringN(nom(a))
          WriteStringN(score(a))
          WriteStringN(niveau(a))
        Next
        CloseFile(0)
      EndIf
      
    EndIf
  EndIf
  
  ProcedureReturn place
EndProcedure

;- proc window0
Procedure window0()
  If OpenWindow(0, 0, 0, 600, 300, #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered, "Space")
    If CreateGadgetList(WindowID())
      TextGadget(0, 140, 5, 320, 65, "Space Impact", #PB_Text_Center | #PB_Text_Border)
      SetGadgetFont(0, FontID1)
      TrackBarGadget(1, 5, 155, 590, 35, 0, 19, #PB_TrackBar_Ticks)
      TextGadget(2, 100, 105, 400, 35, "Selectionnez la difficulté:", #PB_Text_Center | #PB_Text_Border)
      SetGadgetFont(2, FontID2)
      TextGadget(3, 5, 190, 50, 20, "+ facile")
      SetGadgetFont(3, FontID3)
      TextGadget(4, 545, 190, 50, 20, "- facile")
      SetGadgetFont(4, FontID3)
      ButtonGadget(5, 165, 215, 270, 40, "Go")
      SetGadgetFont(5, FontID4)
    EndIf
  EndIf
  SetGadgetState(1, 9)
EndProcedure

window0()

Repeat
  event = WaitWindowEvent()
Until event = #pb_event_closewindow Or EventGadgetID() = 5

If event = #pb_event_closewindow : End : EndIf

difficult = GetGadgetState(1)
CloseWindow(0)

;- init general
If InitMouse() = 0 Or InitSprite() = 0 Or InitKeyboard() = 0
  MessageRequester("Error", "Can't open DirectX 7", 0)
  End
EndIf

SetRefreshRate(100)

If OpenWindow(0, 0, 0, 640, 520, #PB_Window_ScreenCentered, "Space") And OpenWindowedScreen(WindowID(), 0, 20, 640, 480, 0, 0, 0) = 0
  MessageRequester("Attention", "l'ecran n'a pas pus être ouvert")
  End
EndIf

If CreateGadgetList(WindowID())
  TextGadget(0, 0, 0, 640, 20, "", #PB_Text_Center | #PB_Text_Border)
  ProgressBarGadget(1, 0, 500, 640, 20, 0, 102, #PB_ProgressBar_Smooth)
EndIf

;- draw sprite
For a = 0 To 2
  If a = 0 : Restore vaisseau : EndIf
  If a = 1 : Restore vaisseau1 : EndIf
  If a = 2 : Restore euro : EndIf
  
  Read width
  Read height
  
  CreateSprite(a, width, height)
  
  If StartDrawing(SpriteOutput(a))
      For y2 = 0 To height - 1
        For x2 = 0 To width - 1
          Read color
          Plot(x2, y2, color)
        Next
      Next
    StopDrawing()
  EndIf
  TransparentSpriteColor(a, 0, 0, 0)
Next

;- init
autorise = 300 - 10 * difficult
az = 0
vie = 480
q = 40
s = 420
bullet = 0
bulletmoi = 0
euro = 0
vitbullet = 2 + difficult / 3
degat = 10
arme = 0
limitvitesse = difficult / 2 + 1
enfonc = 0
vitesse.pointfloat\x = 0
vitesse.pointfloat\Y = 0

Dim bullet.bullet(1010)
Dim bulletmoi.bullet(310)
Dim stars.star(1010)
Dim euro.star(310)


;- proc diplayeuro
Procedure diplayeuro(t1, y1, euro, a, b)
  If euro(euro)\x = 0 And Random(10) = 0
    euro(euro)\x = 24 * t1 + a - 20
    euro(euro)\y = 36 * y1 + b - 34
    euro(euro)\vitesse = Random(2) + 1
    euro = euro + 1
  EndIf
  If euro >= 201 : euro = 0 : EndIf
  ProcedureReturn euro
EndProcedure

;- etoile init
star = 0
For a = 0 To 480 Step 2
  For b = 0 To 2
    stars(star)\x = Random(640)
    stars(star)\y = a
    stars(star)\vitesse = Random(3) + 1
    stars(star)\lum = Random(255)
    stars(star)\sens = Random(11) - 6
    star = star + 1
  Next
Next

debut :
az = az + 1
az1.f = az * 2 / 10
If az1 = 0 : vitbullet = vitbullet + 1 : EndIf
DataSection
  niv1 :
    Data.l 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
    Data.l 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
    Data.l 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
  deplacement :
    Data.l - 1, 270, 270, -1, 270, -1
    Data.l 80, 80, -1, -1, 80, -1
EndDataSection

Dim vais(15, 3)
Dim deplacementx(6)
Dim deplacementy(6)

Restore niv1

For ligne = 1 To 3
  For colonne = 1 To 15
    Read z
    vais(colonne, ligne) = z * az
  Next
Next

Restore deplacement

For a = 1 To 6
  Read deplacementx(a)
Next
For a = 1 To 6
  Read deplacementy(a)
Next

a = -1
b = -150
c = 1
win = 0

Repeat
  event = WindowEvent()
  Delay(2)
  ExamineKeyboard()
  ClearScreen(0, 0, 0)
  restant = 0
  For g = 1 To 3
    For h = 1 To 15
      
      ;- ennemis
      If vais(h, g) >= 1
        restant = restant + 1
        DisplayTransparentSprite(1, 24 * h + a - 20, 36 * g + b - 34)
        
        If Random(autorise) = 0 And bullet(bullet)\x = 0
          If Random(1) = 0
            bullet(bullet)\x = 24 * h + a - 10
            bullet(bullet)\y = 36 * g + b - 4
            bullet(bullet)\a = (Random(2) - 1) * vitbullet / 2
            bullet(bullet)\arm = 0
            bullet = bullet + 1
            If bullet >= 1001 : bullet = 1 : EndIf
          Else
            bullet(bullet)\x = 24 * h + a - 20
            bullet(bullet)\y = 36 * g + b - 4
            bullet(bullet)\a = 0
            bullet(bullet)\arm = 1
            bullet = bullet + 1
            If bullet >= 1001 : bullet = 1 : EndIf
            If bullet(bullet)\x = 0
              bullet(bullet)\x = 24 * h + a
              bullet(bullet)\y = 36 * g + b - 4
              bullet(bullet)\a = 0
              bullet(bullet)\arm = 1
              bullet = bullet + 1
              If bullet >= 1001 : bullet = 1 : EndIf
            EndIf
          EndIf
        EndIf
        
      EndIf
      
      ;- explosion
      If vais(h, g) <= 0 And vais(h, g) > - 15
        If StartDrawing(ScreenOutput())
            For ae = 1 To 40
              Repeat
                xplot = 24 * h + a - 22 + Random(34)
                yplot = 36 * g + b - 36 + Random(34)
                xplota = (xplot - (24 * h + a - 11)) * (xplot - (24 * h + a - 11))
                yplota = (yplot - (36 * g + b - 20)) * (yplot - (36 * g + b - 20))
              Until Sqr(xplota + yplota) < 15
              Circle(xplot, yplot, 1, RGB(255, Random(255), 0))
            Next
          StopDrawing()
        EndIf
        vais(h, g) = vais(h, g) - 1
      EndIf
      
    Next
  Next
  
  viereste.f = (vie / 480) * 100
  SetGadgetText(0, "Niveau = " + Str(az) + "        Ennemis vaincus = " + Str(45 * az - restant) + "        Vie restante = " + Str(viereste) + "%")
  SetGadgetState(1, enfonc)
  
  ;- display euro
  For z = 1 To 300
    If euro(z)\x
      DisplayTransparentSprite(2, euro(z)\x, euro(z)\y)
      euro(z)\y = euro(z)\y + euro(z)\vitesse
      If euro(z)\y > 485
        euro(z)\x = 0
      ElseIf SpritePixelCollision(0, q, s, 2, euro(z)\x, euro(z)\y)
        euro(z)\x = 0
        vie = vie + 5
        If vie > 480 : vie = 480 : EndIf
      EndIf
    EndIf
  Next
  
  If StartDrawing(ScreenOutput())
      
      ;- etoile fond
      For z = 0 To 1000
        Circle(stars(z)\x, stars(z)\y, 1, RGB(stars(z)\lum, stars(z)\lum, stars(z)\lum))
        stars(z)\lum = stars(z)\lum + stars(z)\sens
        stars(z)\y = stars(z)\y + stars(z)\vitesse
        If stars(z)\y > 480
          stars(z)\x = Random(640)
          stars(z)\y = 0
          stars(z)\vitesse = Random(3) + 1
        EndIf
        If stars(z)\lum > 248 Or stars(z)\lum < 7 : stars(z)\sens = -stars(z)\sens : EndIf
      Next
      
      ;- vie
      vert.f = ((vie / 480) * 255)
      Box(633, 480, 7, -vie, RGB(99, vert, 156))
      
    StopDrawing()
  EndIf
  
  ;- tir moi
  For z = 1 To 300
    If bulletmoi(z)\x <> 0
      If bulletmoi(z)\type = 0
        CreateSprite(3, 2, 6)
        If StartDrawing(SpriteOutput(3))
            Box(0, 0, 2, 2, RGB($FF, $28, $00))
            Box(0, 2, 2, 2, RGB($FF, $6D, $00))
            Box(0, 4, 2, 2, RGB($FF, $9E, $00))
          StopDrawing()
        EndIf
        DisplaySprite(3, bulletmoi(z)\x - 1, bulletmoi(z)\y)
      ElseIf bulletmoi(z)\type = 1
        CreateSprite(3, bulletmoi(z)\arm * 4, bulletmoi(z)\arm * 4)
        If StartDrawing(SpriteOutput(3))
            DrawingMode(0)
            For ar = bulletmoi(z)\arm To 0 Step -1
              Circle(bulletmoi(z)\arm * 2, bulletmoi(z)\arm * 2, ar * 2, RGB(255, ar * 10, 0))
            Next
            DrawingMode(0)
          StopDrawing()
        EndIf
        TransparentSpriteColor(3, 0, 0, 0)
        DisplayTransparentSprite(3, bulletmoi(z)\x - bulletmoi(z)\arm * 2, bulletmoi(z)\y - bulletmoi(z)\arm * 2)
      EndIf
      
      If bulletmoi(z)\type = 0
      
        For g = 1 To 3
          For h = 1 To 15
            If vais(h, g) > 0
              x = 24 * h + a - 20
              y = 36 * g + b - 34
              If SpritePixelCollision(1, x, y, 3, bulletmoi(z)\x - 1, bulletmoi(z)\y)
                bulletmoi(z)\x = 0
                vais(h, g) = vais(h, g) - bulletmoi(z)\arm - 1
                If vais(h, g) <= 0 : euro = diplayeuro(h, g, euro, a, b) : EndIf
              EndIf
            EndIf
          Next
        Next
        
      ElseIf bulletmoi(z)\type = 1
        For g = 1 To 3
          For h = 1 To 15
            If vais(h, g) > 0
              If SpritePixelCollision(1, 24 * h + a - 20, 36 * g + b - 34, 3, bulletmoi(z)\x - bulletmoi(z)\arm * 2, bulletmoi(z)\y - bulletmoi(z)\arm * 2)
                vais(h, g) = vais(h, g) - bulletmoi(z)\arm
                If vais(h, g) <= 0 : vais(h, g) = 0 : euro = diplayeuro(h, g, euro, a, b) : EndIf
                bulletmoi(z)\arm = bulletmoi(z)\arm - 5 
                If bulletmoi(z)\arm <= 0
                  bulletmoi(z)\x = 0
                EndIf
              EndIf              
            EndIf
          Next
        Next
        
      EndIf
      bulletmoi(z)\y = bulletmoi(z)\y + bulletmoi(z)\b
      bulletmoi(z)\x = bulletmoi(z)\x + bulletmoi(z)\a
    EndIf
    If bulletmoi(z)\y < - 2 Or bulletmoi(z)\x < 5 Or bulletmoi(z)\x > 650
      bulletmoi(z)\x = 0
      bulletmoi(z)\type = 0
    EndIf
  Next
  
  If StartDrawing(ScreenOutput())
      
      ;- tir ennemis
      For z = 1 To 1000
        If bullet(z)\x <> 0
          Box(bullet(z)\x - 1, bullet(z)\y, 2, 2, RGB($00, $18, $FF))
          Box(bullet(z)\x - 1, bullet(z)\y - 2, 2, 2, RGB($00, $82, $FF))
          Box(bullet(z)\x - 1, bullet(z)\y - 4, 2, 2, RGB($00, $DF, $FF))
        EndIf
        If bullet(z)\x + 2 > q And bullet(z)\x - 2 < q + 19 And bullet(z)\y + 2 > s And bullet(z)\y - 2 < s + 29
          vie = vie - degat * (bullet(z)\arm + 1)
          bullet(z)\x = 0
          If vie <= 0
            mort = 45 * az - restant
            MessageRequester("Dommage", "Vous avez perdu")
            win = 2
            Gosub perdu
          EndIf
        Else
          bullet(z)\y = bullet(z)\y + vitbullet
          bullet(z)\x = bullet(z)\x + bullet(z)\a
        EndIf
        If bullet(z)\y > 480 Or bullet(z)\x <= 5 Or bullet(z)\x >= 630 
          bullet(z)\x = 0
        EndIf
        If win = 2 : Break : EndIf
      Next
      
      If restant = 0
        win = 1
      EndIf
      
    StopDrawing()
  EndIf
  DisplayTransparentSprite(0, q, s)
  FlipBuffers()
  
  ;- deplacement ennemis
  If b <= -2
    b = b + 2
  Else
    e = deplacementx(c)
    f = deplacementy(c)
    If (a = e Or a = e + 1) And (b = f Or b = f + 1) : c = c + 1 : EndIf
    If c = 7 : c = 1 : EndIf
    If a <> e And a <> e + 1 : a = a + 2 * (Abs(e) / e) : EndIf
    If b <> f And b <> f + 1 : b = b + 2 * (Abs(f) / f) : EndIf
  EndIf
  
  
  ;- deplacement
  delai = delai - 1
  If KeyboardPushed(#pb_key_left)
    If vitesse\x > - limitvitesse : vitesse\x = vitesse\x - 0.4 : EndIf
  EndIf
  If KeyboardPushed(#pb_key_right)
    If vitesse\x < limitvitesse : vitesse\x = vitesse\x + 0.4 : EndIf
  EndIf
  If KeyboardPushed(#pb_key_up)
    If vitesse\y > - limitvitesse : vitesse\y = vitesse\y - 0.4 : EndIf
  EndIf
  If KeyboardPushed(#pb_key_down)
    If vitesse\y < limitvitesse : vitesse\y = vitesse\y + 0.4 : EndIf
  EndIf
  
  q = q + vitesse\x
  s = s + vitesse\y
  If vitesse\x < 0 : vitesse\x = vitesse\x + 0.2 : EndIf
  If vitesse\x > 0 : vitesse\x = vitesse\x - 0.2 : EndIf
  If vitesse\y < 0 : vitesse\y = vitesse\y + 0.2 : EndIf
  If vitesse\y > 0 : vitesse\y = vitesse\y - 0.2 : EndIf
  
  If q < 5 : q = 5 : EndIf
  If q > 600 : q = 600 : EndIf
  If s < 250 : s = 250 : EndIf
  If s > 445 : s = 445 : EndIf
  
  If KeyboardPushed(#PB_Key_1) : arme = 0 : enfonc = 0 : EndIf
  If KeyboardPushed(#PB_Key_2) : arme = 1 : enfonc = 0 : EndIf
  If KeyboardPushed(#PB_Key_3) : arme = 2 : enfonc = 0 : EndIf
  If KeyboardPushed(#PB_Key_4) : arme = 3 : enfonc = 0 : EndIf
  If KeyboardPushed(#pb_key_space) = 0 And arme = 3 And enfonc <> 0
    If enfonc > 102 : enfonc = 102 : EndIf
    bulletmoi(bulletmoi)\x = q + 10
    bulletmoi(bulletmoi)\y = s
    bulletmoi(bulletmoi)\a = 0
    bulletmoi(bulletmoi)\b = -1.2 * vitbullet
    bulletmoi(bulletmoi)\arm = enfonc / 2
    bulletmoi(bulletmoi)\type = 1
    enfonc = 0
    bulletmoi = bulletmoi + 1
    If bulletmoi >= 301 : bulletmoi = 1 : EndIf
  EndIf
  If KeyboardPushed(#pb_key_space) And bulletmoi(bulletmoi)\x = 0 And delai <= 0
    If arme = 0
      bulletmoi(bulletmoi)\x = q + 10
      bulletmoi(bulletmoi)\y = s
      bulletmoi(bulletmoi)\a = 0
      bulletmoi(bulletmoi)\b = -vitbullet
      bulletmoi(bulletmoi)\arm = 0
      bulletmoi = bulletmoi + 1
      If bulletmoi >= 301 : bulletmoi = 1 : EndIf
      delai = 5
    EndIf
    If arme = 1
      bulletmoi(bulletmoi)\x = q
      bulletmoi(bulletmoi)\y = s
      bulletmoi(bulletmoi)\a = 0
      bulletmoi(bulletmoi)\b = -vitbullet
      bulletmoi(bulletmoi)\arm = 1
      bulletmoi = bulletmoi + 1
      If bulletmoi >= 301 : bulletmoi = 1 : EndIf
      If bulletmoi(bulletmoi)\x = 0
        bulletmoi(bulletmoi)\x = q + 20
        bulletmoi(bulletmoi)\y = s
        bulletmoi(bulletmoi)\a = 0
        bulletmoi(bulletmoi)\b = -vitbullet
        bulletmoi(bulletmoi)\arm = 1
        bulletmoi = bulletmoi + 1
        If bulletmoi >= 301 : bulletmoi = 1 : EndIf
      EndIf
      delai = 5
    EndIf
    If arme = 2
      bulletmoi(bulletmoi)\x = q + 10
      bulletmoi(bulletmoi)\y = s
      bulletmoi(bulletmoi)\a = 0
      bulletmoi(bulletmoi)\b = -vitbullet
      bulletmoi(bulletmoi)\arm = 2
      bulletmoi = bulletmoi + 1
      If bulletmoi >= 301 : bulletmoi = 1 : EndIf
      If bulletmoi(bulletmoi)\x = 0
        bulletmoi(bulletmoi)\x = q + 10
        bulletmoi(bulletmoi)\y = s
        bulletmoi(bulletmoi)\a = -2
        bulletmoi(bulletmoi)\b = -vitbullet
        bulletmoi(bulletmoi)\arm = 2
        If bulletmoi >= 301 : bulletmoi = 1 : EndIf
        bulletmoi = bulletmoi + 1
      EndIf
      If bulletmoi(bulletmoi)\x = 0
        bulletmoi(bulletmoi)\x = q + 10
        bulletmoi(bulletmoi)\y = s
        bulletmoi(bulletmoi)\a = 2
        bulletmoi(bulletmoi)\b = -vitbullet
        bulletmoi(bulletmoi)\arm = 2
        bulletmoi = bulletmoi + 1
        If bulletmoi >= 301 : bulletmoi = 1 : EndIf
      EndIf
      delai = 5
    EndIf
    If arme = 3
      enfonc = enfonc + 1
    EndIf
  EndIf
  
Until KeyboardPushed(#pb_key_escape) Or win <> 0

perdu :

If win = 2 Or KeyboardPushed(#pb_key_escape)
  CloseScreen()
  CloseWindow(0)
  
  SaveHightScore("Space.pref", mort, az, 10, "  3.02")
  
  If OpenFile(0, "Space.pref")
    If OpenWindow(1, 0, 0, 380, 390, #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered, "Space Meilleurs Scores" + ReadString()) And CreateGadgetList(WindowID())
      TextGadget(1, 20, 20, 200, 17, "PLACE : NOM")
      TextGadget(1, 240, 20, 50, 17, "SCORE")
      TextGadget(1, 310, 20, 50, 17, "NIVEAU")
      For aze = 1 To 10
        TextGadget(0, 20, aze * 30 + 20, 200, 17, Str(aze) + "  :  " + ReadString(), #PB_Text_Border)
        TextGadget(0, 240, aze * 30 + 20, 50, 17, ReadString(), #PB_Text_Border | #PB_Text_Right)
        TextGadget(0, 310, aze * 30 + 20, 50, 17, ReadString(), #PB_Text_Border | #PB_Text_Right)
      Next
      CloseFile(0)
      ButtonGadget(4, 20, 350, 160, 20, "REJOUER")
      ButtonGadget(5, 200, 350, 160, 20, "QUITTER")
    EndIf
  EndIf
  
  Repeat
    event = WaitWindowEvent()
    If event = #pb_event_gadget
      Select EventGadgetID()
        Case 4
          CloseWindow(1)
          Gosub Case_depart
        Case 5
          End
      EndSelect
    EndIf
  Until event = #pb_event_closewindow
  
  End
  
EndIf

Gosub debut

Return


DataSection
  ;- vaisseau
  vaisseau :
    Data.l 20, 30
    Data.l 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, 2697257, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3224625, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7563627, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8680827, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8680827, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 1024, 8681860, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 2169880, 9734796, 2697257, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 5392714, 16750228, 7563635, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 1052688, 8089971, 16764886, 8680827, 1052688, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 4868426, 8680827, 16756397, 9207172, 8089979, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 5920090, 7564659, 11377317, 11904685, 11377317, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 526344, 0, 526344, 2697257, 13023933, 4866370, 1052688, 0, 526344, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 3749945, 0, 0, 1580056, 11379373, 3748913, 0, 0, 3749945, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 4343106, 0, 526344, 4340802, 8681860, 11378341, 1052688, 0, 4343106, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 4868426, 1581097, 3748921, 3223601, 15692147, 10261140, 10262172, 2171937, 4868426, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 3225657, 3757411, 4339769, 2170913, 15179420, 9734804, 10854053, 9734796, 7037283, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 3748921, 6514027, 5927291, 4339769, 1053712, 7037283, 10261148, 11904685, 10851996, 10261148, 11904693, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 4867402, 6513003, 5399923, 3222577, 1024, 7561595, 9208460, 10261140, 9207172, 8681851, 11907765, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 1024, 1579032, 1581089, 1052688, 527368, 4866411, 4867402, 3222577, 2697257, 2170913, 526344, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 1024, 4342082, 8089971, 5919058, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 1024, 4867402, 9197923, 14059140, 10846852, 5921114, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 527368, 4867394, 7036259, 14049635, 16748180, 14068397, 9208460, 3748921, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 1024, 4339769, 5920090, 6511971, 6510938, 6510938, 8681851, 8681860, 10260116, 8680836, 10851988, 4340802, 0, 0, 0, 0
    Data.l 0, 0, 0, 527384, 5392714, 6511971, 7563627, 7038315, 4340802, 3748913, 7563635, 8681860, 8088955, 8680827, 10262172, 9735836, 8089971, 8, 0, 0
    Data.l 0, 0, 0, 1024, 1580056, 3749945, 5393746, 5394770, 4340802, 1051664, 5393746, 7037283, 7563635, 7563635, 5394778, 5919058, 3223601, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 526344, 527368, 2170913, 6511971, 4866378, 1052688, 526344, 1024, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 1024, 5920090, 9734804, 9733780, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 1024, 7037283, 10853020, 10853029, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 1024, 1052688, 1024, 0, 0, 0, 0, 0, 0, 0, 0
  
  ;- vaisseau1
  vaisseau1 :
    Data.l 20, 30
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 1024, 1052688, 1024, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 1024, 7037283, 10853020, 10853029, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 1024, 5920090, 9734804, 9733780, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 526344, 527368, 2170913, 6511971, 4866378, 1052688, 526344, 1024, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 1024, 1580056, 3749945, 5393746, 5394770, 4340802, 1051664, 5393746, 7037283, 7563635, 7563635, 5394778, 5919058, 3223601, 0, 0, 0
    Data.l 0, 0, 0, 527384, 5392714, 6511971, 7563627, 7038315, 4340802, 3748913, 7563635, 8681860, 8088955, 8680827, 10262172, 9735836, 8089971, 8, 0, 0
    Data.l 0, 0, 0, 0, 1024, 4339769, 5920090, 6511971, 6510938, 6510938, 8681851, 8681860, 10260116, 8680836, 10851988, 4340802, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 527368, 4867394, 7036259, 14049635, 16748180, 14068397, 9208460, 3748921, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 1024, 4867402, 9197923, 14059140, 10846852, 5921114, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 1024, 4342082, 8089971, 5919058, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 1024, 1579032, 1581089, 1052688, 527368, 4866411, 4867402, 3222577, 2697257, 2170913, 526344, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 4867402, 6513003, 5399923, 3222577, 1024, 7561595, 9208460, 10261140, 9207172, 8681851, 11907765, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 3748921, 6514027, 5927291, 4339769, 1053712, 7037283, 10261148, 11904685, 10851996, 10261148, 11904693, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 3225657, 3757411, 4339769, 2170913, 15179420, 9734804, 10854053, 9734796, 7037283, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 4868426, 1581097, 3748921, 3223601, 15692147, 10261140, 10262172, 2171937, 4868426, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 4343106, 0, 526344, 4340802, 8681860, 11378341, 1052688, 0, 4343106, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 3749945, 0, 0, 1580056, 11379373, 3748913, 0, 0, 3749945, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 526344, 0, 526344, 2697257, 13023933, 4866370, 1052688, 0, 526344, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 5920090, 7564659, 11377317, 11904685, 11377317, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 4868426, 8680827, 16756397, 9207172, 8089979, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 1052688, 8089971, 16764886, 8680827, 1052688, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 5392714, 16750228, 7563635, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 2169880, 9734796, 2697257, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 1024, 8681860, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8680827, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8680827, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7563627, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3224625, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2697257, 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
  
  ;- euro
  euro :
    Data.l 17, 17
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 16711680, 16776960, 16711680, 16776960, 16711680, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 0, 0
    Data.l 0, 0, 0, 0, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 0
    Data.l 0, 0, 0, 0, 16711680, 16776960, 16711680, 16776960, 0, 0, 0, 0, 0, 0, 16711680, 16776960, 0
    Data.l 0, 0, 0, 16711680, 16776960, 16711680, 16776960, 0, 0, 0, 0, 0, 0, 0, 16776960, 16711680, 0
    Data.l 0, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 0, 0, 0, 0, 0, 0
    Data.l 0, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 16776960, 16711680, 16776960, 16711680, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 0, 0, 0, 0, 0, 0
    Data.l 0, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 16711680, 16776960, 16711680, 16776960, 0, 0, 0, 0, 0, 0, 0, 16776960, 16711680, 0
    Data.l 0, 0, 0, 0, 16711680, 16776960, 16711680, 16776960, 0, 0, 0, 0, 0, 0, 16711680, 16776960, 0
    Data.l 0, 0, 0, 0, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 0
    Data.l 0, 0, 0, 0, 0, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 16711680, 16776960, 16711680, 16776960, 16711680, 0, 0, 0, 0
EndDataSection

voila
:D :D
comtois
Messages : 5186
Inscription : mer. 21/janv./2004 17:48
Contact :

Message par comtois »

se faire attaquer par des euros , tu aurais pu prendre une autre monnaie :)
Dr. Dri
Messages : 2527
Inscription : ven. 23/janv./2004 18:10

Message par Dr. Dri »

Tout bonnement génial !
l'arme 4 est finalement très bien pensée !

Dri
Avatar de l’utilisateur
graph100
Messages : 1318
Inscription : sam. 21/mai/2005 17:50

Message par graph100 »

comtois a écrit :se faire attaquer par des euros , tu aurais pu prendre une autre monnaie :)
:lol: Comment ca ?? :lol:

t'a pas vu que quand tu touche un euro ca te rajoute 1% de vie :D

j'ai fait ca en attendant de faire un magasin pour les armes :)
normalement on les a pas toute au debut :lol:
dlolo
Messages : 118
Inscription : ven. 18/févr./2005 16:29

Message par dlolo »

graph100 a écrit :avec quel logiciel :?
ca m'eviterai de prendre les dessin des autres :lol:
Peu importe le logiciel, il suffit de pouvoir sauvegarder le rendu en bmp.

J'ai testé ton jeu et effectivement, comme Dri, je trouve l'arme 4 très bien. On avait déjà vu ce système dans R-Type mais pas la boule qui diminue en fonction des ennemis qu'elle touche, bonne idée.

PS

- la fenêtre des meilleurs scores est bugguée chez moi
- on écrit "highscore" et non pas "hightscore" :wink:
Avatar de l’utilisateur
graph100
Messages : 1318
Inscription : sam. 21/mai/2005 17:50

Message par graph100 »

a la la :oops:
l'orthographe ....

comment buggée ? elle s'afiche pas ? :roll:
j'ai modifiée la sauvegarde
maintenant les highscores sont effacé quand ce n'est pas la meme version
Avatar de l’utilisateur
graph100
Messages : 1318
Inscription : sam. 21/mai/2005 17:50

Message par graph100 »

version suivante :D

Code : Tout sélectionner

;- str bullet
Structure bullet
  x.l
  y.l
  a.l
  b.l
  arm.l
  type.l
EndStructure

;- str pointfloat
Structure pointfloat
  x.f
  y.f
EndStructure

;- str etoile
Structure star
  x.l
  y.l
  vitesse.l
  lum.l
  sens.l
EndStructure

Case_depart :

;- police

Global FontID5
FontID5 = LoadFont(1, "Arial Black", 10, #PB_Font_Underline)
Global FontID6
FontID6 = LoadFont(2, "Arial Black", 11)


;- proc window2
Procedure Window2()
  If OpenWindow(2, 301, 123, 534, 296, 0, "Space - Magasin")
    If CreateGadgetList(WindowID())
      TextGadget(0, 25, 5, 65, 20, "Thunes :")
      SetGadgetFont(0, FontID5)
      TextGadget(1, 100, 5, 95, 20, "")
      TextGadget(0, 25, 30, 65, 20, Chr(201) + "nergie :")
      SetGadgetFont(0, FontID5)
      TextGadget(13, 100, 30, 95, 20, "")
      OptionGadget(2, 25, 95, 15, 15, "")
      OptionGadget(3, 25, 125, 15, 15, "")
      OptionGadget(4, 25, 155, 15, 15, "")
      OptionGadget(5, 25, 185, 15, 15, "")
      TextGadget(0, 25, 60, 85, 20, "Armement :")
      SetGadgetFont(0, FontID5)
      TextGadget(0, 60, 125, 100, 20, "Canon double")
      SetGadgetFont(0, FontID5)
      TextGadget(0, 60, 95, 100, 20, "Canon")
      SetGadgetFont(0, FontID5)
      TextGadget(0, 60, 155, 100, 20, "Canon triple")
      SetGadgetFont(0, FontID5)
      TextGadget(0, 60, 185, 105, 20, "Accumulateur")
      SetGadgetFont(0, FontID5)
      Frame3DGadget(0, 205, 5, 5, 245, "")
      TextGadget(0, 25, 215, 85, 20, "Puissance :")
      SetGadgetFont(0, FontID5)
      TextGadget(6, 125, 215, 60, 20, "")
      TextGadget(0, 225, 20, 60, 20, "Achat :")
      SetGadgetFont(0, FontID5)
      ButtonGadget(7, 220, 85, 230, 40, "Canon double")
      SetGadgetFont(7, FontID6)
      ButtonGadget(8, 220, 125, 230, 40, "Canon triple")
      SetGadgetFont(8, FontID6)
      ButtonGadget(9, 220, 165, 230, 40, "Accumulateur")
      SetGadgetFont(9, FontID6)
      ButtonGadget(10, 220, 205, 230, 40, "Puissance supplémentaire")
      SetGadgetFont(10, FontID6)
      TextGadget(0, 460, 100, 70, 20, "1000 ")
      SetGadgetFont(0, FontID5)
      TextGadget(0, 460, 140, 65, 20, "5000")
      SetGadgetFont(0, FontID5)
      TextGadget(0, 460, 180, 70, 20, "10000")
      SetGadgetFont(0, FontID5)
      TextGadget(0, 460, 220, 70, 20, "7500")
      SetGadgetFont(0, FontID5)
      ButtonGadget(11, 220, 45, 230, 40, "Vie supplémentaire")
      SetGadgetFont(11, FontID6)
      TextGadget(0, 460, 60, 70, 20, "500")
      SetGadgetFont(0, FontID5)
      ButtonGadget(12, 20, 255, 495, 30, "Continuer")
      SetGadgetFont(12, FontID6)
      
    EndIf
  EndIf
EndProcedure

;- proc SaveHightScore
Procedure SaveHightScore(filename.s, score, niveau, podium, version.s) ; sauvegarde le score et le niveau des x meilleurs dans un fichier
  Protected place, a, score, podium, filename, name.s, niveau
  
  If OpenFile(0, filename)
    
    If ReadString() <> version
      CloseFile(0)
      If CreateFile(0, filename)
        WriteStringN(version.s)
      EndIf
    EndIf
    
    
    Dim nom.s(podium)
    Dim score.s(podium)
    Dim niveau.s(podium)
    
    place = 0
        
    For a = 1 To podium
      nom(a) = ReadString()
      score(a) = ReadString()
      niveau(a) = ReadString()
      If score > Val(score(a)) And place = 0
        place = a
      EndIf
      If score(a) = "" : score(a) = "0" : EndIf
      If niveau(a) = "" : niveau(a) = "0" : EndIf
    Next
    
    CloseFile(0)
    
    If place <> 0
      name.s = InputRequester("Vous êtes " + Str(place) + " ème", "Entrez votre nom", "")
      For a = podium To 1 Step -1
        If a = place
          nom(a) = name
          score(a) = Str(score)
          niveau(a) = Str(niveau)
        EndIf
        If a > place
          nom(a) = nom(a - 1)
          score(a) = score(a - 1)
          niveau(a) = niveau(a - 1)
        EndIf
      Next
      
      If CreateFile(0, filename)
        WriteStringN(version)
        For a = 1 To podium
          WriteStringN(nom(a))
          WriteStringN(score(a))
          WriteStringN(niveau(a))
        Next
        CloseFile(0)
      EndIf
      
    EndIf
  EndIf
  
  ProcedureReturn place
EndProcedure

;- proc window0
Procedure window0()
  If OpenWindow(0, 0, 0, 600, 300, #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered, "Space")
    If CreateGadgetList(WindowID())
      TextGadget(0, 140, 5, 320, 65, "Space Impact", #PB_Text_Center | #PB_Text_Border)
      SetGadgetFont(0, LoadFont(1, "Arial", 36, #PB_Font_Underline))
      TrackBarGadget(1, 5, 155, 590, 35, 0, 19, #PB_TrackBar_Ticks)
      TextGadget(0, 100, 105, 400, 35, "Selectionnez la difficulté:", #PB_Text_Center | #PB_Text_Border)
      SetGadgetFont(0, LoadFont(2, "Bookman Old Style", 18))
      TextGadget(3, 5, 190, 50, 20, "+ facile")
      SetGadgetFont(3, LoadFont(3, "Arial", 12, #PB_Font_Underline))
      TextGadget(4, 545, 190, 50, 20, "- facile")
      SetGadgetFont(4, LoadFont(3, "Arial", 12, #PB_Font_Underline))
      ButtonGadget(5, 165, 215, 270, 40, "Go")
      SetGadgetFont(5, LoadFont(4, "Bookman Old Style", 16))
    EndIf
  EndIf
  SetGadgetState(1, 9)
EndProcedure

window0()

Repeat
  event = WaitWindowEvent()
Until event = #pb_event_closewindow Or EventGadgetID() = 5

If event = #pb_event_closewindow : End : EndIf

difficult = GetGadgetState(1)
CloseWindow(0)

;- init general
If InitMouse() = 0 Or InitSprite() = 0 Or InitKeyboard() = 0
  MessageRequester("Error", "Can't open DirectX 7", 0)
  End
EndIf

SetRefreshRate(60)

If OpenWindow(0, 0, 0, 640, 520, #PB_Window_ScreenCentered, "Space") And OpenWindowedScreen(WindowID(), 0, 20, 640, 480, 0, 0, 0) = 0
  MessageRequester("Attention", "l'ecran n'a pas pus être ouvert")
  End
EndIf

If CreateGadgetList(WindowID())
  TextGadget(14, 0, 0, 640, 20, "", #PB_Text_Center | #PB_Text_Border)
  ProgressBarGadget(1, 0, 500, 640, 20, 0, 102, #PB_ProgressBar_Smooth)
EndIf

;- draw sprite
For a = 0 To 2
  If a = 0 : Restore vaisseau : EndIf
  If a = 1 : Restore vaisseau1 : EndIf
  If a = 2 : Restore euro : EndIf
  
  Read width
  Read height
  
  CreateSprite(a, width, height)
  
  If StartDrawing(SpriteOutput(a))
      For y2 = 0 To height - 1
        For x2 = 0 To width - 1
          Read color
          Plot(x2, y2, color)
        Next
      Next
    StopDrawing()
  EndIf
  TransparentSpriteColor(a, 0, 0, 0)
Next

;- init

arme2 = 0
arme3 = 0
arme4 = 0
autorise = 300 - 10 * difficult
az = 0
vie = 480
q = 40
s = 420
bullet = 0
bulletmoi = 0
euro = 0
vitbullet = 2 + difficult / 3
degat = 10
arme = 0
limitvitesse = difficult / 2 + 1
enfonc = 0
vitesse.pointfloat\x = 0
vitesse.pointfloat\Y = 0

Dim bullet.bullet(1010)
Dim bulletmoi.bullet(310)
Dim stars.star(1010)
Dim euro.star(310)

setcursorpos_(WindowX() + q + 5, WindowY() + s + 50)

;- proc diplayeuro
Procedure diplayeuro(t1, y1, euro, a, b)
  If euro(euro)\x = 0 And Random(10) = 0
    euro(euro)\x = 24 * t1 + a - 20
    euro(euro)\y = 36 * y1 + b - 34
    euro(euro)\vitesse = Random(2) + 1
    euro = euro + 1
  EndIf
  If euro >= 201 : euro = 0 : EndIf
  ProcedureReturn euro
EndProcedure

;- etoile init
star = 0
For a = 0 To 480 Step 2
  For b = 0 To 2
    stars(star)\x = Random(640)
    stars(star)\y = a
    stars(star)\vitesse = Random(3) + 1
    stars(star)\lum = Random(255)
    stars(star)\sens = Random(11) - 6
    star = star + 1
  Next
Next

;- debut
debut :

az = az + 1
az1.f = az * 2 / 10
If az1 = 0 : vitbullet = vitbullet + 1 : EndIf
DataSection
  niv1 :
    Data.l 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
    Data.l 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
    Data.l 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
  deplacement :
    Data.l - 1, 270, 270, -1, 270, -1
    Data.l 80, 80, -1, -1, 80, -1
EndDataSection

Dim vais(15, 3)
Dim deplacementx(6)
Dim deplacementy(6)

Restore niv1

For ligne = 1 To 3
  For colonne = 1 To 15
    Read z
    vais(colonne, ligne) = z * az
  Next
Next

Restore deplacement

For a = 1 To 6
  Read deplacementx(a)
Next
For a = 1 To 6
  Read deplacementy(a)
Next

a = -1
b = -150
c = 1
win = 0

Repeat
  event = WindowEvent()
  Delay(2)
  ExamineKeyboard()
  ClearScreen(0, 0, 0)
  restant = 0
  For g = 1 To 3
    For h = 1 To 15
      
      ;- ennemis
      If vais(h, g) >= 1
        restant = restant + 1
        DisplayTransparentSprite(1, 24 * h + a - 20, 36 * g + b - 34)
        
        If Random(autorise) = 0 And bullet(bullet)\x = 0
          If Random(1) = 0
            bullet(bullet)\x = 24 * h + a - 10
            bullet(bullet)\y = 36 * g + b - 4
            bullet(bullet)\a = (Random(2) - 1) * vitbullet / 2
            bullet(bullet)\arm = 0
            bullet = bullet + 1
            If bullet >= 1001 : bullet = 1 : EndIf
          Else
            bullet(bullet)\x = 24 * h + a - 20
            bullet(bullet)\y = 36 * g + b - 4
            bullet(bullet)\a = 0
            bullet(bullet)\arm = 1
            bullet = bullet + 1
            If bullet >= 1001 : bullet = 1 : EndIf
            If bullet(bullet)\x = 0
              bullet(bullet)\x = 24 * h + a
              bullet(bullet)\y = 36 * g + b - 4
              bullet(bullet)\a = 0
              bullet(bullet)\arm = 1
              bullet = bullet + 1
              If bullet >= 1001 : bullet = 1 : EndIf
            EndIf
          EndIf
        EndIf
        
      EndIf
      
      ;- explosion
      If vais(h, g) <= 0 And vais(h, g) > - 15
        If StartDrawing(ScreenOutput())
            For ae = 1 To 40
              Repeat
                xplot = 24 * h + a - 22 + Random(34)
                yplot = 36 * g + b - 36 + Random(34)
                xplota = (xplot - (24 * h + a - 11)) * (xplot - (24 * h + a - 11))
                yplota = (yplot - (36 * g + b - 20)) * (yplot - (36 * g + b - 20))
              Until Sqr(xplota + yplota) < 15
              Circle(xplot, yplot, 1, RGB(255, Random(255), 0))
            Next
          StopDrawing()
        EndIf
        vais(h, g) = vais(h, g) - 1
      EndIf
      
    Next
  Next
  
  If arme = 0
    courante.s = "canon"
  ElseIf arme = 1
    courante.s = "canon double"
  ElseIf arme = 2
    courante.s = "canon triple"
  ElseIf arme = 3
    courante.s = "accumulateur"
  EndIf
  viereste.f = (vie / 480) * 100
  SetGadgetText(14, "Niveau = " + Str(az) + "        Ennemis vaincus = " + Str(45 * az - restant) + "        Vie restante = " + Str(viereste) + "%" + "        Thunes = " + Str(thune) + " euro        arme actuelle = " + courante)
  SetGadgetState(1, enfonc)
  
  ;- display euro
  For z = 1 To 300
    If euro(z)\x
      DisplayTransparentSprite(2, euro(z)\x, euro(z)\y)
      euro(z)\y = euro(z)\y + euro(z)\vitesse
      If euro(z)\y > 485
        euro(z)\x = 0
      ElseIf SpritePixelCollision(0, q, s, 2, euro(z)\x, euro(z)\y)
        euro(z)\x = 0
        thune = thune + Random(100) + 100
      EndIf
    EndIf
  Next
  
  If StartDrawing(ScreenOutput())
      
      ;- etoile fond
      For z = 0 To 1000
        Circle(stars(z)\x, stars(z)\y, 1, RGB(stars(z)\lum, stars(z)\lum, stars(z)\lum))
        stars(z)\lum = stars(z)\lum + stars(z)\sens
        stars(z)\y = stars(z)\y + stars(z)\vitesse
        If stars(z)\y > 480
          stars(z)\x = Random(640)
          stars(z)\y = 0
          stars(z)\vitesse = Random(3) + 1
        EndIf
        If stars(z)\lum > 248 Or stars(z)\lum < 7 : stars(z)\sens = -stars(z)\sens : EndIf
      Next
      
      ;- vie
      vert.f = ((vie / 480) * 255)
      Box(633, 480, 7, -vie, RGB(99, vert, 156))
      
    StopDrawing()
  EndIf
  
  ;- tir moi
  For z = 1 To 300
    If bulletmoi(z)\x <> 0
      If bulletmoi(z)\type = 0
        CreateSprite(3, 2, 6)
        If StartDrawing(SpriteOutput(3))
            Box(0, 0, 2, 2, RGB($FF, $28, $00))
            Box(0, 2, 2, 2, RGB($FF, $6D, $00))
            Box(0, 4, 2, 2, RGB($FF, $9E, $00))
          StopDrawing()
        EndIf
        DisplaySprite(3, bulletmoi(z)\x - 1, bulletmoi(z)\y)
      ElseIf bulletmoi(z)\type = 1
        CreateSprite(4, bulletmoi(z)\arm * 4, bulletmoi(z)\arm * 4)
        If StartDrawing(SpriteOutput(4))
            DrawingMode(0)
            For ar = bulletmoi(z)\arm To 0 Step -1
              Circle(bulletmoi(z)\arm * 2, bulletmoi(z)\arm * 2, ar * 2, RGB(255, ar * 10, 0))
            Next
            DrawingMode(0)
          StopDrawing()
        EndIf
        TransparentSpriteColor(4, 0, 0, 0)
        DisplayTransparentSprite(4, bulletmoi(z)\x - bulletmoi(z)\arm * 2, bulletmoi(z)\y - bulletmoi(z)\arm * 2)
      EndIf
      
      If bulletmoi(z)\type = 0
      
        For g = 1 To 3
          For h = 1 To 15
            If vais(h, g) > 0
              x = 24 * h + a - 20
              y = 36 * g + b - 34
              If SpritePixelCollision(1, x, y, 3, bulletmoi(z)\x - 1, bulletmoi(z)\y)
                bulletmoi(z)\x = 0
                vais(h, g) = vais(h, g) - bulletmoi(z)\arm - 1
                If vais(h, g) <= 0 : euro = diplayeuro(h, g, euro, a, b) : EndIf
              EndIf
            EndIf
          Next
        Next
        
      ElseIf bulletmoi(z)\type = 1
        For g = 1 To 3
          For h = 1 To 15
            If vais(h, g) > 0
              If SpritePixelCollision(1, 24 * h + a - 20, 36 * g + b - 34, 4, bulletmoi(z)\x - bulletmoi(z)\arm * 2, bulletmoi(z)\y - bulletmoi(z)\arm * 2)
                vais(h, g) = vais(h, g) - bulletmoi(z)\arm
                If vais(h, g) <= 0 : vais(h, g) = 0 : euro = diplayeuro(h, g, euro, a, b) : EndIf
                bulletmoi(z)\arm = bulletmoi(z)\arm - 5 
                If bulletmoi(z)\arm <= 0
                  bulletmoi(z)\x = 0
                EndIf
              EndIf              
            EndIf
          Next
        Next
        
      EndIf
      bulletmoi(z)\y = bulletmoi(z)\y + bulletmoi(z)\b
      bulletmoi(z)\x = bulletmoi(z)\x + bulletmoi(z)\a
    EndIf
    If bulletmoi(z)\y < - 2 Or bulletmoi(z)\x < 5 Or bulletmoi(z)\x > 650
      bulletmoi(z)\x = 0
      bulletmoi(z)\type = 0
    EndIf
  Next
  
  If StartDrawing(ScreenOutput())
      
      ;- tir ennemis
      For z = 1 To 1000
        If bullet(z)\x <> 0
          Box(bullet(z)\x - 1, bullet(z)\y, 2, 2, RGB($00, $18, $FF))
          Box(bullet(z)\x - 1, bullet(z)\y - 2, 2, 2, RGB($00, $82, $FF))
          Box(bullet(z)\x - 1, bullet(z)\y - 4, 2, 2, RGB($00, $DF, $FF))
        EndIf
        If bullet(z)\x + 2 > q And bullet(z)\x - 2 < q + 19 And bullet(z)\y + 2 > s And bullet(z)\y - 2 < s + 29
          vie = vie - degat * (bullet(z)\arm + 1)
          bullet(z)\x = 0
          If vie <= 0
            mort = 45 * az - restant
            MessageRequester("Dommage", "Vous avez perdu")
            win = 2
            Gosub perdu
          EndIf
        Else
          bullet(z)\y = bullet(z)\y + vitbullet
          bullet(z)\x = bullet(z)\x + bullet(z)\a
        EndIf
        If bullet(z)\y > 480 Or bullet(z)\x <= 5 Or bullet(z)\x >= 630 
          bullet(z)\x = 0
        EndIf
        If win = 2 : Break : EndIf
      Next
      
      If restant = 0
        win = 1
      EndIf
      
    StopDrawing()
  EndIf
  DisplayTransparentSprite(0, q, s)
  FlipBuffers()
  
  ;- deplacement ennemis
  If b <= -2
    b = b + 2
  Else
    e = deplacementx(c)
    f = deplacementy(c)
    If (a = e Or a = e + 1) And (b = f Or b = f + 1) : c = c + 1 : EndIf
    If c = 7 : c = 1 : EndIf
    If a <> e And a <> e + 1 : a = a + 2 * (Abs(e) / e) : EndIf
    If b <> f And b <> f + 1 : b = b + 2 * (Abs(f) / f) : EndIf
  EndIf
  
  
  ;- deplacement
  delai = delai - 1
  If KeyboardPushed(#pb_key_left)
    If vitesse\x > - limitvitesse : vitesse\x = vitesse\x - 0.4 : EndIf
  EndIf
  If KeyboardPushed(#pb_key_right)
    If vitesse\x < limitvitesse : vitesse\x = vitesse\x + 0.4 : EndIf
  EndIf
  If KeyboardPushed(#pb_key_up)
    If vitesse\y > - limitvitesse : vitesse\y = vitesse\y - 0.4 : EndIf
  EndIf
  If KeyboardPushed(#pb_key_down)
    If vitesse\y < limitvitesse : vitesse\y = vitesse\y + 0.4 : EndIf
  EndIf
  
  
  q = q + vitesse\x
  s = s + vitesse\y
  If vitesse\x < 0 : vitesse\x = vitesse\x + 0.2 : EndIf
  If vitesse\x > 0 : vitesse\x = vitesse\x - 0.2 : EndIf
  If vitesse\y < 0 : vitesse\y = vitesse\y + 0.2 : EndIf
  If vitesse\y > 0 : vitesse\y = vitesse\y - 0.2 : EndIf
  
  If q < 5 : q = 5 : EndIf
  If q > 600 : q = 600 : EndIf
  If s < 250 : s = 250 : EndIf
  If s > 445 : s = 445 : EndIf
    
  If KeyboardPushed(#PB_Key_1) : arme = 0 : enfonc = 0 : EndIf
  If KeyboardPushed(#PB_Key_2) And arme2 : arme = 1 : enfonc = 0 : EndIf
  If KeyboardPushed(#PB_Key_3) And arme3 : arme = 2 : enfonc = 0 : EndIf
  If KeyboardPushed(#PB_Key_4) And arme4 : arme = 3 :   ProgressBarGadget(1, 0, 500, 640, 20, 0, arme4, #PB_ProgressBar_Smooth) : enfonc = 0 : EndIf
  If KeyboardPushed(#pb_key_space) = 0 And arme = 3 And enfonc <> 0
    If enfonc > arme4 : enfonc = arme4 : EndIf
    bulletmoi(bulletmoi)\x = q + 10
    bulletmoi(bulletmoi)\y = s
    bulletmoi(bulletmoi)\a = 0
    bulletmoi(bulletmoi)\b = -1.2 * vitbullet
    bulletmoi(bulletmoi)\arm = enfonc / 2
    bulletmoi(bulletmoi)\type = 1
    enfonc = 0
    bulletmoi = bulletmoi + 1
    If bulletmoi >= 301 : bulletmoi = 1 : EndIf
  EndIf
  If KeyboardPushed(#pb_key_space) And bulletmoi(bulletmoi)\x = 0 And delai <= 0
    If arme = 0
      bulletmoi(bulletmoi)\x = q + 10
      bulletmoi(bulletmoi)\y = s
      bulletmoi(bulletmoi)\a = 0
      bulletmoi(bulletmoi)\b = -vitbullet
      bulletmoi(bulletmoi)\arm = 0
      bulletmoi = bulletmoi + 1
      If bulletmoi >= 301 : bulletmoi = 1 : EndIf
      delai = 5
    EndIf
    If arme = 1
      bulletmoi(bulletmoi)\x = q
      bulletmoi(bulletmoi)\y = s
      bulletmoi(bulletmoi)\a = 0
      bulletmoi(bulletmoi)\b = -vitbullet
      bulletmoi(bulletmoi)\arm = 1
      bulletmoi = bulletmoi + 1
      If bulletmoi >= 301 : bulletmoi = 1 : EndIf
      If bulletmoi(bulletmoi)\x = 0
        bulletmoi(bulletmoi)\x = q + 20
        bulletmoi(bulletmoi)\y = s
        bulletmoi(bulletmoi)\a = 0
        bulletmoi(bulletmoi)\b = -vitbullet
        bulletmoi(bulletmoi)\arm = 1
        bulletmoi = bulletmoi + 1
        If bulletmoi >= 301 : bulletmoi = 1 : EndIf
      EndIf
      delai = 5
    EndIf
    If arme = 2
      bulletmoi(bulletmoi)\x = q + 10
      bulletmoi(bulletmoi)\y = s
      bulletmoi(bulletmoi)\a = 0
      bulletmoi(bulletmoi)\b = -vitbullet
      bulletmoi(bulletmoi)\arm = 2
      bulletmoi = bulletmoi + 1
      If bulletmoi >= 301 : bulletmoi = 1 : EndIf
      If bulletmoi(bulletmoi)\x = 0
        bulletmoi(bulletmoi)\x = q + 10
        bulletmoi(bulletmoi)\y = s
        bulletmoi(bulletmoi)\a = -2
        bulletmoi(bulletmoi)\b = -vitbullet
        bulletmoi(bulletmoi)\arm = 2
        If bulletmoi >= 301 : bulletmoi = 1 : EndIf
        bulletmoi = bulletmoi + 1
      EndIf
      If bulletmoi(bulletmoi)\x = 0
        bulletmoi(bulletmoi)\x = q + 10
        bulletmoi(bulletmoi)\y = s
        bulletmoi(bulletmoi)\a = 2
        bulletmoi(bulletmoi)\b = -vitbullet
        bulletmoi(bulletmoi)\arm = 2
        bulletmoi = bulletmoi + 1
        If bulletmoi >= 301 : bulletmoi = 1 : EndIf
      EndIf
      delai = 5
    EndIf
    If arme = 3
      enfonc = enfonc + 1
    EndIf
  EndIf
  
Until KeyboardPushed(#pb_key_escape) Or win <> 0

perdu :

If win = 2 Or KeyboardPushed(#pb_key_escape)
  ReleaseMouse(1)
  CloseScreen()
  CloseWindow(0)
  
  SaveHightScore("Space.pref", mort, az, 10, "  4.01")
  
  If OpenFile(0, "Space.pref")
    If OpenWindow(1, 0, 0, 380, 390, #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered, "Space Meilleurs Scores" + ReadString()) And CreateGadgetList(WindowID())
      TextGadget(1, 20, 20, 200, 17, "PLACE : NOM")
      TextGadget(1, 240, 20, 50, 17, "SCORE")
      TextGadget(1, 310, 20, 50, 17, "NIVEAU")
      For aze = 1 To 10
        TextGadget(0, 20, aze * 30 + 20, 200, 17, Str(aze) + "  :  " + ReadString(), #PB_Text_Border)
        TextGadget(0, 240, aze * 30 + 20, 50, 17, ReadString(), #PB_Text_Border | #PB_Text_Right)
        TextGadget(0, 310, aze * 30 + 20, 50, 17, ReadString(), #PB_Text_Border | #PB_Text_Right)
      Next
      CloseFile(0)
      ButtonGadget(4, 20, 350, 160, 20, "REJOUER")
      ButtonGadget(5, 200, 350, 160, 20, "QUITTER")
    EndIf
  EndIf
  
  Repeat
    event = WaitWindowEvent()
    If event = #pb_event_gadget
      Select EventGadgetID()
        Case 4
          CloseWindow(1)
          Gosub Case_depart
        Case 5
          End
      EndSelect
    EndIf
  Until event = #pb_event_closewindow
  
  End
  
EndIf

;- Magasin

Window2()

SetGadgetText(6, Str(arme4))
SetGadgetText(1, Str(thune))
SetGadgetText(13, Str(vie))

Repeat
  
  SetGadgetState(2, 1)
  If arme2 = 1
    SetGadgetState(3, 1)
  Else
    SetGadgetState(3, 0)
  EndIf
  If arme3 = 1
    SetGadgetState(4, 1)
  Else
    SetGadgetState(4, 0)
  EndIf
  If arme4
    SetGadgetState(5, 1)
  Else
    SetGadgetState(5, 0)
  EndIf
  
  event = WaitWindowEvent()
  sort = 0
  
  If event = #pb_event_gadget
    Select EventGadgetID()
      Case 7
        If arme2 = 1
          MessageRequester("Attention", "Vous possedez déjà le canon double")
        ElseIf thune >= 1000
          arme2 = 1
          thune = thune - 1000
          SetGadgetText(13, Str(vie))
          SetGadgetText(1, Str(thune))
        Else 
          MessageRequester("Attention", "Vous n'avez pas assez d'argent")
        EndIf
        
      Case 8
        If arme3 = 1
          MessageRequester("Attention", "Vous possedez déjà le canon triple")
        ElseIf thune >= 5000
          arme3 = 1
          thune = thune - 5000
          SetGadgetText(1, Str(thune))
        Else 
          MessageRequester("Attention", "Vous n'avez pas assez d'argent")
        EndIf
        
      Case 9
        If arme4
          MessageRequester("Attention", "Vous possedez déjà l'accumulateur")
        ElseIf thune >= 10000
          arme4 = 51
          thune = thune - 10000
          SetGadgetText(1, Str(thune))
          SetGadgetText(6, Str(arme4))
        Else 
          MessageRequester("Attention", "Vous n'avez pas assez d'argent")
        EndIf
        
      Case 10
        If arme4 >= 255
          MessageRequester("Attention", "Vous avez atteins la limite de puissance")
        ElseIf thune >= 7500
          arme4 = arme + 51
          thune = thune - 10500
          SetGadgetText(1, Str(thune))
          SetGadgetText(6, Str(arme4))
        Else 
          MessageRequester("Attention", "Vous n'avez pas assez d'argent")
        EndIf
        
      Case 11
        If vie = 480
          MessageRequester("Attention", "Vous avez l'énergie au maximum")
        ElseIf thune >= 500
          vie = vie + 50
          If vie > 480 : vie = 480 : EndIf
          thune = thune - 500
          SetGadgetText(13, Str(vie))
          SetGadgetText(1, Str(thune))
        Else 
          MessageRequester("Attention", "Vous n'avez pas assez d'argent")
        EndIf
        
      Case 12
        sort = 1
        
    EndSelect
  EndIf
  
Until sort = 1

CloseWindow(2)
ActivateWindow()

Gosub debut

Return


DataSection
  ;- vaisseau
  vaisseau :
    Data.l 20, 30
    Data.l 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, 2697257, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3224625, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7563627, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8680827, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8680827, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 1024, 8681860, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 2169880, 9734796, 2697257, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 5392714, 16750228, 7563635, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 1052688, 8089971, 16764886, 8680827, 1052688, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 4868426, 8680827, 16756397, 9207172, 8089979, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 5920090, 7564659, 11377317, 11904685, 11377317, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 526344, 0, 526344, 2697257, 13023933, 4866370, 1052688, 0, 526344, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 3749945, 0, 0, 1580056, 11379373, 3748913, 0, 0, 3749945, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 4343106, 0, 526344, 4340802, 8681860, 11378341, 1052688, 0, 4343106, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 4868426, 1581097, 3748921, 3223601, 15692147, 10261140, 10262172, 2171937, 4868426, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 3225657, 3757411, 4339769, 2170913, 15179420, 9734804, 10854053, 9734796, 7037283, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 3748921, 6514027, 5927291, 4339769, 1053712, 7037283, 10261148, 11904685, 10851996, 10261148, 11904693, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 4867402, 6513003, 5399923, 3222577, 1024, 7561595, 9208460, 10261140, 9207172, 8681851, 11907765, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 1024, 1579032, 1581089, 1052688, 527368, 4866411, 4867402, 3222577, 2697257, 2170913, 526344, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 1024, 4342082, 8089971, 5919058, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 1024, 4867402, 9197923, 14059140, 10846852, 5921114, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 527368, 4867394, 7036259, 14049635, 16748180, 14068397, 9208460, 3748921, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 1024, 4339769, 5920090, 6511971, 6510938, 6510938, 8681851, 8681860, 10260116, 8680836, 10851988, 4340802, 0, 0, 0, 0
    Data.l 0, 0, 0, 527384, 5392714, 6511971, 7563627, 7038315, 4340802, 3748913, 7563635, 8681860, 8088955, 8680827, 10262172, 9735836, 8089971, 8, 0, 0
    Data.l 0, 0, 0, 1024, 1580056, 3749945, 5393746, 5394770, 4340802, 1051664, 5393746, 7037283, 7563635, 7563635, 5394778, 5919058, 3223601, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 526344, 527368, 2170913, 6511971, 4866378, 1052688, 526344, 1024, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 1024, 5920090, 9734804, 9733780, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 1024, 7037283, 10853020, 10853029, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 1024, 1052688, 1024, 0, 0, 0, 0, 0, 0, 0, 0
  
  ;- vaisseau1
  vaisseau1 :
    Data.l 20, 30
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 1024, 1052688, 1024, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 1024, 7037283, 10853020, 10853029, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 1024, 5920090, 9734804, 9733780, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 526344, 527368, 2170913, 6511971, 4866378, 1052688, 526344, 1024, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 1024, 1580056, 3749945, 5393746, 5394770, 4340802, 1051664, 5393746, 7037283, 7563635, 7563635, 5394778, 5919058, 3223601, 0, 0, 0
    Data.l 0, 0, 0, 527384, 5392714, 6511971, 7563627, 7038315, 4340802, 3748913, 7563635, 8681860, 8088955, 8680827, 10262172, 9735836, 8089971, 8, 0, 0
    Data.l 0, 0, 0, 0, 1024, 4339769, 5920090, 6511971, 6510938, 6510938, 8681851, 8681860, 10260116, 8680836, 10851988, 4340802, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 527368, 4867394, 7036259, 14049635, 16748180, 14068397, 9208460, 3748921, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 1024, 4867402, 9197923, 14059140, 10846852, 5921114, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 1024, 4342082, 8089971, 5919058, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 1024, 1579032, 1581089, 1052688, 527368, 4866411, 4867402, 3222577, 2697257, 2170913, 526344, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 4867402, 6513003, 5399923, 3222577, 1024, 7561595, 9208460, 10261140, 9207172, 8681851, 11907765, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 3748921, 6514027, 5927291, 4339769, 1053712, 7037283, 10261148, 11904685, 10851996, 10261148, 11904693, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 3225657, 3757411, 4339769, 2170913, 15179420, 9734804, 10854053, 9734796, 7037283, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 4868426, 1581097, 3748921, 3223601, 15692147, 10261140, 10262172, 2171937, 4868426, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 4343106, 0, 526344, 4340802, 8681860, 11378341, 1052688, 0, 4343106, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 3749945, 0, 0, 1580056, 11379373, 3748913, 0, 0, 3749945, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 526344, 0, 526344, 2697257, 13023933, 4866370, 1052688, 0, 526344, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 5920090, 7564659, 11377317, 11904685, 11377317, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 4868426, 8680827, 16756397, 9207172, 8089979, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 1052688, 8089971, 16764886, 8680827, 1052688, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 5392714, 16750228, 7563635, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 2169880, 9734796, 2697257, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 1024, 8681860, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8680827, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8680827, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7563627, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3224625, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2697257, 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
  
  ;- euro
  euro :
    Data.l 17, 17
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 16711680, 16776960, 16711680, 16776960, 16711680, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 0, 0
    Data.l 0, 0, 0, 0, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 0
    Data.l 0, 0, 0, 0, 16711680, 16776960, 16711680, 16776960, 0, 0, 0, 0, 0, 0, 16711680, 16776960, 0
    Data.l 0, 0, 0, 16711680, 16776960, 16711680, 16776960, 0, 0, 0, 0, 0, 0, 0, 16776960, 16711680, 0
    Data.l 0, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 0, 0, 0, 0, 0, 0
    Data.l 0, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 16776960, 16711680, 16776960, 16711680, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 0, 0, 0, 0, 0, 0
    Data.l 0, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 16711680, 16776960, 16711680, 16776960, 0, 0, 0, 0, 0, 0, 0, 16776960, 16711680, 0
    Data.l 0, 0, 0, 0, 16711680, 16776960, 16711680, 16776960, 0, 0, 0, 0, 0, 0, 16711680, 16776960, 0
    Data.l 0, 0, 0, 0, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 0
    Data.l 0, 0, 0, 0, 0, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 16711680, 16776960, 16711680, 16776960, 16711680, 0, 0, 0, 0
EndDataSection
voila bien du plaisir :D
comtois
Messages : 5186
Inscription : mer. 21/janv./2004 17:48
Contact :

Message par comtois »

Gadget object not initialized ligne 398

Et c'est pas un magasin de l'espace ,mais le souk de l'espace :)
il y a des chiffres éparpillés , on ne sait pas à quoi ça correspond , et les boutons options ?

Bon courage pour la suite .
Avatar de l’utilisateur
graph100
Messages : 1318
Inscription : sam. 21/mai/2005 17:50

Message par graph100 »

8O
des bugs
pas chez moi tout marche impect
je n'ai pas compris tout ce que tu as dis

les optiongadgets sont la pour dire quelles arme tu possedes ou ne possedes pas

le gadget 14 et intialisé a la ligne 202

Code : Tout sélectionner

If CreateGadgetList(WindowID())
  TextGadget(14, 0, 0, 640, 20, "", #PB_Text_Center | #PB_Text_Border)
  ProgressBarGadget(1, 0, 500, 640, 20, 0, 102, #PB_ProgressBar_Smooth)
EndIf

version PB 3.80 evidemment alors si sa marche ps sur la 3.94  :( 

Dr. Dri
Messages : 2527
Inscription : ven. 23/janv./2004 18:10

Message par Dr. Dri »

moi j'ai eu un probleme de gadget aussi (un truc avec une variable enfonc je crois) mais en mettant en commentaire ca fonctionne... Sinon ca a bien marché pendant 7 niveaux mais au 8e j'ai eu un plantage séverre (tout windows bloqué)

Dri
Avatar de l’utilisateur
graph100
Messages : 1318
Inscription : sam. 21/mai/2005 17:50

Message par graph100 »

je ne sais pas si c grave mais j'utilise les meme numero de gadget dans plusieurs window a la fois
Avatar de l’utilisateur
graph100
Messages : 1318
Inscription : sam. 21/mai/2005 17:50

Message par graph100 »

je ne comprend pas les probleme que vous rencontrer
enfin voila une nouvelle version

Code : Tout sélectionner

;- str bullet
Structure bullet
  x.l
  y.l
  a.l
  b.l
  arm.l
  type.l
EndStructure

;- str pointfloat
Structure pointfloat
  x.f
  y.f
EndStructure

;- str etoile
Structure star
  x.l
  y.l
  vitesse.l
  lum.l
  sens.l
EndStructure

Case_depart :

;- police

Global FontID5
FontID5 = LoadFont(1, "Arial Black", 10, #PB_Font_Underline)
Global FontID6
FontID6 = LoadFont(2, "Arial Black", 11)


;- proc window2
Procedure Window2()
  If OpenWindow(2, 301, 123, 534, 296, #pb_window_windowcentered, "Space - Magasin")
    If CreateGadgetList(WindowID())
      TextGadget(0, 25, 5, 65, 20, "Thunes :")
      SetGadgetFont(0, FontID5)
      TextGadget(1, 100, 5, 95, 20, "")
      TextGadget(0, 25, 30, 65, 20, Chr(201) + "nergie :")
      SetGadgetFont(0, FontID5)
      TextGadget(13, 100, 30, 95, 20, "")
      OptionGadget(2, 25, 95, 15, 15, "")
      OptionGadget(3, 25, 125, 15, 15, "")
      OptionGadget(4, 25, 155, 15, 15, "")
      OptionGadget(5, 25, 185, 15, 15, "")
      TextGadget(0, 25, 60, 85, 20, "Armement :")
      SetGadgetFont(0, FontID5)
      TextGadget(0, 60, 125, 100, 20, "Canon double")
      SetGadgetFont(0, FontID5)
      TextGadget(0, 60, 95, 100, 20, "Canon")
      SetGadgetFont(0, FontID5)
      TextGadget(0, 60, 155, 100, 20, "Canon triple")
      SetGadgetFont(0, FontID5)
      TextGadget(0, 60, 185, 105, 20, "Accumulateur")
      SetGadgetFont(0, FontID5)
      Frame3DGadget(0, 205, 5, 5, 245, "")
      TextGadget(0, 25, 215, 85, 20, "Puissance :")
      SetGadgetFont(0, FontID5)
      TextGadget(6, 125, 215, 60, 20, "")
      TextGadget(0, 225, 20, 60, 20, "Achat :")
      SetGadgetFont(0, FontID5)
      ButtonGadget(7, 220, 85, 230, 40, "Canon double")
      SetGadgetFont(7, FontID6)
      ButtonGadget(8, 220, 125, 230, 40, "Canon triple")
      SetGadgetFont(8, FontID6)
      ButtonGadget(9, 220, 165, 230, 40, "Accumulateur")
      SetGadgetFont(9, FontID6)
      ButtonGadget(10, 220, 205, 230, 40, "Puissance supplémentaire")
      SetGadgetFont(10, FontID6)
      TextGadget(0, 460, 100, 70, 20, "1000 ")
      SetGadgetFont(0, FontID5)
      TextGadget(0, 460, 140, 65, 20, "5000")
      SetGadgetFont(0, FontID5)
      TextGadget(0, 460, 180, 70, 20, "10000")
      SetGadgetFont(0, FontID5)
      TextGadget(0, 460, 220, 70, 20, "7500")
      SetGadgetFont(0, FontID5)
      ButtonGadget(11, 220, 45, 230, 40, "Vie supplémentaire")
      SetGadgetFont(11, FontID6)
      TextGadget(0, 460, 60, 70, 20, "500")
      SetGadgetFont(0, FontID5)
      ButtonGadget(12, 20, 255, 495, 30, "Continuer")
      SetGadgetFont(12, FontID6)
      
    EndIf
  EndIf
EndProcedure

;- proc SaveHightScore
Procedure SaveHightScore(filename.s, score, niveau, podium, version.s) ; sauvegarde le score et le niveau des x meilleurs dans un fichier
  Protected place, a, score, podium, filename, name.s, niveau
  
  If OpenFile(0, filename)
    
    If ReadString() <> version
      CloseFile(0)
      If CreateFile(0, filename)
        WriteStringN(version.s)
      EndIf
    EndIf
    
    
    Dim nom.s(podium)
    Dim score.s(podium)
    Dim niveau.s(podium)
    
    place = 0
    
    For a = 1 To podium
      nom(a) = ReadString()
      score(a) = ReadString()
      niveau(a) = ReadString()
      If score > Val(score(a)) And place = 0
        place = a
      EndIf
      If score(a) = "" : score(a) = "0" : EndIf
      If niveau(a) = "" : niveau(a) = "0" : EndIf
    Next
    
    CloseFile(0)
    
    If place <> 0
      name.s = InputRequester("Vous êtes " + Str(place) + " ème", "Entrez votre nom", "")
      For a = podium To 1 Step -1
        If a = place
          nom(a) = name
          score(a) = Str(score)
          niveau(a) = Str(niveau)
        EndIf
        If a > place
          nom(a) = nom(a - 1)
          score(a) = score(a - 1)
          niveau(a) = niveau(a - 1)
        EndIf
      Next
      
      If CreateFile(0, filename)
        WriteStringN(version)
        For a = 1 To podium
          WriteStringN(nom(a))
          WriteStringN(score(a))
          WriteStringN(niveau(a))
        Next
        CloseFile(0)
      EndIf
      
    EndIf
  EndIf
  
  ProcedureReturn place
EndProcedure

;- proc window0
Procedure window0()
  If OpenWindow(0, 0, 0, 600, 300, #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered, "Space")
    If CreateGadgetList(WindowID())
      TextGadget(0, 140, 5, 320, 65, "Space Impact", #PB_Text_Center | #PB_Text_Border)
      SetGadgetFont(0, LoadFont(1, "Arial", 36, #PB_Font_Underline))
      TrackBarGadget(1, 5, 155, 590, 35, 0, 19, #PB_TrackBar_Ticks)
      TextGadget(0, 100, 105, 400, 35, "Selectionnez la difficulté:", #PB_Text_Center | #PB_Text_Border)
      SetGadgetFont(0, LoadFont(2, "Bookman Old Style", 18))
      TextGadget(3, 5, 190, 50, 20, "+ facile")
      SetGadgetFont(3, LoadFont(3, "Arial", 12, #PB_Font_Underline))
      TextGadget(4, 545, 190, 50, 20, "- facile")
      SetGadgetFont(4, LoadFont(3, "Arial", 12, #PB_Font_Underline))
      ButtonGadget(5, 165, 215, 270, 40, "Go")
      SetGadgetFont(5, LoadFont(4, "Bookman Old Style", 16))
    EndIf
  EndIf
  SetGadgetState(1, 9)
EndProcedure

window0()

Repeat
  event = WaitWindowEvent()
Until event = #pb_event_closewindow Or EventGadgetID() = 5

If event = #pb_event_closewindow : End : EndIf

difficult = GetGadgetState(1)
CloseWindow(0)

;- init general
If InitMouse() = 0 Or InitSprite() = 0 Or InitKeyboard() = 0
  MessageRequester("Error", "Can't open DirectX 7", 0)
  End
EndIf

SetRefreshRate(60)

If OpenWindow(0, 0, 0, 640, 520, #PB_Window_ScreenCentered, "Space") And OpenWindowedScreen(WindowID(), 0, 20, 640, 480, 0, 0, 0) = 0
  MessageRequester("Attention", "l'ecran n'a pas pus être ouvert")
  End
EndIf

If CreateGadgetList(WindowID())
  TextGadget(14, 0, 0, 640, 20, "", #PB_Text_Center | #PB_Text_Border)
  ProgressBarGadget(15, 0, 500, 640, 20, 0, 255, #PB_ProgressBar_Smooth)
EndIf

;- draw sprite
For a = 0 To 4
  If a = 0 : Restore vaisseau : EndIf
  If a = 1 : Restore vaisseau1 : EndIf
  If a = 2 : Restore euro : EndIf
  If a = 4 : Restore bos : EndIf
  
  If a <> 3
    Read width
    Read height
    
    CreateSprite(a, width, height)
    
    If StartDrawing(SpriteOutput(a))
        For y2 = 0 To height - 1
          For x2 = 0 To width - 1
            Read color
            Plot(x2, y2, color)
          Next
        Next
      StopDrawing()
    EndIf
    TransparentSpriteColor(a, 0, 0, 0)
  EndIf
Next

;- init

bos.point
arme2 = 0
arme3 = 0
arme4 = 0
autorise = 300 - 10 * difficult
az = 0
vie = 480
q = 40
s = 420
bullet = 0
bulletmoi = 0
euro = 0
vitbullet = 2 + difficult / 3
degat = 10
arme = 0
limitvitesse = difficult / 2 + 1
enfonc = 0
vitesse.pointfloat\x = 0
vitesse.pointfloat\Y = 0

Dim bullet.bullet(1010)
Dim bulletmoi.bullet(310)
Dim stars.star(1010)
Dim euro.star(310)


;- proc diplayeuro
Procedure diplayeuro(t1, y1, euro, a, b)
  If euro(euro)\x = 0 And Random(10) = 0
    euro(euro)\x = 24 * t1 + a - 20
    euro(euro)\y = 36 * y1 + b - 34
    euro(euro)\vitesse = Random(2) + 1
    euro = euro + 1
  EndIf
  If euro >= 201 : euro = 0 : EndIf
  ProcedureReturn euro
EndProcedure

;- etoile init
star = 0
For a = 0 To 480 Step 2
  For b = 0 To 2
    stars(star)\x = Random(640)
    stars(star)\y = a
    stars(star)\vitesse = Random(3) + 1
    stars(star)\lum = Random(255)
    stars(star)\sens = Random(11) - 6
    star = star + 1
  Next
Next

;- debut
debut :


az = az + 1
az1.f = az * 2 / 10
If az1 = 0 : vitbullet = vitbullet + 1 : EndIf
DataSection
  niv1 :
    Data.l 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
    Data.l 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
    Data.l 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
  deplacement :
    Data.l - 1, 270, 270, -1, 270, -1
    Data.l 80, 80, -1, -1, 80, -1
EndDataSection

Dim vais(15, 3)
Dim deplacementx(6)
Dim deplacementy(6)

Restore niv1

For ligne = 1 To 3
  For colonne = 1 To 15
    Read z
    vais(colonne, ligne) = z * az
  Next
Next

Restore deplacement

For a = 1 To 6
  Read deplacementx(a)
Next
For a = 1 To 6
  Read deplacementy(a)
Next

a = -1
b = -150
c = 1
win = 0
viebos = 45 * az
presencebos = 0

Repeat
  event = WindowEvent()
  Delay(2)
  ExamineKeyboard()
  ClearScreen(0, 0, 0)
  restant = 0
  
        
  For g = 1 To 3
    For h = 1 To 15
      
      ;- display ennemis
      If vais(h, g) >= 1
        restant = restant + 1
        DisplayTransparentSprite(1, 24 * h + a - 20, 36 * g + b - 34)
        
        
        If Random(autorise) = 0 And bullet(bullet)\x = 0
          If Random(1) = 0
            bullet(bullet)\x = 24 * h + a - 10
            bullet(bullet)\y = 36 * g + b - 4
            bullet(bullet)\a = (Random(2) - 1) * vitbullet / 2
            bullet(bullet)\arm = 0
            bullet = bullet + 1
            If bullet >= 1001 : bullet = 1 : EndIf
          Else
            bullet(bullet)\x = 24 * h + a - 20
            bullet(bullet)\y = 36 * g + b - 4
            bullet(bullet)\a = 0
            bullet(bullet)\arm = 1
            bullet = bullet + 1
            If bullet >= 1001 : bullet = 1 : EndIf
            If bullet(bullet)\x = 0
              bullet(bullet)\x = 24 * h + a
              bullet(bullet)\y = 36 * g + b - 4
              bullet(bullet)\a = 0
              bullet(bullet)\arm = 1
              bullet = bullet + 1
              If bullet >= 1001 : bullet = 1 : EndIf
            EndIf
          EndIf
        EndIf
        
      EndIf
      
      ;- explosion
      If vais(h, g) <= 0 And vais(h, g) > - 15
        If StartDrawing(ScreenOutput())
            For ae = 1 To 40
              Repeat
                xplot = 24 * h + a - 22 + Random(34)
                yplot = 36 * g + b - 36 + Random(34)
                xplota = (xplot - (24 * h + a - 11)) * (xplot - (24 * h + a - 11))
                yplota = (yplot - (36 * g + b - 20)) * (yplot - (36 * g + b - 20))
              Until Sqr(xplota + yplota) < 15
              Circle(xplot, yplot, 1, RGB(255, Random(255), 0))
            Next
          StopDrawing()
        EndIf
        vais(h, g) = vais(h, g) - 1
      EndIf
      
    Next
  Next
  
  If arme = 0
    courante.s = "canon"
  ElseIf arme = 1
    courante.s = "canon double"
  ElseIf arme = 2
    courante.s = "canon triple"
  ElseIf arme = 3
    courante.s = "accumulateur"
  EndIf
  viereste.f = (vie / 480) * 100
  SetGadgetText(14, "Niveau = " + Str(az) + "        Ennemis vaincus = " + Str(45 * az - restant) + "        Vie restante = " + Str(viereste) + "%" + "        Thunes = " + Str(thune) + " euro        arme actuelle = " + courante)
  SetGadgetState(15, enfonc)
  
  ;- display euro
  For z = 1 To 300
    If euro(z)\x
      DisplayTransparentSprite(2, euro(z)\x, euro(z)\y)
      euro(z)\y = euro(z)\y + euro(z)\vitesse
      If euro(z)\y > 485
        euro(z)\x = 0
      ElseIf SpritePixelCollision(0, q, s, 2, euro(z)\x, euro(z)\y)
        euro(z)\x = 0
        thune = thune + Random(200) + 200
      EndIf
    EndIf
  Next
  
  If StartDrawing(ScreenOutput())
      
      ;- etoile fond
      For z = 0 To 1000
        Circle(stars(z)\x, stars(z)\y, 1, RGB(stars(z)\lum, stars(z)\lum, stars(z)\lum))
        stars(z)\lum = stars(z)\lum + stars(z)\sens
        stars(z)\y = stars(z)\y + stars(z)\vitesse
        If stars(z)\y > 480
          stars(z)\x = Random(640)
          stars(z)\y = 0
          stars(z)\vitesse = Random(3) + 1
        EndIf
        If stars(z)\lum > 248 Or stars(z)\lum < 7 : stars(z)\sens = -stars(z)\sens : EndIf
      Next
      
      ;- vie
      vert.f = ((vie / 480) * 255)
      Box(633, 480, 7, -vie, RGB(99, vert, 156))
      
    StopDrawing()
  EndIf
  
  ;- display bos
  If presencebos = 1
    DisplayTransparentSprite(4, 24 * 5 + a - 20, 36 * 2 + b - 34)
    h = 5
    g = 2
    If Random(50) = 0
      For bulletennemix = 18 To 138  Step 16
        If bullet(bullet)\x = 0
          bullet(bullet)\x = 24 * h + a + bulletennemix
          bullet(bullet)\y = 36 * g + b + 45
          bullet(bullet)\a = 0
          bullet(bullet)\arm = 1
          bullet = bullet + 1
          If bullet >= 1001 : bullet = 1 : EndIf
        EndIf
      Next 
    EndIf
  EndIf
  
  ;- tir moi
  For z = 1 To 300
    If bulletmoi(z)\x <> 0
      If bulletmoi(z)\type = 0
        CreateSprite(3, 2, 6)
        If StartDrawing(SpriteOutput(3))
            Box(0, 0, 2, 2, RGB($FF, $28, $00))
            Box(0, 2, 2, 2, RGB($FF, $6D, $00))
            Box(0, 4, 2, 2, RGB($FF, $9E, $00))
          StopDrawing()
        EndIf
        DisplaySprite(3, bulletmoi(z)\x - 1, bulletmoi(z)\y)
      ElseIf bulletmoi(z)\type = 1
        CreateSprite(3, bulletmoi(z)\arm * 4, bulletmoi(z)\arm * 4)
        If StartDrawing(SpriteOutput(3))
            DrawingMode(0)
            For ar = bulletmoi(z)\arm To 0 Step -1
              Circle(bulletmoi(z)\arm * 2, bulletmoi(z)\arm * 2, ar * 2, RGB(255, ar * 10, 0))
            Next
            DrawingMode(0)
          StopDrawing()
        EndIf
        TransparentSpriteColor(3, 0, 0, 0)
        DisplayTransparentSprite(3, bulletmoi(z)\x - bulletmoi(z)\arm * 2, bulletmoi(z)\y - bulletmoi(z)\arm * 2)
      EndIf
      
      If presencebos = 0
        If bulletmoi(z)\type = 0
          
          For g = 1 To 3
            For h = 1 To 15
              If vais(h, g) > 0
                x = 24 * h + a - 20
                y = 36 * g + b - 34
                If SpritePixelCollision(1, x, y, 3, bulletmoi(z)\x - 1, bulletmoi(z)\y)
                  bulletmoi(z)\x = 0
                  vais(h, g) = vais(h, g) - bulletmoi(z)\arm - 1
                  If vais(h, g) <= 0 : euro = diplayeuro(h, g, euro, a, b) : EndIf
                EndIf
              EndIf
            Next
          Next
          
        ElseIf bulletmoi(z)\type = 1
          For g = 1 To 3
            For h = 1 To 15
              If vais(h, g) > 0
                If SpritePixelCollision(1, 24 * h + a - 20, 36 * g + b - 34, 3, bulletmoi(z)\x - bulletmoi(z)\arm * 2, bulletmoi(z)\y - bulletmoi(z)\arm * 2)
                  vais(h, g) = vais(h, g) - bulletmoi(z)\arm
                  If vais(h, g) <= 0 : vais(h, g) = 0 : euro = diplayeuro(h, g, euro, a, b) : EndIf
                  bulletmoi(z)\arm = bulletmoi(z)\arm - 5
                  If bulletmoi(z)\arm <= 0
                    bulletmoi(z)\x = 0
                  EndIf
                EndIf
              EndIf
            Next
          Next
          
        EndIf
        
      Else
        If bulletmoi(z)\type = 0
          If SpritePixelCollision(4, 24 * 5 + a - 20, 36 * 2 + b - 34, 3, bulletmoi(z)\x - 1, bulletmoi(z)\y)
            bulletmoi(z)\x = 0
            viebos = viebos - bulletmoi(z)\arm - 1
            If viebos <= 0 : euro = diplayeuro(2, 5, euro, a, b) : EndIf
          EndIf
        ElseIf bulletmoi(z)\type = 1
          If SpritePixelCollision(4, 24 * h + a - 20, 36 * g + b - 34, 3, bulletmoi(z)\x - bulletmoi(z)\arm * 2, bulletmoi(z)\y - bulletmoi(z)\arm * 2)
            viebos = viebos - bulletmoi(z)\arm
            If viebos <= 0 : viebos = 0 : euro = diplayeuro(5, 2, euro, a, b) : EndIf
            bulletmoi(z)\arm = bulletmoi(z)\arm - 5
            If bulletmoi(z)\arm <= 0
              bulletmoi(z)\x = 0
            EndIf
          EndIf
        EndIf
      EndIf
      
      If viebos < 0 : win = 1 : EndIf
      
      bulletmoi(z)\y = bulletmoi(z)\y + bulletmoi(z)\b
      bulletmoi(z)\x = bulletmoi(z)\x + bulletmoi(z)\a
    EndIf
    If bulletmoi(z)\y < - 2 Or bulletmoi(z)\x < 5 Or bulletmoi(z)\x > 650
      bulletmoi(z)\x = 0
      bulletmoi(z)\type = 0
    EndIf
  Next
  
  If StartDrawing(ScreenOutput())
      
      ;- tir ennemis
      For z = 1 To 1000
        If bullet(z)\x <> 0
          Box(bullet(z)\x - 1, bullet(z)\y, 2, 2, RGB($00, $18, $FF))
          Box(bullet(z)\x - 1, bullet(z)\y - 2, 2, 2, RGB($00, $82, $FF))
          Box(bullet(z)\x - 1, bullet(z)\y - 4, 2, 2, RGB($00, $DF, $FF))
        EndIf
        If bullet(z)\x + 2 > q And bullet(z)\x - 2 < q + 19 And bullet(z)\y + 2 > s And bullet(z)\y - 2 < s + 29
          vie = vie - degat * (bullet(z)\arm + 1)
          bullet(z)\x = 0
          If vie <= 0
            mort = 45 * az - restant
            MessageRequester("Dommage", "Vous avez perdu")
            win = 2
          EndIf
        Else
          bullet(z)\y = bullet(z)\y + vitbullet
          bullet(z)\x = bullet(z)\x + bullet(z)\a
        EndIf
        If bullet(z)\y > 480 Or bullet(z)\x <= 5 Or bullet(z)\x >= 630
          bullet(z)\x = 0
        EndIf
        If win = 2 : Break : EndIf
      Next
      
      If restant = 0 And presencebos = 0
        presencebos = 1
        a = -1
        b = -150
      EndIf
      
    StopDrawing()
  EndIf
  DisplayTransparentSprite(0, q, s)
  FlipBuffers()
  
  ;- deplacement ennemis
  If b <= -2
    b = b + 2
  Else
    e = deplacementx(c)
    f = deplacementy(c)
    If (a = e Or a = e + 1) And (b = f Or b = f + 1) : c = c + 1 : EndIf
    If c = 7 : c = 1 : EndIf
    If a <> e And a <> e + 1 : a = a + 2 * (Abs(e) / e) : EndIf
    If b <> f And b <> f + 1 : b = b + 2 * (Abs(f) / f) : EndIf
  EndIf
  
  
  ;- deplacement
  delai = delai - 1
  If KeyboardPushed(#pb_key_left)
    If vitesse\x > - limitvitesse : vitesse\x = vitesse\x - 0.4 : EndIf
  EndIf
  If KeyboardPushed(#pb_key_right)
    If vitesse\x < limitvitesse : vitesse\x = vitesse\x + 0.4 : EndIf
  EndIf
  If KeyboardPushed(#pb_key_up)
    If vitesse\y > - limitvitesse : vitesse\y = vitesse\y - 0.4 : EndIf
  EndIf
  If KeyboardPushed(#pb_key_down)
    If vitesse\y < limitvitesse : vitesse\y = vitesse\y + 0.4 : EndIf
  EndIf
  
  
  q = q + vitesse\x
  s = s + vitesse\y
  If vitesse\x < 0 : vitesse\x = vitesse\x + 0.2 : EndIf
  If vitesse\x > 0 : vitesse\x = vitesse\x - 0.2 : EndIf
  If vitesse\y < 0 : vitesse\y = vitesse\y + 0.2 : EndIf
  If vitesse\y > 0 : vitesse\y = vitesse\y - 0.2 : EndIf
  
  If q < 5 : q = 5 : EndIf
  If q > 600 : q = 600 : EndIf
  If s < 250 : s = 250 : EndIf
  If s > 445 : s = 445 : EndIf
  
  If KeyboardPushed(#PB_Key_1) : arme = 0 : enfonc = 0 : EndIf
  If KeyboardPushed(#PB_Key_2) And arme2 : arme = 1 : enfonc = 0 : EndIf
  If KeyboardPushed(#PB_Key_3) And arme3 : arme = 2 : enfonc = 0 : EndIf
  If KeyboardPushed(#PB_Key_4) And arme4 : arme = 3 : ProgressBarGadget(1, 0, 500, 640, 20, 0, arme4, #PB_ProgressBar_Smooth) : enfonc = 0 : EndIf
  If KeyboardPushed(#pb_key_space) = 0 And arme = 3 And enfonc <> 0
    bulletmoi(bulletmoi)\x = q + 10
    bulletmoi(bulletmoi)\y = s
    bulletmoi(bulletmoi)\a = 0
    bulletmoi(bulletmoi)\b = -1.2 * vitbullet
    bulletmoi(bulletmoi)\arm = enfonc / 2
    bulletmoi(bulletmoi)\type = 1
    enfonc = 0
    bulletmoi = bulletmoi + 1
    If bulletmoi >= 301 : bulletmoi = 1 : EndIf
  EndIf
  If KeyboardPushed(#pb_key_space) And bulletmoi(bulletmoi)\x = 0 And delai <= 0
    If arme = 0
      bulletmoi(bulletmoi)\x = q + 10
      bulletmoi(bulletmoi)\y = s
      bulletmoi(bulletmoi)\a = 0
      bulletmoi(bulletmoi)\b = -vitbullet
      bulletmoi(bulletmoi)\arm = 0
      bulletmoi = bulletmoi + 1
      If bulletmoi >= 301 : bulletmoi = 1 : EndIf
      delai = 5
    EndIf
    If arme = 1
      bulletmoi(bulletmoi)\x = q
      bulletmoi(bulletmoi)\y = s
      bulletmoi(bulletmoi)\a = 0
      bulletmoi(bulletmoi)\b = -vitbullet
      bulletmoi(bulletmoi)\arm = 1
      bulletmoi = bulletmoi + 1
      If bulletmoi >= 301 : bulletmoi = 1 : EndIf
      If bulletmoi(bulletmoi)\x = 0
        bulletmoi(bulletmoi)\x = q + 20
        bulletmoi(bulletmoi)\y = s
        bulletmoi(bulletmoi)\a = 0
        bulletmoi(bulletmoi)\b = -vitbullet
        bulletmoi(bulletmoi)\arm = 1
        bulletmoi = bulletmoi + 1
        If bulletmoi >= 301 : bulletmoi = 1 : EndIf
      EndIf
      delai = 5
    EndIf
    If arme = 2
      bulletmoi(bulletmoi)\x = q + 10
      bulletmoi(bulletmoi)\y = s
      bulletmoi(bulletmoi)\a = 0
      bulletmoi(bulletmoi)\b = -vitbullet
      bulletmoi(bulletmoi)\arm = 2
      bulletmoi = bulletmoi + 1
      If bulletmoi >= 301 : bulletmoi = 1 : EndIf
      If bulletmoi(bulletmoi)\x = 0
        bulletmoi(bulletmoi)\x = q + 10
        bulletmoi(bulletmoi)\y = s
        bulletmoi(bulletmoi)\a = -2
        bulletmoi(bulletmoi)\b = -vitbullet
        bulletmoi(bulletmoi)\arm = 2
        If bulletmoi >= 301 : bulletmoi = 1 : EndIf
        bulletmoi = bulletmoi + 1
      EndIf
      If bulletmoi(bulletmoi)\x = 0
        bulletmoi(bulletmoi)\x = q + 10
        bulletmoi(bulletmoi)\y = s
        bulletmoi(bulletmoi)\a = 2
        bulletmoi(bulletmoi)\b = -vitbullet
        bulletmoi(bulletmoi)\arm = 2
        bulletmoi = bulletmoi + 1
        If bulletmoi >= 301 : bulletmoi = 1 : EndIf
      EndIf
      delai = 5
    EndIf
    If arme = 3
      enfonc = enfonc + 1
      If enfonc > arme4 : Enfonc = arme4 : EndIf
    EndIf
  EndIf
  
Until KeyboardPushed(#pb_key_escape) Or win <> 0

perdu :

If win = 2 Or KeyboardPushed(#pb_key_escape)
  ReleaseMouse(1)
  CloseScreen()
  CloseWindow(0)
  
  SaveHightScore("Space.pref", mort, az, 10, "  4.02")
  
  If OpenFile(0, "Space.pref")
    If OpenWindow(1, 0, 0, 380, 390, #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered, "Space Meilleurs Scores" + ReadString()) And CreateGadgetList(WindowID())
      TextGadget(1, 20, 20, 200, 17, "PLACE : NOM")
      TextGadget(1, 240, 20, 50, 17, "SCORE")
      TextGadget(1, 310, 20, 50, 17, "NIVEAU")
      For aze = 1 To 10
        TextGadget(0, 20, aze * 30 + 20, 200, 17, Str(aze) + "  :  " + ReadString(), #PB_Text_Border)
        TextGadget(0, 240, aze * 30 + 20, 50, 17, ReadString(), #PB_Text_Border | #PB_Text_Right)
        TextGadget(0, 310, aze * 30 + 20, 50, 17, ReadString(), #PB_Text_Border | #PB_Text_Right)
      Next
      CloseFile(0)
      ButtonGadget(4, 20, 350, 160, 20, "REJOUER")
      ButtonGadget(5, 200, 350, 160, 20, "QUITTER")
    EndIf
  EndIf
  
  Repeat
    event = WaitWindowEvent()
    If event = #pb_event_gadget
      Select EventGadgetID()
        Case 4
          CloseWindow(1)
          Gosub Case_depart
        Case 5
          End
      EndSelect
    EndIf
  Until event = #pb_event_closewindow
  
  End
  
EndIf

;- Magasin

Window2()

SetGadgetText(6, Str(arme4))
SetGadgetText(1, Str(thune))
SetGadgetText(13, Str(vie))

Repeat
  
  SetGadgetState(2, 1)
  If arme2 = 1
    SetGadgetState(3, 1)
  Else
    SetGadgetState(3, 0)
  EndIf
  If arme3 = 1
    SetGadgetState(4, 1)
  Else
    SetGadgetState(4, 0)
  EndIf
  If arme4
    SetGadgetState(5, 1)
  Else
    SetGadgetState(5, 0)
  EndIf
  
  event = WaitWindowEvent()
  sort = 0
  
  If event = #pb_event_gadget
    Select EventGadgetID()
      Case 7
        If arme2 = 1
          MessageRequester("Attention", "Vous possedez déjà le canon double")
        ElseIf thune >= 1000
          arme2 = 1
          thune = thune - 1000
          SetGadgetText(13, Str(vie))
          SetGadgetText(1, Str(thune))
          arme = 1
        Else
          MessageRequester("Attention", "Vous n'avez pas assez d'argent")
        EndIf
        
      Case 8
        If arme3 = 1
          MessageRequester("Attention", "Vous possedez déjà le canon triple")
        ElseIf thune >= 5000
          arme3 = 1
          thune = thune - 5000
          SetGadgetText(1, Str(thune))
          arme = 2
        Else
          MessageRequester("Attention", "Vous n'avez pas assez d'argent")
        EndIf
        
      Case 9
        If arme4
          MessageRequester("Attention", "Vous possedez déjà l'accumulateur")
        ElseIf thune >= 10000
          arme4 = 51
          thune = thune - 10000
          SetGadgetText(1, Str(thune))
          SetGadgetText(6, Str(arme4))
          arme = 3
        Else
          MessageRequester("Attention", "Vous n'avez pas assez d'argent")
        EndIf
        
      Case 10
        If arme4 >= 255
          MessageRequester("Attention", "Vous avez atteins la limite de puissance")
        ElseIf thune >= 7500
          arme4 = arme + 51
          thune = thune - 10500
          SetGadgetText(1, Str(thune))
          SetGadgetText(6, Str(arme4))
          arme = 3
        Else
          MessageRequester("Attention", "Vous n'avez pas assez d'argent")
        EndIf
        
      Case 11
        If vie = 480
          MessageRequester("Attention", "Vous avez l'énergie au maximum")
        ElseIf thune >= 500
          vie = vie + 50
          If vie > 480 : vie = 480 : EndIf
          thune = thune - 500
          SetGadgetText(13, Str(vie))
          SetGadgetText(1, Str(thune))
        Else
          MessageRequester("Attention", "Vous n'avez pas assez d'argent")
        EndIf
        
      Case 12
        sort = 1
        
    EndSelect
  EndIf
  
Until sort = 1

CloseWindow(2)
ActivateWindow()

Gosub debut

Return


DataSection
  ;- dessin vaisseau
  vaisseau :
    Data.l 20, 30
    Data.l 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, 2697257, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3224625, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7563627, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8680827, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8680827, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 1024, 8681860, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 2169880, 9734796, 2697257, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 5392714, 16750228, 7563635, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 1052688, 8089971, 16764886, 8680827, 1052688, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 4868426, 8680827, 16756397, 9207172, 8089979, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 5920090, 7564659, 11377317, 11904685, 11377317, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 526344, 0, 526344, 2697257, 13023933, 4866370, 1052688, 0, 526344, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 3749945, 0, 0, 1580056, 11379373, 3748913, 0, 0, 3749945, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 4343106, 0, 526344, 4340802, 8681860, 11378341, 1052688, 0, 4343106, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 4868426, 1581097, 3748921, 3223601, 15692147, 10261140, 10262172, 2171937, 4868426, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 3225657, 3757411, 4339769, 2170913, 15179420, 9734804, 10854053, 9734796, 7037283, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 3748921, 6514027, 5927291, 4339769, 1053712, 7037283, 10261148, 11904685, 10851996, 10261148, 11904693, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 4867402, 6513003, 5399923, 3222577, 1024, 7561595, 9208460, 10261140, 9207172, 8681851, 11907765, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 1024, 1579032, 1581089, 1052688, 527368, 4866411, 4867402, 3222577, 2697257, 2170913, 526344, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 1024, 4342082, 8089971, 5919058, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 1024, 4867402, 9197923, 14059140, 10846852, 5921114, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 527368, 4867394, 7036259, 14049635, 16748180, 14068397, 9208460, 3748921, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 1024, 4339769, 5920090, 6511971, 6510938, 6510938, 8681851, 8681860, 10260116, 8680836, 10851988, 4340802, 0, 0, 0, 0
    Data.l 0, 0, 0, 527384, 5392714, 6511971, 7563627, 7038315, 4340802, 3748913, 7563635, 8681860, 8088955, 8680827, 10262172, 9735836, 8089971, 8, 0, 0
    Data.l 0, 0, 0, 1024, 1580056, 3749945, 5393746, 5394770, 4340802, 1051664, 5393746, 7037283, 7563635, 7563635, 5394778, 5919058, 3223601, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 526344, 527368, 2170913, 6511971, 4866378, 1052688, 526344, 1024, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 1024, 5920090, 9734804, 9733780, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 1024, 7037283, 10853020, 10853029, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 1024, 1052688, 1024, 0, 0, 0, 0, 0, 0, 0, 0
  
  ;- dessin vaisseau1
  vaisseau1 :
    Data.l 20, 30
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 1024, 1052688, 1024, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 1024, 7037283, 10853020, 10853029, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 1024, 5920090, 9734804, 9733780, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 526344, 527368, 2170913, 6511971, 4866378, 1052688, 526344, 1024, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 1024, 1580056, 3749945, 5393746, 5394770, 4340802, 1051664, 5393746, 7037283, 7563635, 7563635, 5394778, 5919058, 3223601, 0, 0, 0
    Data.l 0, 0, 0, 527384, 5392714, 6511971, 7563627, 7038315, 4340802, 3748913, 7563635, 8681860, 8088955, 8680827, 10262172, 9735836, 8089971, 8, 0, 0
    Data.l 0, 0, 0, 0, 1024, 4339769, 5920090, 6511971, 6510938, 6510938, 8681851, 8681860, 10260116, 8680836, 10851988, 4340802, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 527368, 4867394, 7036259, 14049635, 16748180, 14068397, 9208460, 3748921, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 1024, 4867402, 9197923, 14059140, 10846852, 5921114, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 1024, 4342082, 8089971, 5919058, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 1024, 1579032, 1581089, 1052688, 527368, 4866411, 4867402, 3222577, 2697257, 2170913, 526344, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 4867402, 6513003, 5399923, 3222577, 1024, 7561595, 9208460, 10261140, 9207172, 8681851, 11907765, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 3748921, 6514027, 5927291, 4339769, 1053712, 7037283, 10261148, 11904685, 10851996, 10261148, 11904693, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 3225657, 3757411, 4339769, 2170913, 15179420, 9734804, 10854053, 9734796, 7037283, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 4868426, 1581097, 3748921, 3223601, 15692147, 10261140, 10262172, 2171937, 4868426, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 4343106, 0, 526344, 4340802, 8681860, 11378341, 1052688, 0, 4343106, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 3749945, 0, 0, 1580056, 11379373, 3748913, 0, 0, 3749945, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 526344, 0, 526344, 2697257, 13023933, 4866370, 1052688, 0, 526344, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 5920090, 7564659, 11377317, 11904685, 11377317, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 4868426, 8680827, 16756397, 9207172, 8089979, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 1052688, 8089971, 16764886, 8680827, 1052688, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 5392714, 16750228, 7563635, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 2169880, 9734796, 2697257, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 1024, 8681860, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8680827, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8680827, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7563627, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3224625, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2697257, 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
  
  ;- dessin euro
  euro :
    Data.l 17, 17
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 16711680, 16776960, 16711680, 16776960, 16711680, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 0, 0
    Data.l 0, 0, 0, 0, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 0
    Data.l 0, 0, 0, 0, 16711680, 16776960, 16711680, 16776960, 0, 0, 0, 0, 0, 0, 16711680, 16776960, 0
    Data.l 0, 0, 0, 16711680, 16776960, 16711680, 16776960, 0, 0, 0, 0, 0, 0, 0, 16776960, 16711680, 0
    Data.l 0, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 0, 0, 0, 0, 0, 0
    Data.l 0, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 16776960, 16711680, 16776960, 16711680, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 0, 0, 0, 0, 0, 0
    Data.l 0, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 16711680, 16776960, 16711680, 16776960, 0, 0, 0, 0, 0, 0, 0, 16776960, 16711680, 0
    Data.l 0, 0, 0, 0, 16711680, 16776960, 16711680, 16776960, 0, 0, 0, 0, 0, 0, 16711680, 16776960, 0
    Data.l 0, 0, 0, 0, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 0
    Data.l 0, 0, 0, 0, 0, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 16776960, 16711680, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 16711680, 16776960, 16711680, 16776960, 16711680, 0, 0, 0, 0
  
  ;- dessin bos
  bos :
    Data.l 187, 85
    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, 1024, 1024, 1024, 1024, 1051664, 1052688, 1052688, 1051664, 1024, 1024, 1024, 1024, 0, 0, 0, 0, 0, 0, 0, 1024, 1051664, 1052688, 1052688, 1051656, 1024, 1024, 1024, 0, 0, 0, 0, 0, 0, 0, 0, 1051656, 1052688, 1052688, 1051664, 1024, 1024, 1024, 1024, 0, 0, 0, 0, 0, 0, 0, 0, 1051664, 1052688, 1052688, 1051656, 1024, 1024, 1024, 1024, 0, 0, 0, 0, 0, 0, 0, 1051656, 1052688, 1052688, 1051664, 525312, 1024, 1024, 1024, 0, 0, 0, 0, 0, 0, 0, 0, 1051664, 1052688, 1052688, 1051664, 1024, 1024, 1024, 1024, 0, 0, 0, 0, 0, 0, 0, 1024, 1051664, 1052688, 1051664, 525312, 1024, 1024, 1024, 0, 0, 0, 0, 0, 0, 0, 0, 1051664, 1052688, 1052688, 1051664, 1024, 1024, 1024, 1024, 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, 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, 0, 0, 0, 525312, 525312, 525312, 525312, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 525312, 525312, 525320, 525312, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 525312, 526344, 525312, 525312, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 525312, 525312, 525320, 525312, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 525312, 526344, 525312, 525312, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 525312, 525320, 525312, 525312, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 525312, 525312, 525312, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 525312, 525320, 525312, 525312, 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, 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, 525320, 2696233, 3222569, 2697257, 2697257, 3222569, 3222569, 3222569, 3222569, 2697257, 2697257, 3222569, 2696233, 525320, 0, 0, 0, 0, 0, 0, 527368, 2697257, 3222569, 3222569, 3222569, 2697257, 3222569, 2696233, 527368, 0, 0, 0, 0, 0, 0, 526344, 2696233, 3223601, 3222569, 3222569, 2697257, 2697257, 3222569, 2696233, 525320, 0, 0, 0, 0, 0, 0, 526344, 2697257, 3222569, 3222569, 3222569, 2697257, 3222569, 3222577, 2170913, 525320, 0, 0, 0, 0, 0, 526344, 2696233, 3223601, 3222569, 3222569, 3222569, 2697257, 3222569, 2696233, 525320, 0, 0, 0, 0, 0, 0, 526344, 2697257, 3222577, 3222569, 3222569, 2697257, 3222569, 3222577, 2170913, 525320, 0, 0, 0, 0, 0, 0, 527368, 2697257, 3222569, 3222569, 3222569, 2697257, 3222569, 2696233, 527368, 0, 0, 0, 0, 0, 0, 526344, 2697257, 3222577, 3222569, 3222569, 2697257, 2697257, 2697257, 2697257, 2697257, 2697257, 3222569, 2697257, 526344, 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, 1579032, 9208460, 10261148, 10260116, 10260116, 10260116, 10260116, 10260116, 10260116, 10260116, 10260116, 10261148, 9208460, 1579032, 0, 0, 0, 0, 0, 0, 2697257, 9208460, 10261140, 10260116, 10260116, 10260116, 10261140, 9208460, 2696233, 0, 0, 0, 0, 0, 0, 1579032, 8680827, 11377317, 10261140, 10260116, 10260116, 10260116, 10261148, 9208460, 1579032, 0, 0, 0, 0, 0, 0, 1579032, 9208460, 10261140, 10260116, 10260116, 10260116, 10261140, 11377317, 8680827, 1579032, 0, 0, 0, 0, 0, 1579032, 8680827, 11377317, 10261140, 10260116, 10260116, 10260116, 10261140, 9208460, 1579032, 0, 0, 0, 0, 0, 0, 1579032, 9208460, 10261140, 10260116, 10260116, 10260116, 10261140, 11377317, 8680827, 1579032, 0, 0, 0, 0, 0, 0, 2697257, 9208460, 10261140, 10260116, 10260116, 10260116, 10261140, 9208460, 2696233, 0, 0, 0, 0, 0, 0, 1579032, 9208460, 10261148, 10260116, 10260116, 10260116, 10260116, 10260116, 10260116, 10260116, 10260116, 10850972, 9208460, 1579032, 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, 1579032, 10260116, 11378341, 11377317, 11377317, 10853029, 10853029, 10853029, 10853029, 11377317, 11377317, 11378341, 10260116, 1579032, 0, 0, 0, 0, 0, 0, 2698281, 10261140, 11378341, 10853029, 10853029, 11377317, 11378341, 10260116, 2697257, 0, 0, 0, 0, 0, 0, 1579032, 9208452, 11905709, 11378341, 10853029, 11377317, 11377317, 11378341, 10260116, 1579032, 0, 0, 0, 0, 0, 0, 1579032, 10261140, 11378341, 10853029, 10853029, 11377317, 11378341, 12428981, 9208460, 1579032, 0, 0, 0, 0, 0, 1579032, 9208452, 11905709, 11378341, 10853029, 11377317, 11377317, 11378341, 10260116, 1579032, 0, 0, 0, 0, 0, 0, 1579032, 10261140, 11379365, 10853029, 10853029, 11377317, 11378341, 12428981, 9208460, 1579032, 0, 0, 0, 0, 0, 0, 2698281, 10261140, 11378341, 10853029, 11377317, 11377317, 11378341, 10260116, 2697257, 0, 0, 0, 0, 0, 0, 1579032, 10260116, 11378341, 11377317, 11377317, 11377317, 11377317, 11377317, 11377317, 11377317, 11377317, 11378341, 10260116, 1579032, 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, 1579032, 9207172, 10260116, 9734804, 9734804, 9734804, 9735828, 9735828, 9734804, 9734804, 9734804, 10260116, 9207172, 1579032, 0, 0, 0, 0, 0, 0, 2697257, 9208460, 9735828, 9735828, 9734804, 9734804, 10259092, 9207172, 2696233, 0, 0, 0, 0, 0, 0, 1579032, 8091003, 10853029, 9735828, 9734804, 9734804, 9734804, 10260116, 9207172, 1579032, 0, 0, 0, 0, 0, 0, 1579032, 9208460, 9735828, 9735828, 9734804, 9734804, 10259092, 10851996, 8089979, 1579032, 0, 0, 0, 0, 0, 1579032, 8091003, 10853029, 9735828, 9734804, 9734804, 9734804, 10259092, 9207172, 1579032, 0, 0, 0, 0, 0, 0, 1579032, 9208460, 10261148, 9735828, 9734804, 9734804, 10259092, 10851996, 8089979, 1579032, 0, 0, 0, 0, 0, 0, 2697257, 9208460, 9735828, 9734804, 9734804, 9734804, 10259092, 9207172, 2696233, 0, 0, 0, 0, 0, 0, 1579032, 9207172, 10260116, 9734804, 9734804, 9734804, 9735828, 9735828, 9734804, 9734804, 9734804, 10260116, 9207172, 1579032, 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, 1579032, 9207172, 10259092, 9733780, 9733780, 9734804, 9734804, 9734804, 9734804, 9733780, 9733780, 10259092, 9207172, 1579032, 0, 0, 0, 0, 0, 0, 2696233, 8684172, 9735828, 9734804, 9734804, 9733780, 9734804, 9207172, 2696233, 0, 0, 0, 0, 0, 0, 1579032, 8091003, 10263205, 9735828, 9734804, 9733780, 9733780, 10259092, 9207172, 1579032, 0, 0, 0, 0, 0, 0, 1579032, 8684172, 9735828, 9734804, 9734804, 9733780, 9734804, 10850972, 8089979, 1579032, 0, 0, 0, 0, 0, 1579032, 8091003, 10263205, 9735828, 9734804, 9733780, 9733772, 9734804, 9207172, 1579032, 0, 0, 0, 0, 0, 0, 1579032, 8684172, 9735836, 9734804, 9734804, 9733780, 9734804, 10850972, 8089979, 1579032, 0, 0, 0, 0, 0, 0, 2696233, 8684172, 9735828, 9734804, 9733780, 9733772, 9734804, 9207172, 2696233, 0, 0, 0, 0, 0, 0, 1579032, 9207172, 10259092, 9733780, 9733780, 9734804, 9734804, 9734804, 9734804, 9733780, 9733780, 10259092, 9207172, 1579032, 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, 1579032, 9207172, 10259092, 9733780, 9733780, 9734804, 9734804, 9734804, 9734804, 9733780, 9733780, 10259092, 9207172, 1579032, 0, 0, 0, 0, 0, 0, 2696233, 9208460, 9735828, 9734804, 9734804, 9733780, 10259092, 9207172, 2696233, 0, 0, 0, 0, 0, 0, 1579032, 8091003, 10853029, 9735828, 9734804, 9733780, 9733780, 10259092, 9207172, 1579032, 0, 0, 0, 0, 0, 0, 1579032, 9208460, 9735828, 9734804, 9734804, 9733780, 10259092, 10850972, 8089979, 1579032, 0, 0, 0, 0, 0, 1579032, 8091003, 10853029, 9735828, 9734804, 9733780, 9733772, 10259092, 9207172, 1579032, 0, 0, 0, 0, 0, 0, 1579032, 9208460, 9735836, 9734804, 9734804, 9733780, 10259092, 10850972, 8089979, 1579032, 0, 0, 0, 0, 0, 0, 2696233, 9208460, 9735828, 9734804, 9733780, 9733772, 10259092, 9207172, 2696233, 0, 0, 0, 0, 0, 0, 1579032, 9207172, 10259092, 9733780, 9733780, 9734804, 9734804, 9734804, 9734804, 9733780, 9733780, 10259092, 9207172, 1579032, 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, 1579032, 9207172, 10260116, 9734804, 9734804, 9734804, 9735828, 9735828, 9734804, 9734804, 9734804, 10260116, 9207172, 1579032, 0, 0, 0, 0, 0, 0, 2696233, 9208460, 9735828, 9735828, 9734804, 9734804, 10259092, 9207172, 2696233, 0, 0, 0, 0, 0, 0, 1579032, 8091003, 10853029, 9735828, 9734804, 9734804, 9734804, 10260116, 9207172, 1579032, 0, 0, 0, 0, 0, 0, 1579032, 9208460, 9735828, 9735828, 9734804, 9734804, 10259092, 10851996, 8089979, 1579032, 0, 0, 0, 0, 0, 1579032, 8091003, 10853029, 9735828, 9734804, 9734804, 9733780, 10259092, 9207172, 1579032, 0, 0, 0, 0, 0, 0, 1579032, 9208460, 10261148, 9735828, 9734804, 9734804, 10259092, 10851996, 8089979, 1579032, 0, 0, 0, 0, 0, 0, 2696233, 9208460, 9735828, 9734804, 9734804, 9733780, 10259092, 9207172, 2696233, 0, 0, 0, 0, 0, 0, 1579032, 9207172, 10260116, 9734804, 9734804, 9734804, 9735828, 9735828, 9734804, 9734804, 9734804, 10260116, 9207172, 1579032, 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, 526344, 526344, 526344, 526344, 526344, 526344, 526344, 526344, 527368, 1051656, 1051656, 1051656, 527376, 527376, 1051664, 1052688, 1052688, 1052688, 1052688, 1052688, 1052688, 1052688, 1052688, 1052688, 1052688, 1052688, 2696233, 9206148, 9733780, 9732748, 9732748, 9209484, 9209484, 9209484, 9209484, 9732748, 9732748, 9733780, 9206148, 2696233, 1052688, 1052688, 1052688, 1052688, 1052688, 1052688, 3223601, 8682884, 9209484, 9209484, 9209484, 9732748, 9733772, 9206148, 3223601, 1052688, 1052688, 1052688, 1052688, 1052688, 1052688, 2696233, 8089979, 9736860, 9209484, 9209484, 9732748, 9732748, 9733780, 9206148, 2696233, 1052688, 1052688, 1052688, 1052688, 1052688, 1052688, 2696233, 8682884, 9209484, 9209484, 9209484, 9732748, 9733772, 10260116, 8089979, 2696233, 1052688, 1052688, 1052688, 1052688, 1052688, 2696233, 8089979, 9736860, 9209484, 9209484, 9733772, 9732748, 9733772, 9206148, 2696233, 1052688, 1052688, 1052688, 1052688, 1052688, 1052688, 2696233, 8682884, 9734804, 9209484, 9209484, 9732748, 9733772, 10260116, 8089979, 2696233, 1052688, 1052688, 1052688, 1052688, 1052688, 1052688, 3223601, 8682884, 9209484, 9209484, 9733772, 9732748, 9733772, 9206148, 3223601, 1052688, 1052688, 1052688, 1052688, 1052688, 1052688, 2696233, 9206148, 9733780, 9732748, 9732748, 9209484, 9209484, 9209484, 9209484, 9732748, 9732748, 9733780, 9206148, 2696233, 1052688, 1052688, 1052688, 1052688, 1052688, 1052688, 1052688, 1052688, 1052688, 1052688, 1052688, 1051664, 527376, 527376, 1051656, 1051656, 1051656, 527368, 526344, 526344, 526344, 526344, 526344, 526344, 526344, 526344, 0, 0, 0, 0
    Data.l 0, 0, 0, 525320, 2696233, 2697257, 2697257, 2697257, 2697257, 2697257, 2696233, 3222577, 4866370, 4867402, 4866378, 4866378, 4867402, 4867402, 4867402, 5919066, 6510947, 6510938, 6510938, 6510938, 6510938, 6510938, 6510938, 6510938, 6510938, 6510938, 6510947, 7563627, 7563627, 7563627, 7562603, 6511962, 6510938, 6510938, 6511962, 7562603, 7563627, 7563627, 7563627, 6510947, 6510938, 6510938, 6510938, 6510938, 6510938, 6510947, 6510947, 6510947, 6510938, 5921114, 6511971, 7562603, 7563627, 7563627, 6511971, 6510938, 6510938, 6510938, 6510938, 6510938, 6510938, 6510947, 6511971, 6511971, 6510938, 6511962, 7562603, 7563627, 7563627, 7563627, 6510947, 6510938, 6510938, 6510938, 6510938, 6510938, 6510947, 6510947, 6510947, 6510938, 5921114, 6511971, 7562603, 7563627, 7563635, 7562603, 6510947, 6510938, 6510938, 6510938, 6510938, 6510938, 6510947, 6511971, 6511971, 6510938, 6511962, 7038315, 7563635, 7563627, 7563627, 6510947, 6510938, 6510938, 6510938, 6510938, 6510938, 6510947, 6510947, 6510947, 6510938, 6510938, 6511962, 7562603, 7563627, 7563635, 7562603, 6510947, 6510938, 6510938, 6510938, 6510938, 6510938, 6510947, 6510947, 6510947, 6510938, 6511962, 7038315, 7563635, 7563627, 7563627, 6511971, 6510947, 6510938, 6510938, 6510938, 6510938, 6510938, 6510947, 7563627, 7563627, 7563627, 7562603, 6511962, 6510938, 6510938, 6511962, 7562603, 7563627, 7563627, 7563627, 6510947, 6510938, 6510938, 6510938, 6510938, 6510938, 6510938, 6510938, 6510938, 6510938, 6510947, 5919066, 4867402, 4867402, 4867402, 4866378, 4866378, 4867402, 4866370, 3222577, 2696233, 2697257, 2697257, 2697257, 2697257, 2697257, 2696233, 525320, 0, 0, 0
    Data.l 0, 0, 0, 526344, 3223601, 3748913, 3748913, 3748913, 3748913, 3747889, 3223601, 4339769, 5919066, 6509914, 5920090, 5920090, 5920090, 5920099, 5921123, 8088947, 8679803, 8089979, 8089979, 8089979, 8089979, 8089979, 8089979, 8089979, 8089979, 8089979, 8088947, 7037283, 6511971, 6511971, 6510947, 5392714, 4868426, 4868426, 5392714, 6510947, 6511971, 6511971, 7037283, 8088947, 8089979, 8089979, 8089979, 8089979, 8089979, 8679803, 7563635, 5393746, 4867402, 4867402, 5393738, 6510947, 6511971, 7037283, 8088947, 8089979, 8089979, 8089979, 8089979, 8089979, 8089979, 8088947, 5919058, 4867402, 4867402, 5392714, 6510947, 6511971, 6511971, 7037283, 8088947, 8089979, 8089979, 8089979, 8089979, 8089979, 8089979, 8088947, 5393746, 4867402, 4867402, 5393738, 6510947, 6511971, 6511971, 7037291, 8088947, 8089979, 8089979, 8089979, 8089979, 8089979, 8088947, 5919058, 4867402, 4867402, 5392714, 6510938, 7036259, 6511971, 7037283, 8088947, 8089979, 8089979, 8089979, 8089979, 8089979, 8089979, 8088947, 5393746, 4867402, 4868426, 5392714, 6510947, 6511971, 6511971, 7037291, 8088947, 8089979, 8089979, 8089979, 8089979, 8089979, 8679803, 7563635, 5393746, 4867402, 5392714, 6510938, 7036259, 6511971, 7037283, 8088947, 8089979, 8089979, 8089979, 8089979, 8089979, 8089979, 8088947, 7037283, 6511971, 6511971, 6510947, 5392714, 4868426, 4868426, 5392714, 6510947, 6511971, 6511971, 7037283, 8088947, 8089979, 8089979, 8089979, 8089979, 8089979, 8089979, 8089979, 8089979, 8089979, 8679803, 8088947, 5921123, 5920099, 5920090, 5920090, 5920090, 6509914, 5919066, 4339769, 3223601, 3747889, 3748913, 3748913, 3748913, 3748913, 3223601, 526344, 0, 0, 0
    Data.l 0, 0, 0, 526344, 3748913, 3749945, 3748921, 3748921, 3748921, 3748921, 3748913, 4340802, 5920090, 6509914, 6509914, 5920090, 5921123, 5921123, 6510947, 7562611, 8088947, 7563635, 7563635, 7563635, 7563635, 7563635, 7563635, 7563635, 7563635, 7563635, 7563635, 7037291, 7037291, 7037291, 7037283, 5919058, 5394770, 5394770, 5919058, 7037283, 7037291, 7037291, 7037291, 7563635, 7563635, 7563635, 7563635, 7563635, 8087923, 8088947, 7562603, 5919058, 5393746, 5393746, 5920082, 7037283, 7037291, 7037291, 7563635, 7563635, 7563635, 7563635, 7563635, 8087923, 8087923, 7563635, 5920090, 5393746, 5393746, 5919058, 7037283, 7037291, 7037291, 7037291, 7563635, 7563635, 7563635, 7563635, 7563635, 7563635, 8088947, 7563635, 5919058, 5393746, 5393746, 5920082, 7037283, 7037291, 7037283, 7038315, 7563635, 7563635, 7563635, 7563635, 7563635, 8087923, 7563635, 5920090, 5393746, 5393746, 5919058, 7036259, 7038315, 7037291, 7037291, 7563635, 7563635, 7563635, 7563635, 7563635, 7563635, 8088947, 7563635, 5919058, 5393746, 5394770, 5919058, 7037283, 7037291, 7037283, 7038315, 7563635, 7563635, 7563635, 7563635, 7563635, 8087923, 8088947, 7562603, 5919058, 5393746, 5919058, 7036259, 7038315, 7037291, 7037291, 7563635, 8088947, 7563635, 7563635, 7563635, 7563635, 7563635, 7563635, 7037291, 7037291, 7037291, 7037283, 5919058, 5394770, 5394770, 5919058, 7037283, 7037291, 7037291, 7037291, 7563635, 7563635, 7563635, 7563635, 7563635, 7563635, 7563635, 7563635, 7563635, 7563635, 8088947, 7562611, 6510947, 5921123, 5921123, 5920090, 6509914, 6509914, 5920090, 4340802, 3748913, 3748921, 3748921, 3748921, 3748921, 3749945, 3748913, 526344, 0, 0, 0
    Data.l 0, 0, 0, 1052688, 7038315, 8088947, 8088947, 8088947, 8088947, 7564659, 7563627, 8089979, 9209492, 9734804, 9733780, 9734804, 9735828, 9735828, 9734804, 8681851, 8679795, 8680827, 8680827, 8680827, 8680827, 8680827, 8680827, 8088955, 7564667, 8088955, 8088955, 8680827, 8680827, 8680836, 8091003, 7563627, 7563627, 7563627, 7563627, 8091003, 8680836, 8680827, 8680827, 8088955, 8088955, 7564667, 8088955, 8680827, 8680827, 8680827, 8089971, 7563627, 7562603, 7562603, 7563635, 8091003, 8680827, 8680827, 8088955, 7564667, 8088955, 8088955, 8679803, 8680827, 8680827, 8679803, 7563627, 7562603, 7562603, 7563627, 8091003, 8680836, 8680827, 8680827, 8088955, 8088955, 8088955, 8088955, 8680827, 8680827, 8680827, 8679803, 7563627, 7562603, 7562603, 7563635, 8091003, 8680827, 8680836, 8091003, 8088955, 8088955, 7564667, 8088955, 8680827, 8680827, 8679803, 7563627, 7562603, 7562603, 7563627, 8089979, 8680836, 8680827, 8680827, 8088955, 8088955, 8088955, 8088955, 8680827, 8680827, 8680827, 8679803, 7563627, 7563627, 7563627, 7563627, 8091003, 8680827, 8680836, 8091003, 8088955, 8088955, 7564667, 8088955, 8680827, 8680827, 8680827, 8089971, 7563627, 7562603, 7563627, 8089979, 8680836, 8680827, 8680827, 8680827, 8680827, 8680827, 8680827, 8088955, 7564667, 8088955, 8088955, 8680827, 8680827, 8680836, 8091003, 7563627, 7563627, 7563627, 7563627, 8091003, 8680836, 8680827, 8680827, 8088955, 8088955, 7564667, 8088955, 8680827, 8680827, 8680827, 8680827, 8680827, 8680827, 8679795, 8681851, 9734804, 9735828, 9735828, 9734804, 9733780, 9734804, 9209492, 8089979, 7563627, 7564659, 8088947, 8088947, 8088947, 8088947, 7038315, 1052688, 0, 0, 0
    Data.l 0, 0, 0, 1052688, 7037283, 7563635, 7563627, 7563627, 7563627, 7563627, 7562603, 8088947, 9209484, 9733780, 9209492, 9734804, 10262172, 10262172, 10261148, 9207172, 8679795, 8680827, 8680827, 8680827, 8680827, 8680827, 8680827, 8089979, 8089988, 8089979, 8089979, 8681860, 8681860, 8681860, 8680836, 8088947, 8088947, 8088947, 8088947, 8680836, 8681860, 8681860, 8681860, 8089979, 8089979, 8089988, 8089979, 8680827, 8680827, 8680827, 8680827, 8088947, 7564659, 7563635, 8088947, 8680836, 8681860, 8681860, 8089988, 8089979, 8089979, 8089979, 8680827, 8680827, 8680827, 8680827, 8088947, 7563635, 7564659, 8088947, 8680836, 8681860, 8681860, 8681860, 8089979, 8089979, 8089979, 8089979, 8680827, 8680827, 8680827, 8680827, 8088947, 7564659, 7563635, 8088947, 8680836, 8681860, 8681860, 8680836, 8089979, 8089979, 8089988, 8089979, 8680827, 8680827, 8680827, 8088947, 7563635, 7564659, 8088947, 8680827, 8681860, 8681860, 8681860, 8089979, 8089979, 8089979, 8089979, 8680827, 8680827, 8680827, 8680827, 8088947, 8088947, 8088947, 8088947, 8680836, 8681860, 8681860, 8680836, 8089979, 8089979, 8089988, 8089979, 8680827, 8680827, 8680827, 8680827, 8088947, 7564659, 8088947, 8680827, 8681860, 8681860, 8681860, 8680827, 8680827, 8680827, 8680827, 8089979, 8089988, 8089979, 8089979, 8681860, 8681860, 8681860, 8680836, 8088947, 8088947, 8088947, 8088947, 8680836, 8681860, 8681860, 8681860, 8089979, 8089979, 8089988, 8089979, 8680827, 8680827, 8680827, 8680827, 8680827, 8680827, 8679795, 9207172, 10261148, 10262172, 10262172, 9734804, 9209492, 9733780, 9209484, 8088947, 7562603, 7563627, 7563627, 7563627, 7563627, 7563635, 7037283, 1052688, 0, 0, 0
    Data.l 0, 0, 0, 1024, 2169880, 2170913, 2169889, 2169889, 2169889, 2169889, 2169889, 3222569, 5392714, 5393746, 4867402, 6510938, 10260116, 10851996, 10261140, 9206148, 8679803, 8680836, 8680836, 8680836, 8680836, 8680836, 8681860, 9733772, 9734804, 9734804, 9733772, 8681860, 8681860, 8681860, 8681860, 8680827, 8680827, 8680827, 8680827, 8681860, 8681860, 8681860, 8681860, 9733772, 9734804, 9734804, 9733772, 8681860, 8680836, 8680836, 8680827, 8680827, 8680827, 8680827, 8680827, 8681860, 8681860, 8681860, 9733772, 9734804, 9734804, 9733772, 8681860, 8680827, 8680836, 8680836, 8680827, 8680827, 8680827, 8680827, 8681860, 8681860, 8681860, 8681860, 9733772, 9734804, 9734804, 9733772, 8681860, 8680836, 8680836, 8680836, 8680827, 8680827, 8680827, 8680827, 8681860, 8681860, 8680836, 8681860, 9733772, 9734804, 9734804, 9733772, 8681860, 8680836, 8680836, 8680827, 8680827, 8680827, 8680827, 8680836, 8681860, 8681860, 8681860, 9733772, 9734804, 9734804, 9733772, 8681860, 8680836, 8680836, 8680836, 8680827, 8680827, 8680827, 8680827, 8681860, 8681860, 8680836, 8681860, 9733772, 9734804, 9734804, 9733772, 8681860, 8680836, 8680836, 8680827, 8680827, 8680827, 8680827, 8680836, 8681860, 8681860, 8681860, 8680836, 8680836, 8680836, 8681860, 9733772, 9734804, 9734804, 9733772, 8681860, 8681860, 8681860, 8681860, 8680827, 8680827, 8680827, 8680827, 8681860, 8681860, 8681860, 8681860, 9733772, 9734804, 9734804, 9733772, 8681860, 8680836, 8680836, 8680836, 8680836, 8680836, 8679803, 9206148, 10261140, 10851996, 10260116, 6510938, 4867402, 5393746, 5392714, 3222569, 2169889, 2169889, 2169889, 2169889, 2169889, 2170913, 2169880, 1024, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1052688, 3747889, 3748921, 3222577, 5392714, 9734796, 10851988, 10261140, 9206148, 8679812, 8680836, 8680836, 8680836, 8680836, 8680836, 8681860, 9734804, 10261148, 10261148, 10260116, 8681860, 8680836, 8681860, 8681860, 8681851, 9206139, 9206139, 8681851, 8681860, 8681860, 8680836, 8681860, 10260116, 10261148, 10261148, 9734804, 8681860, 8680836, 8680836, 8680836, 8681851, 9206139, 9206139, 8681851, 8681860, 8680836, 8681860, 9734804, 10261148, 10261148, 10260116, 9206148, 8680836, 8680836, 8680836, 8681851, 9206139, 9206139, 8681851, 8681860, 8681860, 8680836, 8681860, 10260116, 10261148, 10261148, 10260116, 8681860, 8680836, 8680836, 8680836, 8681851, 9206139, 9206139, 8681851, 8681860, 8680836, 8680836, 9207172, 10260116, 10261148, 10261148, 9734804, 8681860, 8680836, 8680836, 8681851, 9206139, 9206139, 8681851, 8681860, 8680836, 8680836, 8681860, 10260116, 10261148, 10261148, 10260116, 8681860, 8680836, 8680836, 8680836, 8681851, 9206139, 9206139, 8681851, 8681860, 8680836, 8680836, 9207172, 10260116, 10261148, 10261148, 9734804, 8681860, 8680836, 8680836, 8680836, 8681851, 9206139, 8681851, 8681860, 8680836, 8681860, 8681860, 8680836, 8680836, 8680836, 8681860, 9734804, 10261148, 10261148, 10260116, 8681860, 8680836, 8681860, 8681860, 8681851, 9206139, 9206139, 8681851, 8681860, 8681860, 8680836, 8681860, 10260116, 10261148, 10261148, 9734804, 8681860, 8680836, 8680836, 8680836, 8680836, 8680836, 8679812, 9206148, 10261140, 10851988, 9734796, 5392714, 3222577, 3748921, 3747889, 1052688, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1052688, 3748921, 4339769, 3748921, 5393746, 9734796, 10851996, 10261140, 9206148, 8679812, 8680836, 8680836, 8680836, 8680836, 8680836, 8681860, 9734804, 10260116, 10260116, 10259092, 8681860, 8680836, 8681860, 8680836, 8681851, 8681851, 8681851, 8681851, 8680836, 8681860, 8680836, 8681860, 10259092, 10260116, 10260116, 9734804, 8681860, 8680836, 8680836, 8680836, 8681851, 8681851, 8681851, 8681851, 8680836, 8680836, 8681860, 9734804, 10260116, 10260116, 10259092, 8681860, 8680836, 8680836, 8680836, 8681851, 8681851, 8681851, 8681851, 8680836, 8681860, 8680836, 8681860, 10259092, 10260116, 10260116, 10259092, 8681860, 8680836, 8680836, 8680836, 8681851, 8681851, 8681851, 8681851, 8680836, 8680836, 8680836, 8682884, 10259092, 10260116, 10260116, 9734804, 8681860, 8680836, 8680836, 8681851, 8681851, 8681851, 8681851, 8681860, 8680836, 8680836, 8681860, 10259092, 10260116, 10260116, 10259092, 8681860, 8680836, 8680836, 8680836, 8681851, 8681851, 8681851, 8681851, 8680836, 8680836, 8680836, 8682884, 10259092, 10260116, 10260116, 9734804, 8681860, 8680836, 8680836, 8680836, 8681851, 8681851, 8681851, 8681860, 8680836, 8681860, 8681860, 8680836, 8680836, 8680836, 8681860, 9734804, 10260116, 10260116, 10259092, 8681860, 8680836, 8681860, 8680836, 8681851, 8681851, 8681851, 8681851, 8680836, 8681860, 8680836, 8681860, 10259092, 10260116, 10260116, 9734804, 8681860, 8680836, 8680836, 8680836, 8680836, 8680836, 8679812, 9206148, 10261140, 10851996, 9734796, 5393746, 3748921, 4339769, 3748921, 1052688, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
    Data.l 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1052688, 4339769, 4340802, 3748921, 5393746, 10260116, 10853020, 10850964, 9207172, 8680836, 8680836, 8680836, 8680836, 8680836, 8680836, 8681860, 9734804, 10260116, 10260116, 9734804, 8681860, 8680836, 8680836, 8680836, 8681851, 8681851, 8681851, 8681851, 8680836, 8680836, 8680836, 8681860, 9734804, 10260116, 10260116, 9734804, 8681860, 8680836, 8680836, 8680836, 8681851, 8681851, 8681851, 8681851, 8680836, 8680836, 8681860, 9734804, 10260116, 10260116, 9734804, 9206148, 8680836, 8680836, 8680836, 8681851, 8681851, 8681851, 8681851, 8680836, 8680836, 8680836, 8681860, 9734804, 10260116, 10260116, 9734804, 8681860, 8680836, 8680836, 8680836, 8681851, 8681851, 8681851, 8681851, 8680836, 8680836, 8091003, 8681860, 9734804, 10260116, 10260116, 9734804, 8681860, 8680836, 8680836, 8681851, 8681851, 8681851, 8681851, 8680836, 8680836, 8680836, 8681860, 9734804, 10260116, 10260116, 9734804, 8681860, 8680836, 8680836, 8680836, 8681851, 8681851, 8681851, 8681851, 8680836, 8680836, 8091003, 8681860, 9734804, 10260116, 10260116, 9734804, 8681860, 8680836, 8680836, 8680836, 8681851, 8681851,
Avatar de l’utilisateur
graph100
Messages : 1318
Inscription : sam. 21/mai/2005 17:50

Message par graph100 »

c quoi le biz la ...
ya une longueur limite dans les post 8O
bon

partie 1:

Code : Tout sélectionner

;- str bullet
Structure bullet
  x.l
  y.l
  a.l
  b.l
  arm.l
  type.l
EndStructure

;- str pointfloat
Structure pointfloat
  x.f
  y.f
EndStructure

;- str etoile
Structure star
  x.l
  y.l
  vitesse.l
  lum.l
  sens.l
EndStructure

Case_depart :

;- police

Global FontID5
FontID5 = LoadFont(1, "Arial Black", 10, #PB_Font_Underline)
Global FontID6
FontID6 = LoadFont(2, "Arial Black", 11)


;- proc window2
Procedure Window2()
  If OpenWindow(2, 301, 123, 534, 296, #pb_window_windowcentered, "Space - Magasin")
    If CreateGadgetList(WindowID())
      TextGadget(0, 25, 5, 65, 20, "Thunes :")
      SetGadgetFont(0, FontID5)
      TextGadget(1, 100, 5, 95, 20, "")
      TextGadget(0, 25, 30, 65, 20, Chr(201) + "nergie :")
      SetGadgetFont(0, FontID5)
      TextGadget(13, 100, 30, 95, 20, "")
      OptionGadget(2, 25, 95, 15, 15, "")
      OptionGadget(3, 25, 125, 15, 15, "")
      OptionGadget(4, 25, 155, 15, 15, "")
      OptionGadget(5, 25, 185, 15, 15, "")
      TextGadget(0, 25, 60, 85, 20, "Armement :")
      SetGadgetFont(0, FontID5)
      TextGadget(0, 60, 125, 100, 20, "Canon double")
      SetGadgetFont(0, FontID5)
      TextGadget(0, 60, 95, 100, 20, "Canon")
      SetGadgetFont(0, FontID5)
      TextGadget(0, 60, 155, 100, 20, "Canon triple")
      SetGadgetFont(0, FontID5)
      TextGadget(0, 60, 185, 105, 20, "Accumulateur")
      SetGadgetFont(0, FontID5)
      Frame3DGadget(0, 205, 5, 5, 245, "")
      TextGadget(0, 25, 215, 85, 20, "Puissance :")
      SetGadgetFont(0, FontID5)
      TextGadget(6, 125, 215, 60, 20, "")
      TextGadget(0, 225, 20, 60, 20, "Achat :")
      SetGadgetFont(0, FontID5)
      ButtonGadget(7, 220, 85, 230, 40, "Canon double")
      SetGadgetFont(7, FontID6)
      ButtonGadget(8, 220, 125, 230, 40, "Canon triple")
      SetGadgetFont(8, FontID6)
      ButtonGadget(9, 220, 165, 230, 40, "Accumulateur")
      SetGadgetFont(9, FontID6)
      ButtonGadget(10, 220, 205, 230, 40, "Puissance supplémentaire")
      SetGadgetFont(10, FontID6)
      TextGadget(0, 460, 100, 70, 20, "1000 ")
      SetGadgetFont(0, FontID5)
      TextGadget(0, 460, 140, 65, 20, "5000")
      SetGadgetFont(0, FontID5)
      TextGadget(0, 460, 180, 70, 20, "10000")
      SetGadgetFont(0, FontID5)
      TextGadget(0, 460, 220, 70, 20, "7500")
      SetGadgetFont(0, FontID5)
      ButtonGadget(11, 220, 45, 230, 40, "Vie supplémentaire")
      SetGadgetFont(11, FontID6)
      TextGadget(0, 460, 60, 70, 20, "500")
      SetGadgetFont(0, FontID5)
      ButtonGadget(12, 20, 255, 495, 30, "Continuer")
      SetGadgetFont(12, FontID6)
      
    EndIf
  EndIf
EndProcedure

;- proc SaveHightScore
Procedure SaveHightScore(filename.s, score, niveau, podium, version.s) ; sauvegarde le score et le niveau des x meilleurs dans un fichier
  Protected place, a, score, podium, filename, name.s, niveau
  
  If OpenFile(0, filename)
    
    If ReadString() <> version
      CloseFile(0)
      If CreateFile(0, filename)
        WriteStringN(version.s)
      EndIf
    EndIf
    
    
    Dim nom.s(podium)
    Dim score.s(podium)
    Dim niveau.s(podium)
    
    place = 0
    
    For a = 1 To podium
      nom(a) = ReadString()
      score(a) = ReadString()
      niveau(a) = ReadString()
      If score > Val(score(a)) And place = 0
        place = a
      EndIf
      If score(a) = "" : score(a) = "0" : EndIf
      If niveau(a) = "" : niveau(a) = "0" : EndIf
    Next
    
    CloseFile(0)
    
    If place <> 0
      name.s = InputRequester("Vous êtes " + Str(place) + " ème", "Entrez votre nom", "")
      For a = podium To 1 Step -1
        If a = place
          nom(a) = name
          score(a) = Str(score)
          niveau(a) = Str(niveau)
        EndIf
        If a > place
          nom(a) = nom(a - 1)
          score(a) = score(a - 1)
          niveau(a) = niveau(a - 1)
        EndIf
      Next
      
      If CreateFile(0, filename)
        WriteStringN(version)
        For a = 1 To podium
          WriteStringN(nom(a))
          WriteStringN(score(a))
          WriteStringN(niveau(a))
        Next
        CloseFile(0)
      EndIf
      
    EndIf
  EndIf
  
  ProcedureReturn place
EndProcedure

;- proc window0
Procedure window0()
  If OpenWindow(0, 0, 0, 600, 300, #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered, "Space")
    If CreateGadgetList(WindowID())
      TextGadget(0, 140, 5, 320, 65, "Space Impact", #PB_Text_Center | #PB_Text_Border)
      SetGadgetFont(0, LoadFont(1, "Arial", 36, #PB_Font_Underline))
      TrackBarGadget(1, 5, 155, 590, 35, 0, 19, #PB_TrackBar_Ticks)
      TextGadget(0, 100, 105, 400, 35, "Selectionnez la difficulté:", #PB_Text_Center | #PB_Text_Border)
      SetGadgetFont(0, LoadFont(2, "Bookman Old Style", 18))
      TextGadget(3, 5, 190, 50, 20, "+ facile")
      SetGadgetFont(3, LoadFont(3, "Arial", 12, #PB_Font_Underline))
      TextGadget(4, 545, 190, 50, 20, "- facile")
      SetGadgetFont(4, LoadFont(3, "Arial", 12, #PB_Font_Underline))
      ButtonGadget(5, 165, 215, 270, 40, "Go")
      SetGadgetFont(5, LoadFont(4, "Bookman Old Style", 16))
    EndIf
  EndIf
  SetGadgetState(1, 9)
EndProcedure

window0()

Repeat
  event = WaitWindowEvent()
Until event = #pb_event_closewindow Or EventGadgetID() = 5

If event = #pb_event_closewindow : End : EndIf

difficult = GetGadgetState(1)
CloseWindow(0)

;- init general
If InitMouse() = 0 Or InitSprite() = 0 Or InitKeyboard() = 0
  MessageRequester("Error", "Can't open DirectX 7", 0)
  End
EndIf

SetRefreshRate(60)

If OpenWindow(0, 0, 0, 640, 520, #PB_Window_ScreenCentered, "Space") And OpenWindowedScreen(WindowID(), 0, 20, 640, 480, 0, 0, 0) = 0
  MessageRequester("Attention", "l'ecran n'a pas pus être ouvert")
  End
EndIf

If CreateGadgetList(WindowID())
  TextGadget(14, 0, 0, 640, 20, "", #PB_Text_Center | #PB_Text_Border)
  ProgressBarGadget(15, 0, 500, 640, 20, 0, 255, #PB_ProgressBar_Smooth)
EndIf

;- draw sprite
For a = 0 To 4
  If a = 0 : Restore vaisseau : EndIf
  If a = 1 : Restore vaisseau1 : EndIf
  If a = 2 : Restore euro : EndIf
  If a = 4 : Restore bos : EndIf
  
  If a <> 3
    Read width
    Read height
    
    CreateSprite(a, width, height)
    
    If StartDrawing(SpriteOutput(a))
        For y2 = 0 To height - 1
          For x2 = 0 To width - 1
            Read color
            Plot(x2, y2, color)
          Next
        Next
      StopDrawing()
    EndIf
    TransparentSpriteColor(a, 0, 0, 0)
  EndIf
Next

;- init

bos.point
arme2 = 0
arme3 = 0
arme4 = 0
autorise = 300 - 10 * difficult
az = 0
vie = 480
q = 40
s = 420
bullet = 0
bulletmoi = 0
euro = 0
vitbullet = 2 + difficult / 3
degat = 10
arme = 0
limitvitesse = difficult / 2 + 1
enfonc = 0
vitesse.pointfloat\x = 0
vitesse.pointfloat\Y = 0

Dim bullet.bullet(1010)
Dim bulletmoi.bullet(310)
Dim stars.star(1010)
Dim euro.star(310)


;- proc diplayeuro
Procedure diplayeuro(t1, y1, euro, a, b)
  If euro(euro)\x = 0 And Random(10) = 0
    euro(euro)\x = 24 * t1 + a - 20
    euro(euro)\y = 36 * y1 + b - 34
    euro(euro)\vitesse = Random(2) + 1
    euro = euro + 1
  EndIf
  If euro >= 201 : euro = 0 : EndIf
  ProcedureReturn euro
EndProcedure

;- etoile init
star = 0
For a = 0 To 480 Step 2
  For b = 0 To 2
    stars(star)\x = Random(640)
    stars(star)\y = a
    stars(star)\vitesse = Random(3) + 1
    stars(star)\lum = Random(255)
    stars(star)\sens = Random(11) - 6
    star = star + 1
  Next
Next

;- debut
debut :


az = az + 1
az1.f = az * 2 / 10
If az1 = 0 : vitbullet = vitbullet + 1 : EndIf
DataSection
  niv1 :
    Data.l 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
    Data.l 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
    Data.l 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
  deplacement :
    Data.l - 1, 270, 270, -1, 270, -1
    Data.l 80, 80, -1, -1, 80, -1
EndDataSection

Dim vais(15, 3)
Dim deplacementx(6)
Dim deplacementy(6)

Restore niv1

For ligne = 1 To 3
  For colonne = 1 To 15
    Read z
    vais(colonne, ligne) = z * az
  Next
Next

Restore deplacement

For a = 1 To 6
  Read deplacementx(a)
Next
For a = 1 To 6
  Read deplacementy(a)
Next

a = -1
b = -150
c = 1
win = 0
viebos = 45 * az
presencebos = 0

Repeat
  event = WindowEvent()
  Delay(2)
  ExamineKeyboard()
  ClearScreen(0, 0, 0)
  restant = 0
  
        
  For g = 1 To 3
    For h = 1 To 15
      
      ;- display ennemis
      If vais(h, g) >= 1
        restant = restant + 1
        DisplayTransparentSprite(1, 24 * h + a - 20, 36 * g + b - 34)
        
        
        If Random(autorise) = 0 And bullet(bullet)\x = 0
          If Random(1) = 0
            bullet(bullet)\x = 24 * h + a - 10
            bullet(bullet)\y = 36 * g + b - 4
            bullet(bullet)\a = (Random(2) - 1) * vitbullet / 2
            bullet(bullet)\arm = 0
            bullet = bullet + 1
            If bullet >= 1001 : bullet = 1 : EndIf
          Else
            bullet(bullet)\x = 24 * h + a - 20
            bullet(bullet)\y = 36 * g + b - 4
            bullet(bullet)\a = 0
            bullet(bullet)\arm = 1
            bullet = bullet + 1
            If bullet >= 1001 : bullet = 1 : EndIf
            If bullet(bullet)\x = 0
              bullet(bullet)\x = 24 * h + a
              bullet(bullet)\y = 36 * g + b - 4
              bullet(bullet)\a = 0
              bullet(bullet)\arm = 1
              bullet = bullet + 1
              If bullet >= 1001 : bullet = 1 : EndIf
            EndIf
          EndIf
        EndIf
        
      EndIf
      
      ;- explosion
      If vais(h, g) <= 0 And vais(h, g) > - 15
        If StartDrawing(ScreenOutput())
            For ae = 1 To 40
              Repeat
                xplot = 24 * h + a - 22 + Random(34)
                yplot = 36 * g + b - 36 + Random(34)
                xplota = (xplot - (24 * h + a - 11)) * (xplot - (24 * h + a - 11))
                yplota = (yplot - (36 * g + b - 20)) * (yplot - (36 * g + b - 20))
              Until Sqr(xplota + yplota) < 15
              Circle(xplot, yplot, 1, RGB(255, Random(255), 0))
            Next
          StopDrawing()
        EndIf
        vais(h, g) = vais(h, g) - 1
      EndIf
      
    Next
  Next
  
  If arme = 0
    courante.s = "canon"
  ElseIf arme = 1
    courante.s = "canon double"
  ElseIf arme = 2
    courante.s = "canon triple"
  ElseIf arme = 3
    courante.s = "accumulateur"
  EndIf
  viereste.f = (vie / 480) * 100
  SetGadgetText(14, "Niveau = " + Str(az) + "        Ennemis vaincus = " + Str(45 * az - restant) + "        Vie restante = " + Str(viereste) + "%" + "        Thunes = " + Str(thune) + " euro        arme actuelle = " + courante)
  SetGadgetState(15, enfonc)
  
  ;- display euro
  For z = 1 To 300
    If euro(z)\x
      DisplayTransparentSprite(2, euro(z)\x, euro(z)\y)
      euro(z)\y = euro(z)\y + euro(z)\vitesse
      If euro(z)\y > 485
        euro(z)\x = 0
      ElseIf SpritePixelCollision(0, q, s, 2, euro(z)\x, euro(z)\y)
        euro(z)\x = 0
        thune = thune + Random(200) + 200
      EndIf
    EndIf
  Next
  
  If StartDrawing(ScreenOutput())
      
      ;- etoile fond
      For z = 0 To 1000
        Circle(stars(z)\x, stars(z)\y, 1, RGB(stars(z)\lum, stars(z)\lum, stars(z)\lum))
        stars(z)\lum = stars(z)\lum + stars(z)\sens
        stars(z)\y = stars(z)\y + stars(z)\vitesse
        If stars(z)\y > 480
          stars(z)\x = Random(640)
          stars(z)\y = 0
          stars(z)\vitesse = Random(3) + 1
        EndIf
        If stars(z)\lum > 248 Or stars(z)\lum < 7 : stars(z)\sens = -stars(z)\sens : EndIf
      Next
      
      ;- vie
      vert.f = ((vie / 480) * 255)
      Box(633, 480, 7, -vie, RGB(99, vert, 156))
      
    StopDrawing()
  EndIf
  
  ;- display bos
  If presencebos = 1
    DisplayTransparentSprite(4, 24 * 5 + a - 20, 36 * 2 + b - 34)
    h = 5
    g = 2
    If Random(50) = 0
      For bulletennemix = 18 To 138  Step 16
        If bullet(bullet)\x = 0
          bullet(bullet)\x = 24 * h + a + bulletennemix
          bullet(bullet)\y = 36 * g + b + 45
          bullet(bullet)\a = 0
          bullet(bullet)\arm = 1
          bullet = bullet + 1
          If bullet >= 1001 : bullet = 1 : EndIf
        EndIf
      Next 
    EndIf
  EndIf
  
  ;- tir moi
  For z = 1 To 300
    If bulletmoi(z)\x <> 0
      If bulletmoi(z)\type = 0
        CreateSprite(3, 2, 6)
        If StartDrawing(SpriteOutput(3))
            Box(0, 0, 2, 2, RGB($FF, $28, $00))
            Box(0, 2, 2, 2, RGB($FF, $6D, $00))
            Box(0, 4, 2, 2, RGB($FF, $9E, $00))
          StopDrawing()
        EndIf
        DisplaySprite(3, bulletmoi(z)\x - 1, bulletmoi(z)\y)
      ElseIf bulletmoi(z)\type = 1
        CreateSprite(3, bulletmoi(z)\arm * 4, bulletmoi(z)\arm * 4)
        If StartDrawing(SpriteOutput(3))
            DrawingMode(0)
            For ar = bulletmoi(z)\arm To 0 Step -1
              Circle(bulletmoi(z)\arm * 2, bulletmoi(z)\arm * 2, ar * 2, RGB(255, ar * 10, 0))
            Next
            DrawingMode(0)
          StopDrawing()
        EndIf
        TransparentSpriteColor(3, 0, 0, 0)
        DisplayTransparentSprite(3, bulletmoi(z)\x - bulletmoi(z)\arm * 2, bulletmoi(z)\y - bulletmoi(z)\arm * 2)
      EndIf
      
      If presencebos = 0
        If bulletmoi(z)\type = 0
          
          For g = 1 To 3
            For h = 1 To 15
              If vais(h, g) > 0
                x = 24 * h + a - 20
                y = 36 * g + b - 34
                If SpritePixelCollision(1, x, y, 3, bulletmoi(z)\x - 1, bulletmoi(z)\y)
                  bulletmoi(z)\x = 0
                  vais(h, g) = vais(h, g) - bulletmoi(z)\arm - 1
                  If vais(h, g) <= 0 : euro = diplayeuro(h, g, euro, a, b) : EndIf
                EndIf
              EndIf
            Next
          Next
          
        ElseIf bulletmoi(z)\type = 1
          For g = 1 To 3
            For h = 1 To 15
              If vais(h, g) > 0
                If SpritePixelCollision(1, 24 * h + a - 20, 36 * g + b - 34, 3, bulletmoi(z)\x - bulletmoi(z)\arm * 2, bulletmoi(z)\y - bulletmoi(z)\arm * 2)
                  vais(h, g) = vais(h, g) - bulletmoi(z)\arm
                  If vais(h, g) <= 0 : vais(h, g) = 0 : euro = diplayeuro(h, g, euro, a, b) : EndIf
                  bulletmoi(z)\arm = bulletmoi(z)\arm - 5
                  If bulletmoi(z)\arm <= 0
                    bulletmoi(z)\x = 0
                  EndIf
                EndIf
              EndIf
            Next
          Next
          
        EndIf
        
      Else
        If bulletmoi(z)\type = 0
          If SpritePixelCollision(4, 24 * 5 + a - 20, 36 * 2 + b - 34, 3, bulletmoi(z)\x - 1, bulletmoi(z)\y)
            bulletmoi(z)\x = 0
            viebos = viebos - bulletmoi(z)\arm - 1
            If viebos <= 0 : euro = diplayeuro(2, 5, euro, a, b) : EndIf
          EndIf
        ElseIf bulletmoi(z)\type = 1
          If SpritePixelCollision(4, 24 * h + a - 20, 36 * g + b - 34, 3, bulletmoi(z)\x - bulletmoi(z)\arm * 2, bulletmoi(z)\y - bulletmoi(z)\arm * 2)
            viebos = viebos - bulletmoi(z)\arm
            If viebos <= 0 : viebos = 0 : euro = diplayeuro(5, 2, euro, a, b) : EndIf
            bulletmoi(z)\arm = bulletmoi(z)\arm - 5
            If bulletmoi(z)\arm <= 0
              bulletmoi(z)\x = 0
            EndIf
          EndIf
        EndIf
      EndIf
      
      If viebos < 0 : win = 1 : EndIf
      
      bulletmoi(z)\y = bulletmoi(z)\y + bulletmoi(z)\b
      bulletmoi(z)\x = bulletmoi(z)\x + bulletmoi(z)\a
    EndIf
    If bulletmoi(z)\y < - 2 Or bulletmoi(z)\x < 5 Or bulletmoi(z)\x > 650
      bulletmoi(z)\x = 0
      bulletmoi(z)\type = 0
    EndIf
  Next
  
  If StartDrawing(ScreenOutput())
      
      ;- tir ennemis
      For z = 1 To 1000
        If bullet(z)\x <> 0
          Box(bullet(z)\x - 1, bullet(z)\y, 2, 2, RGB($00, $18, $FF))
          Box(bullet(z)\x - 1, bullet(z)\y - 2, 2, 2, RGB($00, $82, $FF))
          Box(bullet(z)\x - 1, bullet(z)\y - 4, 2, 2, RGB($00, $DF, $FF))
        EndIf
        If bullet(z)\x + 2 > q And bullet(z)\x - 2 < q + 19 And bullet(z)\y + 2 > s And bullet(z)\y - 2 < s + 29
          vie = vie - degat * (bullet(z)\arm + 1)
          bullet(z)\x = 0
          If vie <= 0
            mort = 45 * az - restant
            MessageRequester("Dommage", "Vous avez perdu")
            win = 2
          EndIf
        Else
          bullet(z)\y = bullet(z)\y + vitbullet
          bullet(z)\x = bullet(z)\x + bullet(z)\a
        EndIf
        If bullet(z)\y > 480 Or bullet(z)\x <= 5 Or bullet(z)\x >= 630
          bullet(z)\x = 0
        EndIf
        If win = 2 : Break : EndIf
      Next
      
      If restant = 0 And presencebos = 0
        presencebos = 1
        a = -1
        b = -150
      EndIf
      
    StopDrawing()
  EndIf
  DisplayTransparentSprite(0, q, s)
  FlipBuffers()
  
  ;- deplacement ennemis
  If b <= -2
    b = b + 2
  Else
    e = deplacementx(c)
    f = deplacementy(c)
    If (a = e Or a = e + 1) And (b = f Or b = f + 1) : c = c + 1 : EndIf
    If c = 7 : c = 1 : EndIf
    If a <> e And a <> e + 1 : a = a + 2 * (Abs(e) / e) : EndIf
    If b <> f And b <> f + 1 : b = b + 2 * (Abs(f) / f) : EndIf
  EndIf
  
  
  ;- deplacement
  delai = delai - 1
  If KeyboardPushed(#pb_key_left)
    If vitesse\x > - limitvitesse : vitesse\x = vitesse\x - 0.4 : EndIf
  EndIf
  If KeyboardPushed(#pb_key_right)
    If vitesse\x < limitvitesse : vitesse\x = vitesse\x + 0.4 : EndIf
  EndIf
  If KeyboardPushed(#pb_key_up)
    If vitesse\y > - limitvitesse : vitesse\y = vitesse\y - 0.4 : EndIf
  EndIf
  If KeyboardPushed(#pb_key_down)
    If vitesse\y < limitvitesse : vitesse\y = vitesse\y + 0.4 : EndIf
  EndIf
  
  
  q = q + vitesse\x
  s = s + vitesse\y
  If vitesse\x < 0 : vitesse\x = vitesse\x + 0.2 : EndIf
  If vitesse\x > 0 : vitesse\x = vitesse\x - 0.2 : EndIf
  If vitesse\y < 0 : vitesse\y = vitesse\y + 0.2 : EndIf
  If vitesse\y > 0 : vitesse\y = vitesse\y - 0.2 : EndIf
  
  If q < 5 : q = 5 : EndIf
  If q > 600 : q = 600 : EndIf
  If s < 250 : s = 250 : EndIf
  If s > 445 : s = 445 : EndIf
  
  If KeyboardPushed(#PB_Key_1) : arme = 0 : enfonc = 0 : EndIf
  If KeyboardPushed(#PB_Key_2) And arme2 : arme = 1 : enfonc = 0 : EndIf
  If KeyboardPushed(#PB_Key_3) And arme3 : arme = 2 : enfonc = 0 : EndIf
  If KeyboardPushed(#PB_Key_4) And arme4 : arme = 3 : ProgressBarGadget(1, 0, 500, 640, 20, 0, arme4, #PB_ProgressBar_Smooth) : enfonc = 0 : EndIf
  If KeyboardPushed(#pb_key_space) = 0 And arme = 3 And enfonc <> 0
    bulletmoi(bulletmoi)\x = q + 10
    bulletmoi(bulletmoi)\y = s
    bulletmoi(bulletmoi)\a = 0
    bulletmoi(bulletmoi)\b = -1.2 * vitbullet
    bulletmoi(bulletmoi)\arm = enfonc / 2
    bulletmoi(bulletmoi)\type = 1
    enfonc = 0
    bulletmoi = bulletmoi + 1
    If bulletmoi >= 301 : bulletmoi = 1 : EndIf
  EndIf
  If KeyboardPushed(#pb_key_space) And bulletmoi(bulletmoi)\x = 0 And delai <= 0
    If arme = 0
      bulletmoi(bulletmoi)\x = q + 10
      bulletmoi(bulletmoi)\y = s
      bulletmoi(bulletmoi)\a = 0
      bulletmoi(bulletmoi)\b = -vitbullet
      bulletmoi(bulletmoi)\arm = 0
      bulletmoi = bulletmoi + 1
      If bulletmoi >= 301 : bulletmoi = 1 : EndIf
      delai = 5
    EndIf
    If arme = 1
      bulletmoi(bulletmoi)\x = q
      bulletmoi(bulletmoi)\y = s
      bulletmoi(bulletmoi)\a = 0
      bulletmoi(bulletmoi)\b = -vitbullet
      bulletmoi(bulletmoi)\arm = 1
      bulletmoi = bulletmoi + 1
      If bulletmoi >= 301 : bulletmoi = 1 : EndIf
      If bulletmoi(bulletmoi)\x = 0
        bulletmoi(bulletmoi)\x = q + 20
        bulletmoi(bulletmoi)\y = s
        bulletmoi(bulletmoi)\a = 0
        bulletmoi(bulletmoi)\b = -vitbullet
        bulletmoi(bulletmoi)\arm = 1
        bulletmoi = bulletmoi + 1
        If bulletmoi >= 301 : bulletmoi = 1 : EndIf
      EndIf
      delai = 5
    EndIf
    If arme = 2
      bulletmoi(bulletmoi)\x = q + 10
      bulletmoi(bulletmoi)\y = s
      bulletmoi(bulletmoi)\a = 0
      bulletmoi(bulletmoi)\b = -vitbullet
      bulletmoi(bulletmoi)\arm = 2
      bulletmoi = bulletmoi + 1
      If bulletmoi >= 301 : bulletmoi = 1 : EndIf
      If bulletmoi(bulletmoi)\x = 0
        bulletmoi(bulletmoi)\x = q + 10
        bulletmoi(bulletmoi)\y = s
        bulletmoi(bulletmoi)\a = -2
        bulletmoi(bulletmoi)\b = -vitbullet
        bulletmoi(bulletmoi)\arm = 2
        If bulletmoi >= 301 : bulletmoi = 1 : EndIf
        bulletmoi = bulletmoi + 1
      EndIf
      If bulletmoi(bulletmoi)\x = 0
        bulletmoi(bulletmoi)\x = q + 10
        bulletmoi(bulletmoi)\y = s
        bulletmoi(bulletmoi)\a = 2
        bulletmoi(bulletmoi)\b = -vitbullet
        bulletmoi(bulletmoi)\arm = 2
        bulletmoi = bulletmoi + 1
        If bulletmoi >= 301 : bulletmoi = 1 : EndIf
      EndIf
      delai = 5
    EndIf
    If arme = 3
      enfonc = enfonc + 1
      If enfonc > arme4 : Enfonc = arme4 : EndIf
    EndIf
  EndIf
  
Until KeyboardPushed(#pb_key_escape) Or win <> 0
Répondre