Buff OK Mode Bourrin ON (a nettoyer)
This commit is contained in:
		
							
								
								
									
										4
									
								
								Bonhomme02/Form1.Designer.cs
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										4
									
								
								Bonhomme02/Form1.Designer.cs
									
									
									
										generated
									
									
									
								
							@@ -84,7 +84,7 @@ namespace Bonhomme02
 | 
				
			|||||||
            // 
 | 
					            // 
 | 
				
			||||||
            // NyanCatGif
 | 
					            // NyanCatGif
 | 
				
			||||||
            // 
 | 
					            // 
 | 
				
			||||||
            this.NyanCatGif.BackColor = System.Drawing.Color.Black;
 | 
					            this.NyanCatGif.BackColor = System.Drawing.Color.Gray;
 | 
				
			||||||
            this.NyanCatGif.Location = new System.Drawing.Point(995, 13);
 | 
					            this.NyanCatGif.Location = new System.Drawing.Point(995, 13);
 | 
				
			||||||
            this.NyanCatGif.Name = "NyanCatGif";
 | 
					            this.NyanCatGif.Name = "NyanCatGif";
 | 
				
			||||||
            this.NyanCatGif.Size = new System.Drawing.Size(154, 105);
 | 
					            this.NyanCatGif.Size = new System.Drawing.Size(154, 105);
 | 
				
			||||||
