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
 | 
			
		||||
            // 
 | 
			
		||||
            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.Name = "NyanCatGif";
 | 
			
		||||
            this.NyanCatGif.Size = new System.Drawing.Size(154, 105);
 | 
			
		||||
@@ -114,7 +114,7 @@ namespace Bonhomme02
 | 
			
		||||
            // 
 | 
			
		||||
            // 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.Name = "TV";
 | 
			
		||||
            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
 | 
			
		||||
            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
 | 
			
		||||
            Task continuationTask = continuation.ContinueWith((antecedent) => {
 | 
			
		||||
 
 | 
			
		||||
@@ -14,6 +14,7 @@ namespace Bonhomme02
 | 
			
		||||
        Bonhomme bonhomme;
 | 
			
		||||
        IntPtr? handle;
 | 
			
		||||
        Graphics gr;
 | 
			
		||||
        Graphics grBuf;
 | 
			
		||||
        BufferedGraphics buff;
 | 
			
		||||
        int ySol;
 | 
			
		||||
        int resolution;
 | 
			
		||||
@@ -43,7 +44,7 @@ namespace Bonhomme02
 | 
			
		||||
                Graphics gr = Graphics.FromHwnd(handle);
 | 
			
		||||
                if(handle == null){
 | 
			
		||||
                bonhomme.Cacher(gr);
 | 
			
		||||
                buff.Render();
 | 
			
		||||
                Rend();
 | 
			
		||||
                }
 | 
			
		||||
                else
 | 
			
		||||
                bonhomme.Cacher(handle);
 | 
			
		||||
@@ -53,7 +54,7 @@ namespace Bonhomme02
 | 
			
		||||
                bonhomme.Coordonnee = newCoo;
 | 
			
		||||
                if(handle == null){
 | 
			
		||||
                bonhomme.Afficher(gr);
 | 
			
		||||
                buff.Render();
 | 
			
		||||
                Rend();
 | 
			
		||||
                }
 | 
			
		||||
                else
 | 
			
		||||
                bonhomme.Afficher(handle);
 | 
			
		||||
@@ -63,6 +64,7 @@ namespace Bonhomme02
 | 
			
		||||
        {
 | 
			
		||||
            handle = null;
 | 
			
		||||
            step = 0;
 | 
			
		||||
            grBuf = Graphics.FromHwnd(bonhomme.conteneur.Handle);
 | 
			
		||||
            this.gr = buff.Graphics;
 | 
			
		||||
            this.buff = buff;
 | 
			
		||||
            this.bonhomme = bonhomme;
 | 
			
		||||
@@ -79,13 +81,13 @@ namespace Bonhomme02
 | 
			
		||||
            if(bonhomme.jambe1.Bas.CSG.Y != ySol) // On positionne le bonhomme sur le sol
 | 
			
		||||
            {
 | 
			
		||||
                bonhomme.Cacher(gr);
 | 
			
		||||
                buff.Render();
 | 
			
		||||
                Rend();
 | 
			
		||||
                Point newCoo;
 | 
			
		||||
                int longeurTTBonhome = bonhomme.jambe1.Bas.CSG.Y - bonhomme.CIG.Y ;// de pied.csg à bonhome.cig
 | 
			
		||||
                newCoo = new Point(bonhomme.CIG.X, ySol - longeurTTBonhome);
 | 
			
		||||
                bonhomme.Coordonnee = newCoo;
 | 
			
		||||
                bonhomme.Afficher(gr);
 | 
			
		||||
                buff.Render();
 | 
			
		||||
                Rend();
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        public void Avancer()
 | 
			
		||||
@@ -115,7 +117,7 @@ namespace Bonhomme02
 | 
			
		||||
                            bonhomme.Afficher(handle.Value);
 | 
			
		||||
                            dejaDeplacer += resolution;
 | 
			
		||||
                            if (handle == null)
 | 
			
		||||
                                buff.Render();
 | 
			
		||||
                                Rend();
 | 
			
		||||
                            Thread.Sleep(vitesse);
 | 
			
		||||
                        }
 | 
			
		||||
 | 
			
		||||
@@ -139,7 +141,7 @@ namespace Bonhomme02
 | 
			
		||||
                            bonhomme.Afficher(handle.Value);
 | 
			
		||||
                            dejaDeplacer += resolution;
 | 
			
		||||
                            if (handle == null)
 | 
			
		||||
                                buff.Render();
 | 
			
		||||
                                Rend();
 | 
			
		||||
                            Thread.Sleep(vitesse);
 | 
			
		||||
                        }
 | 
			
		||||
                        CollerAuSol(ref bonhomme.jambe2); //Voir issues #24
 | 
			
		||||
@@ -162,7 +164,7 @@ namespace Bonhomme02
 | 
			
		||||
                            bonhomme.Afficher(handle.Value);
 | 
			
		||||
                            dejaDeplacer += resolution;
 | 
			
		||||
                            if (handle == null)
 | 
			
		||||
                                buff.Render();
 | 
			
		||||
                                Rend();
 | 
			
		||||
                            Thread.Sleep(vitesse);
 | 
			
		||||
                            if (neww != bonhomme.jambe1.Bas.CSG.Y)
 | 
			
		||||
                            {
 | 
			
		||||
@@ -211,7 +213,7 @@ namespace Bonhomme02
 | 
			
		||||
                            bonhomme.Afficher(handle.Value);
 | 
			
		||||
                            dejaDeplacer += resolution;
 | 
			
		||||
                            if (handle == null)
 | 
			
		||||
                                buff.Render();
 | 
			
		||||
                                Rend();
 | 
			
		||||
                            Thread.Sleep(vitesse);
 | 
			
		||||
                        }
 | 
			
		||||
                        break;
 | 
			
		||||
@@ -233,7 +235,7 @@ namespace Bonhomme02
 | 
			
		||||
                            bonhomme.Afficher(handle.Value);
 | 
			
		||||
                            dejaDeplacer += resolution;
 | 
			
		||||
                            if (handle == null)
 | 
			
		||||
                                buff.Render();
 | 
			
		||||
                                Rend();
 | 
			
		||||
                            Thread.Sleep(vitesse);
 | 
			
		||||
                        }
 | 
			
		||||
                        if(handle == null){
 | 
			
		||||
@@ -251,7 +253,7 @@ namespace Bonhomme02
 | 
			
		||||
                        bonhomme.Afficher(handle.Value);
 | 
			
		||||
 | 
			
		||||
                        if (handle == null)
 | 
			
		||||
                            buff.Render();
 | 
			
		||||
                            Rend();
 | 
			
		||||
                        step +=3; // retour step 3
 | 
			
		||||
                        break;
 | 
			
		||||
                }
 | 
			
		||||
@@ -295,7 +297,7 @@ namespace Bonhomme02
 | 
			
		||||
                bonhomme.Afficher(handle.Value);
 | 
			
		||||
 | 
			
		||||
                if (handle == null)
 | 
			
		||||
                    buff.Render();
 | 
			
		||||
                    Rend();
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        public void Saut(ref PictureBox osbtacle, int vitesse)
 | 
			
		||||
@@ -327,7 +329,7 @@ namespace Bonhomme02
 | 
			
		||||
                else
 | 
			
		||||
                bonhomme.Afficher(handle.Value);
 | 
			
		||||
                if (handle == null)
 | 
			
		||||
                    buff.Render();
 | 
			
		||||
                    Rend();
 | 
			
		||||
                Thread.Sleep(vitesse);
 | 
			
		||||
            }
 | 
			
		||||
            while (bonhomme.jambe1.Bas.CSG.Y < ySol)//descendre
 | 
			
		||||
@@ -355,11 +357,21 @@ namespace Bonhomme02
 | 
			
		||||
                bonhomme.Afficher(handle.Value);
 | 
			
		||||
 | 
			
		||||
                if (handle == null)
 | 
			
		||||
                    buff.Render();
 | 
			
		||||
                    Rend();
 | 
			
		||||
                Thread.Sleep(vitesse);
 | 
			
		||||
            }
 | 
			
		||||
            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