Exemple #1
0
 public Carte()
 {
     largeur = 0;
     hauteur = 0;
     //
     carte = new List<List<char>>();
     ligne = new List<char>();
     //
     collision = new List<List<Rectangle>>();
     collisionligne = new List<Rectangle>();
     //
     gestionTeleportation = new GestionTeleportation();
     //
     gestion_objet = new Gestion_Objet();
     //
     murs = new Mur();
     //
     gestion_ennemis = new Gestion_Ennemi();
 }
        public void Draw(SpriteBatch spriteBatch, Gestion_Objet gestion_objet)
        {
            spriteBatch.Draw(barre, position_barre, Color.White);

            for (int i = 0; i < barre_action.GetLength(0); i++)
            {
                if (quantite_objet[i] > 0)
                {
                    spriteBatch.Draw(gestion_objet.GetTexture(barre_action[i].type_de_l_objet), pos_objet[i], Color.White);
                    spriteBatch.DrawString(font, quantite_objet[i].ToString(), new Vector2(pos_objet[i].X, pos_objet[i].Y - 5), Color.Red);
                }

                if(curseur_rect.Intersects(pos_objet[i]) && quantite_objet[i] > 0)
                {
                    spriteBatch.DrawString(font2_small, barre_action[i].nom_, new Vector2(pos_objet[i].X - 15, pos_objet[i].Y - 25), Color.Red);
                }
            }
        }
Exemple #3
0
        public void Draw(SpriteBatch spriteBatch, Gestion_Objet gestion_objet)
        {
            if(inventaireOuvert)
            {
                spriteBatch.Draw(fondInventaire, posFondInventaire, Color.White); //dessine la barre

                spriteBatch.Draw(bouton_relache, pos_bouton1, Color.White); //bouton 1 trie
                spriteBatch.DrawString(font, "Trier", new Vector2(pos_bouton1.X + 12, pos_bouton1.Y + 12), Color.Black);

                for (int i = 0; i < inventaire.GetLength(0); i++)
                {
                    for (int j = 0; j < inventaire.GetLength(1); j++)
                    {
                        if (quantitesObjets[i, j] > 0)
                        {
                            spriteBatch.Draw(gestion_objet.GetTexture(inventaire[i, j].type_de_l_objet), posObjets[i, j], Color.White);
                            spriteBatch.DrawString(font, quantitesObjets[i, j].ToString(), new Vector2(posObjets[i, j].X, posObjets[i, j].Y), Color.Red);
                        }

                        if (posObjets[i, j].Intersects(curseur_rect) && quantitesObjets[i, j] > 0)
                        {
                            spriteBatch.DrawString(font, inventaire[i, j].nom_, new Vector2(posObjets[i, j].X - 15, posObjets[i, j].Y - 28), Color.Red);
                        }
                    }
                }

                if (select_trier)
                {
                    spriteBatch.Draw(bouton_enfonce, pos_bouton1, Color.White);
                    spriteBatch.DrawString(font, "Trier", new Vector2(pos_bouton1.X + 12, pos_bouton1.Y + 12), Color.Black);
                }

            }
        }