Voici une démo de mon jeu actuel (a telecharger avec un clic droit) :
http://xmas.free.fr/sph/lemmz.zip
Nouvelle version anti plantage:
Code : Tout sélectionner
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;; debut du code : le 10 novembre 2025
;;;;;;
;;;;;; BP 6.30
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
InitSprite()
InitKeyboard()
InitMouse()
ExamineDesktops()
drx = DesktopWidth(0)
dry = DesktopHeight(0)
If drx>1920
drx=1920
dry=1080
EndIf
OpenScreen(drx,dry,32,"Sprite")
;;;;;;;;;;;;;;;;;;;;;;;;
;- metier()=0 : chute / parapluie
;- metier()=1 : marche
;- metier()=2 : escalier
;- metier()=3 : stoppeur
;- metier()=4 : grimpeur
;- metier()=5 : creuseur vertical
;- metier()=6 : piocheur
;- metier()=7 : creuseur horizontal
;- metier()=70 : crash
;- metier()=71 : >>mort<<
;- kill()=4 : kill
For i=1 To 328
If LoadSprite(i,"menu/"+Str(i)+".bmp", #PB_Sprite_AlphaBlending)
EndIf
Next
For i=800 To 803
If LoadSprite(i,"menu/"+Str(i)+".bmp", #PB_Sprite_AlphaBlending)
EndIf
Next
For i=900 To 907
If LoadSprite(i,"menu/"+Str(i)+".bmp", #PB_Sprite_AlphaBlending)
EndIf
Next
For i=998 To 999
If LoadSprite(i,"menu/"+Str(i)+".bmp", #PB_Sprite_AlphaBlending)
EndIf
Next
If LoadSprite(500,"menu/Menu.bmp", #PB_Sprite_AlphaBlending)
EndIf
If LoadSprite(501,"menu/cadre.bmp", #PB_Sprite_AlphaBlending)
EndIf
LoadSprite(1001,"menu/niveau1.bmp", #PB_Sprite_AlphaBlending)
;;;
;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;
;Création du sprite
CreateSprite(1000,drx,dry)
StartDrawing(SpriteOutput(1000))
u=111
o=0
For i=0 To dry-1
LineXY(0,i,drx,i,RGB(0,22,u))
o+1
o%11
If o=0
u-1
EndIf
Next
StopDrawing()
;;;;;;;;;;;
;;;;;;;;;;;
;;;;;;;;;;;
Dim p.b(drx,dry)
StartDrawing(SpriteOutput(1001))
; For i=0 To 20
; LineXY(300,800-i*14,800,300-i*14,RGBA(255,255,255,255))
; Next
For i=0 To drx-1
For u=0 To dry-1
If Point(i,u)<>0
p(i,u)=1
;Plot(i,u,RGBA(222,222,2,222))
EndIf
Next
Next
For i=0 To drx-1
For u=0 To 8
p(i,u)=3
p(i,dry-1-u)=3
Next
Next
For i=0 To 8
For u=0 To dry-1
p(i,u)=3
p(drx-1-i,u)=3
Next
Next
StopDrawing()
TempsDepart.q = ElapsedMilliseconds() ; Récupère la valeur actuelle
DisplayTransparentSprite(1001, 0, 0)
TempsEcoule.q = ElapsedMilliseconds()-TempsDepart ; La valeur 'TempsEcoule' devrait être d'environ 1000 millisecondes
; Debug "Temps écoulé : "+Str(TempsEcoule)+" millisecondes"
;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; D E B U T ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
cmb_de_bestioles=100
Dim lax(cmb_de_bestioles)
Dim lay(cmb_de_bestioles)
Dim sens.b(cmb_de_bestioles)
Dim dessin(cmb_de_bestioles)
Dim metier.b(cmb_de_bestioles)
Dim chute.w(cmb_de_bestioles)
Dim grimpe.b(cmb_de_bestioles)
Dim grimpe0.b(cmb_de_bestioles)
Dim parachute.b(cmb_de_bestioles)
Dim parachute0.b(cmb_de_bestioles)
Dim creuseH.b(cmb_de_bestioles)
Dim creuseH0.b(cmb_de_bestioles)
Dim escalier.b(cmb_de_bestioles)
Dim flag0.b(cmb_de_bestioles)
flag_u.b
Dim kill.b(cmb_de_bestioles)
Dim chrono.b(cmb_de_bestioles)
Dim chrono0.b(cmb_de_bestioles)
alpinisme.b=14
chute=344
curseur=998
For i=1 To cmb_de_bestioles
;kill(i)=1
lax(i)=Random(drx/1.2)+130
lay(i)=Random(100)+44
If cmb_de_bestioles=1
lax(i)=890
lay(i)=200
EndIf
sens(i)=Random(1)*2-1
If cmb_de_bestioles=1
sens(i)=-1
EndIf
If sens(i)=1
dessin(i)=101
Else
dessin(i)=101;105
EndIf
Next
stop.b=1
flag3.b=0
Flag_Mouse_Gauche.b=0
Flag_Mouse_Droit.b=0
Dim lax2(cmb_de_bestioles)
Dim lay2(cmb_de_bestioles)
Dim anti_freeze(cmb_de_bestioles)
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;; G O
;;;;;;;;;;;;;;;;;;;;;;;;;; G O
;;;;;;;;;;;;;;;;;;;;;;;;;; G O
;;;;;;;;;;;;;;;;;;;;;;;;;; G O
;-;;;;;;;;;;;;;;;;;;;;;;;; G O
;;;;;;;;;;;;;;;;;;;;;;;;;; G O
;;;;;;;;;;;;;;;;;;;;;;;;;; G O
;;;;;;;;;;;;;;;;;;;;;;;;;; G O
;;;;;;;;;;;;;;;;;;;;;;;;;; G O
;;;
menu_x=100
menu_y=dry-180
menu=0
Repeat
DisplaySprite(1000,0,0)
DisplayTransparentSprite(1001, 0, 0)
DisplaySprite(500,menu_x,menu_y)
DisplayTransparentSprite(501,menu_x+menu*91,menu_y)
zzzz=0
ExamineMouse()
mx=MouseX()
my=MouseY()
Mouse_Gauche=MouseButton(#PB_MouseButton_Left)
Mouse_Droit=MouseButton(#PB_MouseButton_Right)
;{ If Mouse_Gauche<>0 And Flag_Mouse_Gauche=0
;;;;;;;;;;;;
; If Mouse_Gauche<>0 And Flag_Mouse_Gauche=0
; Flag_Mouse_Gauche=1
If Flag_Mouse_Gauche=0
If mx>menu_x And mx<menu_x+818
If my>menu_y And my<menu_y+134
i=(mx-menu_x)/91
DisplayTransparentSprite(501,menu_x+i*91,menu_y)
If Mouse_Gauche<>0 And Flag_Mouse_Gauche=0
Flag_Mouse_Gauche=1
menu=i
EndIf
EndIf
EndIf
If menu=8
For i=1 To cmb_de_bestioles
If kill(i)=0 And metier(i)<70
kill(i)=1 ;- kill
EndIf
Next
EndIf
EndIf
;;;;;;;;;;;;
If Mouse_Gauche<>0 And Flag_Mouse_Gauche=0
Flag_Mouse_Gauche=1
If menu=7 And kill(perso_i)=0 And metier(perso_i)<70
kill(perso_i)=1 ;- kill
EndIf
If menu=8; And kill(perso_i)=0 And metier(perso_i)<70
EndIf
If menu=0 And metier(perso_i)=0 And parachute(perso_i)=0
parachute(perso_i)=1 : parachute0(perso_i)=1 ;- metier(perso_i)=2
EndIf
If menu=1 And metier(perso_i)=1 And metier(perso_i)<70
metier(perso_i)=3
EndIf
If menu=2 And metier(perso_i)=1 And metier(perso_i)<70
grimpe(perso_i)=1
EndIf
If menu=3 And metier(perso_i)=1 And metier(perso_i)<70
anti_freeze(perso_i)+1
metier(perso_i)=2
EndIf
If menu=4 And metier(perso_i)=1 And metier(perso_i)<70
creuseH(perso_i)=1
EndIf
If menu=5 And metier(perso_i)=1 And metier(perso_i)<70
metier(perso_i)=6
EndIf
If menu=6 And metier(perso_i)=1 And metier(perso_i)<70
metier(perso_i)=5
EndIf
EndIf
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ; ; ; ;
; ; ; ; ; If kill(perso_i)=0 And metier(perso_i)<70
; ; ; ; ; ; kill(perso_i)=1 ;- kill
; ; ; ; ; EndIf
; ; ; ; ; If metier(perso_i)=1 And metier(perso_i)<70
; ; ; ; ; ;parachute(perso_i)=1 : parachute0(perso_i)=1 ;- metier(perso_i)=2
; ; ; ; ; ;grimpe(perso_i)=1
; ; ; ; ; ;creuseH(perso_i)=1
; ; ; ; ; ; metier(perso_i)=2
; ; ; ; ;
; ; ; ; ; ; ; ; ; For i=0 To 10
; ; ; ; ; ; ; ; ; Debug p(lax(perso_i),lay(perso_i)+i)
; ; ; ; ; ; ; ; ; Next
; ; ; ; ; ; ; ; ; Debug "==="
; ; ; ; ; ; ; ; ; ; kill(perso_i)=1 ;- kill
; ; ; ; ; EndIf
; ; ; ; ;
; ; ; ; ;
; ; ; ; ;
; ; ; ; ; If metier(perso_i)=1 And metier(perso_i)<70
; ; ; ; ; metier(perso_i)=2
; ; ; ; ; anti_freeze(perso_i)+1
; ; ; ; ; EndIf
; ; ; ; ;
; grimpe(perso_i)=1
;}
;{
If Mouse_Gauche=0 And Flag_Mouse_Gauche=1
Flag_Mouse_Gauche=0
EndIf
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Dim lax2(cmb_de_bestioles)
Dim lay2(cmb_de_bestioles)
pres=100000
perso_i=0
anti_freeze(0)=1
For i=1 To cmb_de_bestioles
lax2(i)=Abs(lax(i)-mx)
lay2(i)=Abs(lay(i)-my-12)
For o=8 To 0 Step-2 ;- 1 ou 2 ?
If metier(i)>=70 ;- ajout
Goto suite0
EndIf
If lax2(i)<=o And lay2(i)<=o And pres>o
perso_i=i
pres=o
EndIf
Next
suite0:
Next
If perso_i=0 Or kill(perso_i)>0 Or metier(perso_i)>=70
curseur=998
Else
curseur=999
EndIf
;
Goto no2
StartDrawing(ScreenOutput())
DrawText(20,20,"Personnage ="+Str(perso_i),$FFFFFF,0)
DrawText(20,70,"lax2(i)="+Str(lax2(perso_i)),$FFFFFF,0)
DrawText(20,92,"lay2(i)="+Str(lay2(perso_i)),$FFFFFF,0)
DrawText(20,120,"sens(i)="+Str(sens(perso_i)),$FFDDDD,0)
DrawText(20,164,"metier(i)="+Str(metier(perso_i)),$FFDDDD,0)
DrawText(20,208,"parachute(i)="+Str(parachute(perso_i)),$FFDDDD,0)
DrawText(220,208,"parachute0(i)="+Str(parachute0(perso_i)),$FFDDDD,0)
DrawText(150,20,"kill(i)="+Str(kill(perso_i)),$6666FF,0)
StopDrawing()
no2:
;}
;;;;;
;;;;;
;;;;
;;;;
;;;
;;;
;;
;;
;
;
If stop=1
flag_u+1
flag_u%30
EndIf
For bestioles=1 To cmb_de_bestioles
If stop=1
flag0(bestioles)+1
flag0(bestioles)%4
EndIf
;- metier 0
;{
If metier(bestioles)=0
If parachute(bestioles)=0
If dessin(bestioles)<101 Or dessin(bestioles)>108
dessin(bestioles)=101
EndIf
If sens(bestioles)=-1
x=4
Else
x=0
EndIf
If kill(bestioles)<2 ;00000000000000000000000
DisplayTransparentSprite(dessin(bestioles)+x, lax(bestioles)-SpriteWidth(dessin(bestioles)+x)/2,lay(bestioles)-SpriteHeight(dessin(bestioles)+x)-0)
EndIf
Else
If parachute0(bestioles)=1
dessin(bestioles)=49
parachute0(bestioles)=0
EndIf
If sens(bestioles)=-1
x=10
Else
x=0
EndIf
If kill(bestioles)<2 ;00000000000000000000000
DisplayTransparentSprite(dessin(bestioles)+x, lax(bestioles)-SpriteWidth(dessin(bestioles)+x)/2,lay(bestioles)-SpriteHeight(dessin(bestioles)+x)-0)
EndIf
EndIf
If stop=1
If parachute(bestioles)=0
If flag0(bestioles)=0
dessin(bestioles)+1
If dessin(bestioles)>104
dessin(bestioles)=101
EndIf
EndIf
Else
If flag0(bestioles)=0
dessin(bestioles)+1
If dessin(bestioles)>58
dessin(bestioles)=53 ;49
EndIf
EndIf
EndIf
For i=1 To 3-parachute(bestioles) ;o
If p(lax(bestioles),lay(bestioles))<>0
If chute(bestioles)<-chute And parachute(bestioles)=0
; on meurt
metier(bestioles)=70
Goto suite
Else
chute(bestioles)=0
;If metier(bestioles)<>7 And metier(bestioles)<>8 And metier(bestioles)<>9 ;-ZZZ
If metier(bestioles)<70
metier(bestioles)=1
parachute(bestioles)=0
EndIf
;;;;;;;;;;;;;;;;;;;;;;;;;;;; dessin de marche ;;;;;;;;;;;;;;;
If sens(bestioles)=1
dessin(bestioles)=Random(5)+2
Else
dessin(bestioles)=Random(5)+10
EndIf
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Goto suite
EndIf
EndIf
; If grimpe_go(bestioles)=0
If kill(bestioles)<2 ;00000000000000000000000
lay(bestioles)+1
EndIf
chute(bestioles)-1
; EndIf
Next
EndIf
EndIf
suite:
;}
;;;;;;;;;;;;;;
;;;;;;;;;;;;;;
;- metier 1
;{
If metier(bestioles)=1
If dessin(bestioles)<1 Or dessin(bestioles)>16
If sens(bestioles)=1
dessin(bestioles)=1
Else
dessin(bestioles)=9
EndIf
EndIf
If kill(bestioles)<2
DisplayTransparentSprite(dessin(bestioles), lax(bestioles)-SpriteWidth(dessin(bestioles))/2,lay(bestioles)-SpriteHeight(dessin(bestioles))+1)
EndIf
If stop=1
If flag0(bestioles)=0
dessin(bestioles)+1
If sens(bestioles)=1
If dessin(bestioles)=9
dessin(bestioles)=1
EndIf
Else
If dessin(bestioles)=17
dessin(bestioles)=9
EndIf
EndIf
EndIf
If kill(bestioles)<2
lax(bestioles)+sens(bestioles)
EndIf
escalier.b=0
For o=0 To 13
If p(lax(bestioles)+1*sens(bestioles),lay(bestioles)-o)>0;<>0
escalier=o
EndIf
Next
;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;
; ; ; ; If echelle=666 ;- ECHELLE ====== 1
; ; ; ; ; For u=0 To 7
; ; ; ; ; Debug p(lax(bestioles)-6-sens(bestioles)*2,lay(bestioles)+u)
; ; ; ; ; Next
; ; ; ; ; Debug "==="
; ; ; ; StartDrawing(SpriteOutput(1001))
; ; ; ; DrawingMode(#PB_2DDrawing_AllChannels)
; ; ; ; ;Debug Point(lax(bestioles)+sens(bestioles)*2,lay(bestioles)+1)
; ; ; ;
; ; ; ; Plot(lax(bestioles)+sens(bestioles)*2,lay(bestioles),RGBA(255,255,255,255))
; ; ; ; Plot(lax(bestioles)+sens(bestioles)*3,lay(bestioles),RGBA(255,255,255,255))
; ; ; ; StopDrawing()
; ; ; ; EndIf
;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;
escalier2.b=0
For o=0 To 13
If p(lax(bestioles)+2*sens(bestioles),lay(bestioles)-o)>0;<>0
escalier2=o
EndIf
Next
escalier3.b=0
For o=0 To 13
If p(lax(bestioles)+3*sens(bestioles),lay(bestioles)-o)>0;<>0
escalier3=o
EndIf
Next
If escalier>2 And escalier2>3 And escalier3>4
;- futur metier
If grimpe(bestioles)+creuseH(bestioles)=0
sens(bestioles)*-1
If p(lax(bestioles)-2+sens(bestioles)*2,lay(bestioles)+3)=2
lax(bestioles)+sens(bestioles)*4 ; decallage de 4 pixels lors du retour
lay(bestioles)+1
EndIf
Else
If grimpe(bestioles)<>0
If sens(bestioles)=1
dessin(bestioles)=17
Else
dessin(bestioles)=25
EndIf
metier(bestioles)=4
Goto suite2
Else
If sens(bestioles)=1
dessin(bestioles)=165
Else
dessin(bestioles)=197
EndIf
metier(bestioles)=7
Goto suite2
EndIf
EndIf
If sens(bestioles)=1
dessin(bestioles)=Random(5)+2
Else
dessin(bestioles)=Random(5)+10
EndIf
Else
lay(bestioles)-escalier-2*0
EndIf
escalier.b=0
For o=8 To 1 Step-1
If p(lax(bestioles)+1*sens(bestioles),lay(bestioles)+o)<>0;5
escalier=o
EndIf
Next
If escalier=o
metier(bestioles)=0
If parachute(bestioles)=0
If sens(bestioles)=1
dessin(bestioles)=101
Else
dessin(bestioles)=105
EndIf
EndIf
Goto suite2
Else
lay(bestioles)+escalier-2
EndIf
EndIf
EndIf
suite2:
;}
;;;;;;;;;;;;;;
;;;;;;;;;;;;;;
;- metier 3
;{
If metier(bestioles)=3
If kill(bestioles)<2;- codé le 24/02
DisplayTransparentSprite(dessin(bestioles), lax(bestioles)-SpriteWidth(dessin(bestioles))/2,lay(bestioles)-SpriteHeight(dessin(bestioles))+1)
EndIf
If dessin(bestioles)<85 Or dessin(bestioles)>100
dessin(bestioles)=85
EndIf
For i=1 To 12 ;- mur construit
For u=-7 To 7
p(lax(bestioles)-u,lay(bestioles)-i)=3 ;-;;; anciennement 1
Next
Next
If stop=1
If flag0(bestioles)=0
dessin(bestioles)+1
If dessin(bestioles)>100
dessin(bestioles)=85
EndIf
EndIf
EndIf
EndIf
;}
;- metier 4
;{
If metier(bestioles)=4
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; A completer (quoi que...)
; If sens(bestioles)=1
; dessin(bestioles)=17
; Else
; dessin(bestioles)=25
; EndIf
DisplayTransparentSprite(dessin(bestioles), lax(bestioles)-sens(bestioles)*5-SpriteWidth(dessin(bestioles))/2,lay(bestioles)-SpriteHeight(dessin(bestioles))-0)
If stop=1
grimpe0(bestioles)+1
grimpe0(bestioles)%4
If grimpe0(bestioles)=0
;;;;;;;;;;;
flag1.b=0
StartDrawing(SpriteOutput(1001))
DrawingMode(#PB_2DDrawing_AllChannels)
For i=1 To 12
;p(lax(bestioles)+sens(bestioles)-5*sens(bestioles),lay(bestioles)-23)=1 ; a eliminer
Plot(lax(bestioles)+sens(bestioles)-i*sens(bestioles),lay(bestioles)-13 ,RGBA(255,0,0,255))
If p(lax(bestioles)+sens(bestioles)-i*sens(bestioles),lay(bestioles)-13)<>0
flag1+1
EndIf
Next
StopDrawing()
;;;;;;;;;;;
If flag1=0
lay(bestioles)-1
Else
grimpe(bestioles)=0
metier(bestioles)=0 ; on se cogne et on chute
sens(bestioles)*-1
If sens(bestioles)=1
dessin(bestioles)=101
Else
dessin(bestioles)=105
EndIf
Goto suite3
EndIf
If p(lax(bestioles)+sens(bestioles),lay(bestioles)-13)=0
metier(bestioles)=-4
If sens(bestioles)=1
dessin(bestioles)=33
Else
dessin(bestioles)=41
EndIf
Goto suite3
EndIf
dessin(bestioles)+1
If sens(bestioles)=1
If dessin(bestioles)>=25
dessin(bestioles)=17
EndIf
Else
If dessin(bestioles)>=33
dessin(bestioles)=25
EndIf
EndIf
EndIf
EndIf
EndIf
If metier(bestioles)=-4;- metier -4
DisplayTransparentSprite(dessin(bestioles), lax(bestioles)-sens(bestioles)*5-SpriteWidth(dessin(bestioles))/2,lay(bestioles)-SpriteHeight(dessin(bestioles))-0)
If stop=1
grimpe0(bestioles)+1
grimpe0(bestioles)%4
If grimpe0(bestioles)=0
;;;;;;;;;;;
If p(lax(bestioles)+sens(bestioles),lay(bestioles)-13)=0
EndIf
;;;;;;;;;;;
flag1.b=0
StartDrawing(SpriteOutput(1001))
DrawingMode(#PB_2DDrawing_AllChannels)
For i=1 To 12
Plot(lax(bestioles)+sens(bestioles)-i*sens(bestioles),lay(bestioles)-13 ,RGBA(255,255,0,255))
If p(lax(bestioles)+sens(bestioles)-i*sens(bestioles),lay(bestioles)-13)<>0
flag1+1
EndIf
Next
StopDrawing()
;;;;;;;;;;;
If flag1=0
lax(bestioles)+sens(bestioles)
lay(bestioles)-1
dessin(bestioles)+1
If dessin(bestioles)=41 Or dessin(bestioles)=48
metier(bestioles)=1
; parachute(bestioles)=0 ;- zzz
grimpe(bestioles)=0
lay(bestioles)-1
If sens(bestioles)=1
dessin(bestioles)=Random(5)+2
Else
dessin(bestioles)=Random(5)+10
EndIf
EndIf
Else
grimpe(bestioles)=0
metier(bestioles)=0 ; on se cogne et on chute
sens(bestioles)*-1
If sens(bestioles)=1
dessin(bestioles)=101
Else
dessin(bestioles)=105
EndIf
Goto suite3
EndIf
;;;;;;;;;;;
EndIf
EndIf
EndIf
suite3:
;}
;- metier 5
;{
If metier(bestioles)=5
If stop=1
If dessin(bestioles)<149 Or dessin(bestioles)>164
dessin(bestioles)=149
EndIf
u=p(lax(bestioles),lay(bestioles)+2+1)
If u=0 Or u=3 ;->>>>>>>>>>>>>>>>>>>>>>> derniere retouche
metier(bestioles)=0
Goto suite4
EndIf
If flag_u=0
;- trou dans le decors
StartDrawing(SpriteOutput(1001))
DrawingMode(#PB_2DDrawing_AllChannels)
f.f=0
For u=0 To 8
o=Cos(f)*15
For i=-o To o
p(lax(bestioles)+i,lay(bestioles)+u-5)=0
Plot(lax(bestioles)+i,lay(bestioles)+u-5,RGBA(0,0,0,0))
Next
f+0.067
Next
StopDrawing()
lay(bestioles)+1
;;;;;;;;;;;;;;;;;;;;;;;;
EndIf
If flag0(bestioles)=0
dessin(bestioles)+1
If dessin(bestioles)>164
dessin(bestioles)=149
EndIf
EndIf
EndIf
DisplayTransparentSprite(dessin(bestioles), lax(bestioles)-SpriteWidth(dessin(bestioles))/2,lay(bestioles)-SpriteHeight(dessin(bestioles))+1)
EndIf
suite4:
;}
;;;;;;
;;;;;;
;- metier 7
;{
If metier(bestioles)=7
If stop=1
If dessin(bestioles)<165 Or dessin(bestioles)>228
If sens(bestioles)=1
dessin(bestioles)=165
Else
dessin(bestioles)=197
EndIf
EndIf
If flag0(bestioles)=0
dessin(bestioles)+1
; creuseH0(bestioles)+1
EndIf
If sens(bestioles)=1
If dessin(bestioles)=197
dessin(bestioles)=165
EndIf
Else
If dessin(bestioles)=229
dessin(bestioles)=197
EndIf
EndIf
;;;;;;;;;;;
flag1.b=0
; StartDrawing(SpriteOutput(1001))
; DrawingMode(#PB_2DDrawing_AllChannels)
For i=0 To 16 ;- 0 ou 1 To 12 a 14
;p(lax(bestioles)+sens(bestioles)-5*sens(bestioles),lay(bestioles)-23)=1 ; a eliminer
;Plot(lax(bestioles)+sens(bestioles),lay(bestioles)-i ,RGBA(255,0,0,255))
u=p(lax(bestioles)+sens(bestioles),lay(bestioles)-i) ;->>>>>>>>>>>>>>>>>> Derniere retouche
If u=1 Or u<0
flag1+1
Break
EndIf
Next
StopDrawing()
;;;;;;;;;;;
If flag1=0
metier(bestioles)=1
creuseH(bestioles)=0
; creuseH0(bestioles)=0
Goto suite5
EndIf
If flag_u=0
;- trou dans le decors
StartDrawing(SpriteOutput(1001))
DrawingMode(#PB_2DDrawing_AllChannels)
For i=0 To 16 ;- 0 ou 1 To 12 a 16
Plot(lax(bestioles)+sens(bestioles),lay(bestioles)-i ,RGBA(0,0,0,0))
p(lax(bestioles)+sens(bestioles),lay(bestioles)-i)=0
Next
StopDrawing()
lax(bestioles)+sens(bestioles)
;;;;;;;;;;;;;;;;;;;;;;;;
EndIf
EndIf
DisplayTransparentSprite(dessin(bestioles), lax(bestioles)-SpriteWidth(dessin(bestioles))/2,lay(bestioles)-SpriteHeight(dessin(bestioles))+2)
EndIf
suite5:
;}
;- metier 6
;{
If metier(bestioles)=6
If stop=1
If dessin(bestioles)<229 Or dessin(bestioles)>276
If sens(bestioles)=1
dessin(bestioles)=229
Else
dessin(bestioles)=253
EndIf
EndIf
If flag0(bestioles)=0
dessin(bestioles)+1
; creuseH0(bestioles)+1
EndIf
If sens(bestioles)=1
If dessin(bestioles)=253
dessin(bestioles)=229
EndIf
Else
If dessin(bestioles)=277
dessin(bestioles)=253
EndIf
EndIf
; ; ; Debug p(lax(bestioles)+sens(bestioles),lay(bestioles))
; ; ; Debug p(lax(bestioles),lay(bestioles)+1)
; ; ; Debug p(lax(bestioles),lay(bestioles)+2)
; ; ;
; ; ; End:End
;;;;;;;;;;;
flag1.b=0
; StartDrawing(SpriteOutput(1001))
; DrawingMode(#PB_2DDrawing_AllChannels)
For i=-2 To 20 ;- -2 To 20
;p(lax(bestioles)+sens(bestioles)-5*sens(bestioles),lay(bestioles)-23)=1 ; a eliminer
; Plot(lax(bestioles)+sens(bestioles),lay(bestioles)-i ,RGBA(255,0,0,255))
u=p(lax(bestioles)+sens(bestioles),lay(bestioles)-i)
If u=1 ;->>>>>>>>>>>>>>>>>>>>>>>> derniere retouche
flag1+1
Break
EndIf
Next
; For i=0 To 7 ;- 0 ou 1 To x
;p(lax(bestioles)+sens(bestioles)-5*sens(bestioles),lay(bestioles)-23)=1 ; a eliminer
; Plot(lax(bestioles)+sens(bestioles),lay(bestioles)+2 ,RGBA(0,255,0,255))
If p(lax(bestioles)+sens(bestioles),lay(bestioles)+2)=1
flag1+1
;Break
EndIf
; Next
; StopDrawing()
;;;;;;;;;;;
If flag1=0
metier(bestioles)=1
;creuseH(bestioles)=0
; creuseH0(bestioles)=0
Goto suite6
EndIf
If flag_u=0
;- trou dans le decors
StartDrawing(SpriteOutput(1001))
DrawingMode(#PB_2DDrawing_AllChannels)
For i=-1 To 24 ;- -1 To 24
For u=1 To 8
Plot(lax(bestioles)+sens(bestioles)*u,lay(bestioles)-i+u-1 ,RGBA(0,0,0,0))
p(lax(bestioles)+sens(bestioles)*u,lay(bestioles)-i+u-1)=0
Next
Next
; For i=1 To 1;25
; Plot(lax(bestioles)+sens(bestioles)*i,lay(bestioles)+2 ,RGBA(0,0,0,0))
; p(lax(bestioles)+sens(bestioles)*i,lay(bestioles)+2)=0
; Next
StopDrawing()
lax(bestioles)+sens(bestioles)
lay(bestioles)+1
;;;;;;;;;;;;;;;;;;;;;;;;
EndIf
EndIf
DisplayTransparentSprite(dessin(bestioles), lax(bestioles)-SpriteWidth(dessin(bestioles))/2,lay(bestioles)-SpriteHeight(dessin(bestioles))+1)
EndIf
suite6:
;}
;- metier 2
;{
If anti_freeze(0)>0
anti_freeze(0)=0
StartDrawing(SpriteOutput(1001))
DrawingMode(#PB_2DDrawing_AllChannels)
For anti_freeze=1 To cmb_de_bestioles
If anti_freeze(anti_freeze)>0
If metier(anti_freeze)=2 And kill(anti_freeze)<2
flag2.b=0
If stop=1
If dessin(anti_freeze)<277 Or dessin(anti_freeze)>308
If sens(anti_freeze)=1
dessin(anti_freeze)=277
Else
dessin(anti_freeze)=293
EndIf
EndIf
If flag0(anti_freeze)=0
dessin(anti_freeze)+1
; creuseH0(anti_freeze)+1
EndIf
If sens(anti_freeze)=1
If dessin(anti_freeze)=287
flag2=1
EndIf
If dessin(anti_freeze)=293;;
dessin(anti_freeze)=277
escalier(anti_freeze)+1
lax(anti_freeze)+6
lay(anti_freeze)-2
EndIf
Else
If dessin(anti_freeze)=303
flag2=-1
EndIf
If dessin(anti_freeze)=309
dessin(anti_freeze)=293
escalier(anti_freeze)+1
lax(anti_freeze)-6
lay(anti_freeze)-2
EndIf
EndIf
; Debug p(lax(anti_freeze)+sens(anti_freeze),lay(anti_freeze)+1)
; Debug p(lax(anti_freeze)+sens(anti_freeze),lay(anti_freeze)+2)
; Debug p(lax(anti_freeze)+sens(anti_freeze),lay(anti_freeze)+3)
; End:End
;;;;;;;;;;;
flag1.b=0
If flag2<>0
; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; StartDrawing(SpriteOutput(1001))
; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; DrawingMode(#PB_2DDrawing_AllChannels)
For i=-1 To 6
For u=0 To 1
;If i>=4
p(lax(anti_freeze)+sens(anti_freeze)*i,lay(anti_freeze)-u+1)=-2
;Else
; p(lax(anti_freeze)+sens(anti_freeze)*i,lay(anti_freeze)-u+1)=-2 ;;;;;; 2
;EndIf
Plot(lax(anti_freeze)+sens(anti_freeze)*i,lay(anti_freeze)-u+1,RGBA(255,0,255,255))
Next
Next
; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; StopDrawing()
EndIf
escalier.b=0
For o=0 To 15;13
If p(lax(anti_freeze)+1*sens(anti_freeze),lay(anti_freeze)-o)<>0;5
escalier=o
EndIf
Next
For o=0 To 2;7
;Plot(lax(anti_freeze)+sens(anti_freeze)*o,lay(anti_freeze)-8,RGBA(222,222,222,255))
If p(lax(anti_freeze)+sens(anti_freeze)*o,lay(anti_freeze)-8)<>0;5
escalier=99
Break
EndIf
Next
If escalier>4
sens(anti_freeze)*-1
lax(anti_freeze)+sens(anti_freeze)*2
lay(anti_freeze)+1;2
metier(anti_freeze)=1
anti_freeze(anti_freeze)=0
echelle=1
Goto suite7
EndIf
; If escalier(anti_freeze)=4 And kill(anti_freeze)=0
; kill(anti_freeze)=1
; EndIf
If escalier(anti_freeze)>=24
escalier(anti_freeze)=0
metier(anti_freeze)=1
anti_freeze(anti_freeze)=0
EndIf
;;;;;;;;;;;
EndIf
EndIf
EndIf
suite7:
Next
StopDrawing()
For anti_freeze=1 To cmb_de_bestioles
If anti_freeze(anti_freeze)>0
If metier(anti_freeze)=2 And kill(anti_freeze)<2
DisplayTransparentSprite(dessin(anti_freeze), lax(anti_freeze)-SpriteWidth(dessin(anti_freeze))/2,lay(anti_freeze)-SpriteHeight(dessin(anti_freeze))+2)
EndIf
EndIf
Next
EndIf
;}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;- metier 70 (crash)
;{
If metier(bestioles)=70
If dessin(bestioles)<69 Or dessin(bestioles)>84
dessin(bestioles)=69
EndIf
DisplayTransparentSprite(dessin(bestioles), lax(bestioles)-SpriteWidth(dessin(bestioles))/2,lay(bestioles)-SpriteHeight(dessin(bestioles))+1)
If stop=1
If flag0(bestioles)=0
dessin(bestioles)+1
If dessin(bestioles)>84
metier(bestioles)=71
EndIf
EndIf
EndIf
EndIf
;}
;- metier 71 >> *Kill* <<
;{
If metier(bestioles)=71
If zzzz=0
zzzz=1
StartDrawing(SpriteOutput(1001))
DrawingMode(#PB_2DDrawing_AllChannels)
For i=1 To cmb_de_bestioles
If metier(i)=71
Circle(lax(i),lay(i),3,RGBA(255,255,255,255))
EndIf
Next
StopDrawing()
EndIf
EndIf
;}
;- >> Kill <<
;{
If kill(bestioles)=3
If stop=1
chrono0(bestioles)+1
chrono0(bestioles)%3
If chrono0(bestioles)=0
chrono(bestioles)+1
EndIf
EndIf
If chrono(bestioles)>3
DisplayTransparentSprite(803,lax(bestioles)-SpriteWidth(803)/2,lay(bestioles)-SpriteHeight(803),255-(chrono(bestioles)-3)*70)
; embrouille ci-dessous
kill(bestioles)=4
metier(bestioles)=8
If chrono(bestioles)>7
;kill(bestioles)=0
EndIf
Else
DisplayTransparentSprite(800+chrono(bestioles),lax(bestioles)-SpriteWidth(800+chrono(bestioles))/2,lay(bestioles)-SpriteHeight(800+chrono(bestioles)))
EndIf
EndIf
;;;
If kill(bestioles)=2
If stop=1
chrono0(bestioles)+1
chrono0(bestioles)%3
If chrono0(bestioles)=0
chrono(bestioles)+1
If chrono(bestioles)=15
kill(bestioles)=3
chrono(bestioles)=0
DisplayTransparentSprite(800,lax(bestioles)-SpriteWidth(800)/2,lay(bestioles)-SpriteHeight(800)/2-10)
;;;;;;;;;;;;;;;;;;;;;;
;- trou dans le decors
StartDrawing(SpriteOutput(1001))
DrawingMode(#PB_2DDrawing_AllChannels)
f.f=0
For u=0 To 20
o=Cos(f)*28
For i=-o To o
p=Random(Random(14))
If p(lax(bestioles)+i,lay(bestioles)+u-7+p)=1
Plot(lax(bestioles)+i,lay(bestioles)+u-7+p,RGBA(255,0,0,255))
EndIf
p=Random(Random(14))
If p(lax(bestioles)+i,lay(bestioles)-u-7-p)=1 And Random(1)=0
Plot(lax(bestioles)+i,lay(bestioles)-u-7-p,RGBA(255,0,0,255))
EndIf
p(lax(bestioles)+i,lay(bestioles)+u-7)=0
p(lax(bestioles)+i,lay(bestioles)-u-1-7)=0
Plot(lax(bestioles)+i,lay(bestioles)+u-7,RGBA(0,0,0,0))
Plot(lax(bestioles)+i,lay(bestioles)-u-1-7,RGBA(0,0,0,0))
Next
f+0.067
Next
StopDrawing()
;;;;;;;;;;;;;;;;;;;;;;;;
If metier(bestioles)=3
For i=1 To 12 ;- mur detruit
For u=-7 To 7
p(lax(bestioles)-u,lay(bestioles)-i)=0
Next
Next
EndIf
metier(bestioles)=0
EndIf
EndIf
EndIf
DisplayTransparentSprite(133+chrono(bestioles),lax(bestioles)-SpriteWidth(133+chrono(bestioles))/2,lay(bestioles)-SpriteHeight(133+chrono(bestioles)))
For i=1 To 3
If p(lax(bestioles),lay(bestioles))=0
If stop=1
lay(bestioles)+1
EndIf
EndIf
Next
EndIf
;;
If kill(bestioles)=1 And chrono(bestioles)<8
If stop=1
chrono0(bestioles)+1
chrono0(bestioles)%10 ;- compte a rebours
If chrono0(bestioles)=0
chrono(bestioles)+1
EndIf
EndIf
If chrono(bestioles)<8
DisplayTransparentSprite(900+chrono(bestioles), lax(bestioles)-SpriteWidth(900+chrono(bestioles))/2,lay(bestioles)-SpriteHeight(900+chrono(bestioles))-36)
Else
kill(bestioles)=2
chrono(bestioles)=0
EndIf
EndIf
;}
Next bestioles
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
DisplayTransparentSprite(curseur, mx-12 ,my-7)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
FlipBuffers()
Delay(1)
; chrono+1
; If chrono>100
; GrabSprite(2000,0,0,1920,1080)
; SaveSprite(2000,"c:\ProgramData\PureBasic\Examples\capture.bmp")
; End
; EndIf
ExamineKeyboard()
If KeyboardPushed(#PB_Key_Space)
If flag3=0
flag3=1
stop*-1
EndIf
ElseIf KeyboardReleased(#PB_Key_Space)
If flag3=1
flag3=0
EndIf
EndIf
Until KeyboardPushed(#PB_Key_Escape)

Nostalgie, quand tu nous tiens...
J'attends vos commentaires.
A+
==
PS : se joue a la souris et la pause avec la touche ESPACE