@@ -114,7 +114,7 @@ namespace Bonhomme02
 | 
				
			|||||||
            // 
 | 
					            // 
 | 
				
			||||||
            // TV
 | 
					            // TV
 | 
				
			||||||
            // 
 | 
					            // 
 | 
				
			||||||
            this.TV.BackColor = System.Drawing.Color.Black;
 | 
					            this.TV.BackColor = System.Drawing.Color.Gray;
 | 
				
			||||||
            this.TV.Location = new System.Drawing.Point(12, 13);
 | 
					            this.TV.Location = new System.Drawing.Point(12, 13);
 | 
				
			||||||
            this.TV.Name = "TV";
 | 
					            this.TV.Name = "TV";
 | 
				
			||||||
            this.TV.Size = new System.Drawing.Size(1137, 449);
 | 
					            this.TV.Size = new System.Drawing.Size(1137, 449);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -78,7 +78,7 @@ namespace Bonhomme02
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
            // https://msdn.microsoft.com/fr-be/Library/dd270696(v=vs.110).aspx
 | 
					            // https://msdn.microsoft.com/fr-be/Library/dd270696(v=vs.110).aspx
 | 
				
			||||||
            tasks.Add(Task.Factory.StartNew(() => {
 | 
					            tasks.Add(Task.Factory.StartNew(() => {
 | 
				
			||||||
                marche.Saut(ref this.Obstacle, 1);
 | 
					                marche.Saut(ref this.Obstacle, 5);
 | 
				
			||||||
                }));
 | 
					                }));
 | 
				
			||||||
            var continuation = Task.WhenAll(tasks); //https://docs.microsoft.com/en-us/dotnet/standard/parallel-programming/chaining-tasks-by-using-continuation-tasks
 | 
					            var continuation = Task.WhenAll(tasks); //https://docs.microsoft.com/en-us/dotnet/standard/parallel-programming/chaining-tasks-by-using-continuation-tasks
 | 
				
			||||||
            Task continuationTask = continuation.ContinueWith((antecedent) => {
 | 
					            Task continuationTask = continuation.ContinueWith((antecedent) => {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -14,6 +14,7 @@ namespace Bonhomme02
 | 
				
			|||||||
        Bonhomme bonhomme;
 | 
					        Bonhomme bonhomme;
 | 
				
			||||||
        IntPtr? handle;
 | 
					        IntPtr? handle;
 | 
				
			||||||
        Graphics gr;
 | 
					        Graphics gr;
 | 
				
			||||||
 | 
					        Graphics grBuf;
 | 
				
			||||||
        BufferedGraphics buff;
 | 
					        BufferedGraphics buff;
 | 
				
			||||||
        int ySol;
 | 
					        int ySol;
 | 
				
			||||||
        int resolution;
 | 
					        int resolution;
 | 
				
			||||||
@@ -43,7 +44,7 @@ namespace Bonhomme02
 | 
				
			|||||||
                Graphics gr = Graphics.FromHwnd(handle);
 | 
					                Graphics gr = Graphics.FromHwnd(handle);
 | 
				
			||||||
                if(handle == null){
 | 
					                if(handle == null){
 | 
				
			||||||
                bonhomme.Cacher(gr);
 | 
					                bonhomme.Cacher(gr);
 | 
				
			||||||
                buff.Render();
 | 
					                Rend();
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                else
 | 
					                else
 | 
				
			||||||
                bonhomme.Cacher(handle);
 | 
					                bonhomme.Cacher(handle);
 | 
				
			||||||
@@ -53,7 +54,7 @@ namespace Bonhomme02
 | 
				
			|||||||
                bonhomme.Coordonnee = newCoo;
 | 
					                bonhomme.Coordonnee = newCoo;
 | 
				
			||||||
                if(handle == null){
 | 
					                if(handle == null){
 | 
				
			||||||
                bonhomme.Afficher(gr);
 | 
					                bonhomme.Afficher(gr);
 | 
				
			||||||
                buff.Render();
 | 
					                Rend();
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                else
 | 
					                else
 | 
				
			||||||
                bonhomme.Afficher(handle);
 | 
					                bonhomme.Afficher(handle);
 | 
				
			||||||
@@ -63,6 +64,7 @@ namespace Bonhomme02
 | 
				
			|||||||
        {
 | 
					        {
 | 
				
			||||||
            handle = null;
 | 
					            handle = null;
 | 
				
			||||||
            step = 0;
 | 
					            step = 0;
 | 
				
			||||||
 | 
					            grBuf = Graphics.FromHwnd(bonhomme.conteneur.Handle);
 | 
				
			||||||
            this.gr = buff.Graphics;
 | 
					            this.gr = buff.Graphics;
 | 
				
			||||||
            this.buff = buff;
 | 
					            this.buff = buff;
 | 
				
			||||||
            this.bonhomme = bonhomme;
 | 
					            this.bonhomme = bonhomme;
 | 
				
			||||||
@@ -79,13 +81,13 @@ namespace Bonhomme02
 | 
				
			|||||||
            if(bonhomme.jambe1.Bas.CSG.Y != ySol) // On positionne le bonhomme sur le sol
 | 
					            if(bonhomme.jambe1.Bas.CSG.Y != ySol) // On positionne le bonhomme sur le sol
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                bonhomme.Cacher(gr);
 | 
					                bonhomme.Cacher(gr);
 | 
				
			||||||
                buff.Render();
 | 
					                Rend();
 | 
				
			||||||
                Point newCoo;
 | 
					                Point newCoo;
 | 
				
			||||||
                int longeurTTBonhome = bonhomme.jambe1.Bas.CSG.Y - bonhomme.CIG.Y ;// de pied.csg à bonhome.cig
 | 
					                int longeurTTBonhome = bonhomme.jambe1.Bas.CSG.Y - bonhomme.CIG.Y ;// de pied.csg à bonhome.cig
 | 
				
			||||||
                newCoo = new Point(bonhomme.CIG.X, ySol - longeurTTBonhome);
 | 
					                newCoo = new Point(bonhomme.CIG.X, ySol - longeurTTBonhome);
 | 
				
			||||||
                bonhomme.Coordonnee = newCoo;
 | 
					                bonhomme.Coordonnee = newCoo;
 | 
				
			||||||
                bonhomme.Afficher(gr);
 | 
					                bonhomme.Afficher(gr);
 | 
				
			||||||
                buff.Render();
 | 
					                Rend();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        public void Avancer()
 | 
					        public void Avancer()
 | 
				
			||||||
@@ -115,7 +117,7 @@ namespace Bonhomme02
 | 
				
			|||||||
                            bonhomme.Afficher(handle.Value);
 | 
					                            bonhomme.Afficher(handle.Value);
 | 
				
			||||||
                            dejaDeplacer += resolution;
 | 
					                            dejaDeplacer += resolution;
 | 
				
			||||||
                            if (handle == null)
 | 
					                            if (handle == null)
 | 
				
			||||||
                                buff.Render();
 | 
					                                Rend();
 | 
				
			||||||
                            Thread.Sleep(vitesse);
 | 
					                            Thread.Sleep(vitesse);
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -139,7 +141,7 @@ namespace Bonhomme02
 | 
				
			|||||||
                            bonhomme.Afficher(handle.Value);
 | 
					                            bonhomme.Afficher(handle.Value);
 | 
				
			||||||
                            dejaDeplacer += resolution;
 | 
					                            dejaDeplacer += resolution;
 | 
				
			||||||
                            if (handle == null)
 | 
					                            if (handle == null)
 | 
				
			||||||
                                buff.Render();
 | 
					                                Rend();
 | 
				
			||||||
                            Thread.Sleep(vitesse);
 | 
					                            Thread.Sleep(vitesse);
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                        CollerAuSol(ref bonhomme.jambe2); //Voir issues #24
 | 
					                        CollerAuSol(ref bonhomme.jambe2); //Voir issues #24
 | 
				
			||||||
@@ -149,20 +151,20 @@ namespace Bonhomme02
 | 
				
			|||||||
                        {
 | 
					                        {
 | 
				
			||||||
                            if(handle == null){
 | 
					                            if(handle == null){
 | 
				
			||||||
                            bonhomme.Cacher(gr);
 | 
					                            bonhomme.Cacher(gr);
 | 
				
			||||||
                            
 | 
					
 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                            else
 | 
					                            else
 | 
				
			||||||
                            bonhomme.Cacher(handle.Value);
 | 
					                            bonhomme.Cacher(handle.Value);
 | 
				
			||||||
                            bonhomme.jambe1.BougerBas(0, resolution);
 | 
					                            bonhomme.jambe1.BougerBas(0, resolution);
 | 
				
			||||||
                            if(handle == null){
 | 
					                            if(handle == null){
 | 
				
			||||||
                            bonhomme.Afficher(gr);
 | 
					                            bonhomme.Afficher(gr);
 | 
				
			||||||
                            
 | 
					
 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                            else
 | 
					                            else
 | 
				
			||||||
                            bonhomme.Afficher(handle.Value);
 | 
					                            bonhomme.Afficher(handle.Value);
 | 
				
			||||||
                            dejaDeplacer += resolution;
 | 
					                            dejaDeplacer += resolution;
 | 
				
			||||||
                            if (handle == null)
 | 
					                            if (handle == null)
 | 
				
			||||||
                                buff.Render();
 | 
					                                Rend();
 | 
				
			||||||
                            Thread.Sleep(vitesse);
 | 
					                            Thread.Sleep(vitesse);
 | 
				
			||||||
                            if (neww != bonhomme.jambe1.Bas.CSG.Y)
 | 
					                            if (neww != bonhomme.jambe1.Bas.CSG.Y)
 | 
				
			||||||
                            {
 | 
					                            {
 | 
				
			||||||
@@ -182,7 +184,7 @@ namespace Bonhomme02
 | 
				
			|||||||
                        {
 | 
					                        {
 | 
				
			||||||
                            if(handle == null){
 | 
					                            if(handle == null){
 | 
				
			||||||
                            bonhomme.Cacher(gr);
 | 
					                            bonhomme.Cacher(gr);
 | 
				
			||||||
                            
 | 
					
 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                            else
 | 
					                            else
 | 
				
			||||||
                            bonhomme.Cacher(handle.Value);
 | 
					                            bonhomme.Cacher(handle.Value);
 | 
				
			||||||
@@ -205,13 +207,13 @@ namespace Bonhomme02
 | 
				
			|||||||
                            bonhomme.Coordonnee = new Point(bonhomme.Coordonnee.X + resolution, bonhomme.Coordonnee.Y);
 | 
					                            bonhomme.Coordonnee = new Point(bonhomme.Coordonnee.X + resolution, bonhomme.Coordonnee.Y);
 | 
				
			||||||
                            if(handle == null){
 | 
					                            if(handle == null){
 | 
				
			||||||
                            bonhomme.Afficher(gr);
 | 
					                            bonhomme.Afficher(gr);
 | 
				
			||||||
                           
 | 
					
 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                            else
 | 
					                            else
 | 
				
			||||||
                            bonhomme.Afficher(handle.Value);
 | 
					                            bonhomme.Afficher(handle.Value);
 | 
				
			||||||
                            dejaDeplacer += resolution;
 | 
					                            dejaDeplacer += resolution;
 | 
				
			||||||
                            if (handle == null)
 | 
					                            if (handle == null)
 | 
				
			||||||
                                buff.Render();
 | 
					                                Rend();
 | 
				
			||||||
                            Thread.Sleep(vitesse);
 | 
					                            Thread.Sleep(vitesse);
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                        break;
 | 
					                        break;
 | 
				
			||||||
@@ -220,38 +222,38 @@ namespace Bonhomme02
 | 
				
			|||||||
                        {
 | 
					                        {
 | 
				
			||||||
                            if(handle == null){
 | 
					                            if(handle == null){
 | 
				
			||||||
                            bonhomme.Cacher(gr);
 | 
					                            bonhomme.Cacher(gr);
 | 
				
			||||||
                            
 | 
					
 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                            else
 | 
					                            else
 | 
				
			||||||
                            bonhomme.Cacher(handle.Value);
 | 
					                            bonhomme.Cacher(handle.Value);
 | 
				
			||||||
                            bonhomme.jambe2.BougerBas(0, resolution);
 | 
					                            bonhomme.jambe2.BougerBas(0, resolution);
 | 
				
			||||||
                            if(handle == null){
 | 
					                            if(handle == null){
 | 
				
			||||||
                            bonhomme.Afficher(gr);
 | 
					                            bonhomme.Afficher(gr);
 | 
				
			||||||
                            
 | 
					
 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                            else
 | 
					                            else
 | 
				
			||||||
                            bonhomme.Afficher(handle.Value);
 | 
					                            bonhomme.Afficher(handle.Value);
 | 
				
			||||||
                            dejaDeplacer += resolution;
 | 
					                            dejaDeplacer += resolution;
 | 
				
			||||||
                            if (handle == null)
 | 
					                            if (handle == null)
 | 
				
			||||||
                                buff.Render();
 | 
					                                Rend();
 | 
				
			||||||
                            Thread.Sleep(vitesse);
 | 
					                            Thread.Sleep(vitesse);
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                        if(handle == null){
 | 
					                        if(handle == null){
 | 
				
			||||||
                        bonhomme.Cacher(gr);
 | 
					                        bonhomme.Cacher(gr);
 | 
				
			||||||
                       
 | 
					
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                        else
 | 
					                        else
 | 
				
			||||||
                        bonhomme.Cacher(handle.Value);
 | 
					                        bonhomme.Cacher(handle.Value);
 | 
				
			||||||
                        bonhomme.InterevrtirJambe();// On inverse les deux jambe, jambe1=jambe2 et jambe2=jambe1
 | 
					                        bonhomme.InterevrtirJambe();// On inverse les deux jambe, jambe1=jambe2 et jambe2=jambe1
 | 
				
			||||||
                        if(handle == null){
 | 
					                        if(handle == null){
 | 
				
			||||||
                        bonhomme.Afficher(gr);
 | 
					                        bonhomme.Afficher(gr);
 | 
				
			||||||
                        
 | 
					
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                        else
 | 
					                        else
 | 
				
			||||||
                        bonhomme.Afficher(handle.Value);
 | 
					                        bonhomme.Afficher(handle.Value);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        if (handle == null)
 | 
					                        if (handle == null)
 | 
				
			||||||
                            buff.Render();
 | 
					                            Rend();
 | 
				
			||||||
                        step +=3; // retour step 3
 | 
					                        step +=3; // retour step 3
 | 
				
			||||||
                        break;
 | 
					                        break;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
@@ -279,7 +281,7 @@ namespace Bonhomme02
 | 
				
			|||||||
                //Graphics gr = Graphics.FromHwnd(handle.Value);
 | 
					                //Graphics gr = Graphics.FromHwnd(handle.Value);
 | 
				
			||||||
                if(handle == null){
 | 
					                if(handle == null){
 | 
				
			||||||
                bonhomme.Cacher(gr);
 | 
					                bonhomme.Cacher(gr);
 | 
				
			||||||
                
 | 
					
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                else
 | 
					                else
 | 
				
			||||||
                bonhomme.Cacher(handle.Value);
 | 
					                bonhomme.Cacher(handle.Value);
 | 
				
			||||||
@@ -289,13 +291,13 @@ namespace Bonhomme02
 | 
				
			|||||||
                bonhomme.Coordonnee = newCoo;
 | 
					                bonhomme.Coordonnee = newCoo;
 | 
				
			||||||
                if(handle == null){
 | 
					                if(handle == null){
 | 
				
			||||||
                bonhomme.Afficher(gr);
 | 
					                bonhomme.Afficher(gr);
 | 
				
			||||||
                
 | 
					
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                else
 | 
					                else
 | 
				
			||||||
                bonhomme.Afficher(handle.Value);
 | 
					                bonhomme.Afficher(handle.Value);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (handle == null)
 | 
					                if (handle == null)
 | 
				
			||||||
                    buff.Render();
 | 
					                    Rend();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        public void Saut(ref PictureBox osbtacle, int vitesse)
 | 
					        public void Saut(ref PictureBox osbtacle, int vitesse)
 | 
				
			||||||
@@ -322,12 +324,12 @@ namespace Bonhomme02
 | 
				
			|||||||
                }
 | 
					                }
 | 
				
			||||||
                if(handle == null){
 | 
					                if(handle == null){
 | 
				
			||||||
                bonhomme.Afficher(gr);
 | 
					                bonhomme.Afficher(gr);
 | 
				
			||||||
                
 | 
					
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                else
 | 
					                else
 | 
				
			||||||
                bonhomme.Afficher(handle.Value);
 | 
					                bonhomme.Afficher(handle.Value);
 | 
				
			||||||
                if (handle == null)
 | 
					                if (handle == null)
 | 
				
			||||||
                    buff.Render();
 | 
					                    Rend();
 | 
				
			||||||
                Thread.Sleep(vitesse);
 | 
					                Thread.Sleep(vitesse);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            while (bonhomme.jambe1.Bas.CSG.Y < ySol)//descendre
 | 
					            while (bonhomme.jambe1.Bas.CSG.Y < ySol)//descendre
 | 
				
			||||||
@@ -355,11 +357,21 @@ namespace Bonhomme02
 | 
				
			|||||||
                bonhomme.Afficher(handle.Value);
 | 
					                bonhomme.Afficher(handle.Value);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (handle == null)
 | 
					                if (handle == null)
 | 
				
			||||||
                    buff.Render();
 | 
					                    Rend();
 | 
				
			||||||
                Thread.Sleep(vitesse);
 | 
					                Thread.Sleep(vitesse);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            Avancer(vitesse, bonhomme.conteneur.Location.X + bonhomme.conteneur.Width, 3);
 | 
					            Avancer(vitesse, bonhomme.conteneur.Location.X + bonhomme.conteneur.Width, 3);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        public void Rend()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            if (handle == null)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                gr.FillRectangle(new SolidBrush(bonhomme.conteneur.BackColor), 0, 0, bonhomme.conteneur.Width, bonhomme.conteneur.Height);
 | 
				
			||||||
 | 
					                bonhomme.Afficher(gr);
 | 
				
			||||||
 | 
					                buff.Render();
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										
											BIN
										
									
								
								Bonhomme02/Resources/Super Mario Bros Win Stage Sound Effect.wav
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Bonhomme02/Resources/Super Mario Bros Win Stage Sound Effect.wav
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
		Reference in New Issue
	
	Block a user