public void AffichageCase(int x, int y, SpriteBatch spriteBatch, char texture) { Case casee; casee = new Case(x, y, texture); if (casee.text == Case.Typetext.Eau) { spriteBatch.Draw(textureeau, casee.rectangle, Color.White); } else if (casee.text == Case.Typetext.Herbe) { spriteBatch.Draw(textureherbe, casee.rectangle, Color.White); } else if (casee.text == Case.Typetext.Murbois) { spriteBatch.Draw(texturemurbois, casee.rectangle, Color.White); } else if (casee.text == Case.Typetext.Terre) { spriteBatch.Draw(textureterre, casee.rectangle, Color.White); } else if (casee.text == Case.Typetext.Murpierre) { spriteBatch.Draw(texturemurpierre, casee.rectangle, Color.White); } else if (casee.text == Case.Typetext.Sable) { spriteBatch.Draw(texturesable, casee.rectangle, Color.White); } else if (casee.text == Case.Typetext.SableEau) { spriteBatch.Draw(texturesableeau, casee.rectangle, Color.White); } else if (casee.text == Case.Typetext.EauSable) { spriteBatch.Draw(textureeausable, casee.rectangle, Color.White); } else if (casee.text == Case.Typetext.Solbois) { spriteBatch.Draw(texturesolbois, casee.rectangle, Color.White); } else if (casee.text == Case.Typetext.Solpierre) { spriteBatch.Draw(texturesolpierre, casee.rectangle, Color.White); } else { } }
public void AffichageMap(SpriteBatch spriteBatch) { #region Lecture de la liste representant la carte for (int i = 0; i < map.Count; i++) { for (int j = 0; j < map[i].Count; j++) { #region Affichage des textures casee = new Case(j * 40 + xmap, i * 40 + ymap, map[i][j]); #region Filtrage de la texture if (casee.text == Case.Typetext.Eau) { spriteBatch.Draw(textureeau, casee.rectangle, Color.White); } if (casee.text == Case.Typetext.Herbe) { spriteBatch.Draw(textureherbe, casee.rectangle, Color.White); } if (casee.text == Case.Typetext.Murbois) { spriteBatch.Draw(texturemurbois, casee.rectangle, Color.White); } if (casee.text == Case.Typetext.Murpierre) { spriteBatch.Draw(texturemurpierre, casee.rectangle, Color.White); } if (casee.text == Case.Typetext.Sable) { spriteBatch.Draw(texturesable, casee.rectangle, Color.White); } if (casee.text == Case.Typetext.SableEau) { spriteBatch.Draw(texturesableeau, casee.rectangle, Color.White); } if (casee.text == Case.Typetext.EauSable) { spriteBatch.Draw(textureeausable, casee.rectangle, Color.White); } if (casee.text == Case.Typetext.Solbois) { spriteBatch.Draw(texturesolbois, casee.rectangle, Color.White); } if (casee.text == Case.Typetext.Solpierre) { spriteBatch.Draw(texturesolpierre, casee.rectangle, Color.White); } #endregion #endregion } } #endregion if (affichecol) { foreach (List<Rectangle> rectligne in collision) { foreach (Rectangle rect in rectligne) { spriteBatch.Draw(coltext, new Rectangle(rect.X + xmap, rect.Y + ymap, rect.Width, rect.Height), Color.White); } } } }
public void AffichageCase(int x, int y, SpriteBatch spriteBatch, char texture, Environnement environnement, Joueur joueur, Vector2 position) { Case casee; casee = new Case(x, y, texture); Color myColor = new Color(environnement.ambient, environnement.ambient, environnement.ambient); if (casee.text == Case.Typetext.Eau) { spriteBatch.Draw(textureeau, casee.rectangle, myColor); } else if (casee.text == Case.Typetext.Rune) { if (new Rectangle((int)position.X, (int)position.Y, 40, 40).Intersects(new Rectangle((int)joueur.centre_joueur.X, (int)joueur.centre_joueur.Y + 50, 1, 1))) spriteBatch.Draw(rune[1], casee.rectangle, myColor); else spriteBatch.Draw(rune[0], casee.rectangle, myColor); } else if (casee.text == Case.Typetext.Escalier) { spriteBatch.Draw(escalier, casee.rectangle, myColor); } else if (casee.text == Case.Typetext.Prison) { spriteBatch.Draw(sol_prison, casee.rectangle, myColor); } else if (casee.text == Case.Typetext.Roche_volcanique) { spriteBatch.Draw(roche_volcanique, casee.rectangle, myColor); } else if (casee.text == Case.Typetext.Lave) { spriteBatch.Draw(lave, casee.rectangle, myColor); } else if (casee.text == Case.Typetext.Herbe) { spriteBatch.Draw(textureherbe, casee.rectangle, myColor); } else if (casee.text == Case.Typetext.Murbois) { spriteBatch.Draw(texturemurbois, casee.rectangle, myColor); } else if (casee.text == Case.Typetext.Terre) { spriteBatch.Draw(textureterre, casee.rectangle, myColor); } else if (casee.text == Case.Typetext.Murpierre) { spriteBatch.Draw(texturemurpierre, casee.rectangle, myColor); } else if (casee.text == Case.Typetext.Sable) { spriteBatch.Draw(texturesable, casee.rectangle, myColor); } else if (casee.text == Case.Typetext.SableEau) { spriteBatch.Draw(texturesableeau, casee.rectangle, myColor); } else if (casee.text == Case.Typetext.EauSable) { spriteBatch.Draw(textureeausable, casee.rectangle, myColor); } else if (casee.text == Case.Typetext.Solbois) { spriteBatch.Draw(texturesolbois, casee.rectangle, myColor); } else if (casee.text == Case.Typetext.Solpierre) { spriteBatch.Draw(texturesolpierre, casee.rectangle, myColor); } else { } }