示例#1
0
 // Use this for initialization
 void Start()
 {
     itemAmount = gameObject.transform.GetChild(1).GetComponent <Text>();
     inventaire = GameObject.FindGameObjectWithTag("Inventaire").GetComponent <Inventaire>();
     itemImage  = gameObject.transform.GetChild(0).GetComponent <Image>();
     quickBar   = GameObject.FindGameObjectWithTag("QuickBar").GetComponent <QuickBar>();
 }
示例#2
0
    public void BuyItem(string name)
    {
        switch (name)
        {
        case "Shield":
            if (SaveData.ReadValueInt("Money") >= ShieldCost)
            {
                SaveData.AddValueInt("Money", -ShieldCost);
                SaveData.AddValueInt("Shield", 1);
                Inventaire.ShieldInv();
            }
            else
            {
                Debug.Log("[BuyItem] Tu n'as pas assez d'argent");
            }
            break;

        default:
            Debug.Log("[BuyItem] L'item demandé n'est pas enregistré");
            break;
        }

        MoneyShow.refreshMoney();
        RefreshShop();
    }
示例#3
0
        public ActionResult CreateInventaire(Inventaire reg)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    reg.Date = DateTime.Now;
                    //db.CreateInventaire(reg);
                    //db.SaveInventaire();
                    BissInventaireEntities.Instance.Inventaire.Add(reg);
                    BissInventaireEntities.Instance.SaveChanges();

                    return(RedirectToAction("GetInventaire"));
                }
                catch (Exception ex)
                {
                    LogThread.WriteLine(ex.Message);
                    return(RedirectToAction("Index", "Error"));
                }
            }
            else

            {
                return(View());
            }
        }
示例#4
0
    /* 1:Silex
     * 2: bois
     * 3:tissus
     * 4:P1
     * 5: amulette
     * 6:P2
     * 7:P3
     * 8:Fiole
     */



    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
    }
示例#5
0
        public async Task <IActionResult> Edit(int id, [Bind("InventaireId,StockMax,StockActuel,EmployeId,Visible")] Inventaire inventaire)
        {
            if (id != inventaire.InventaireId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(inventaire);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!InventaireExists(inventaire.InventaireId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EmployeId"] = new SelectList(_context.Employes, "EmployeId", "EmployeId", inventaire.EmployeId);
            return(View(inventaire));
        }
示例#6
0
        public void DansAutreInventaire(List <UI_Item> Uitems)
        {
            Inventaire inv  = EcranDeJeu.inventaires[0];
            UI_Item    anul = null;

            foreach (UI_Item init in Uitems)
            {
                Point p  = Memoire.ScreenToInv(init.Location.X, init.Location.Y);
                int   ix = (p.X - 7) / 18;
                int   iy = ((p.Y - 53) / 18) * -1;
                if (ix >= 0 && ix < inv.Longueur && iy >= 0 && iy < inv.Hauteur)
                {
                    int i = ix + (iy * inv.Longueur);
                    if (inv.Nom == "SacADos" && init.item != null && init.item.id() == "SacADos")
                    {
                        anul = init;
                        continue;
                    }
                    inv.SetItem(i, init.item);
                }
            }
            if (anul != null)
            {
                AnnulerMove(anul);
            }
        }
示例#7
0
    public void loadData()
    {
        string filePath      = Application.persistentDataPath + "/SavedData.json";
        string inventoryData = System.IO.File.ReadAllText(filePath);

        inventory = JsonUtility.FromJson <Inventaire>(inventoryData);
        Debug.Log("Chargement effectué");
    }
示例#8
0
        void ShowInventaire(object invent)
        {
            Inventaire inventaire = invent as Inventaire;

            inventaire.Dock = DockStyle.Fill;
            panel_container.Controls.Clear();
            panel_container.Controls.Add(inventaire);
            panel_container.Show();
        }
示例#9
0
 // Use this for initialization
 void Start()
 {
     itemAmount  = gameObject.transform.GetChild(1).GetComponent <Text>();
     objectC     = GameObject.FindGameObjectWithTag("Player").GetComponent <ObjectController>();
     quickBar    = GameObject.FindGameObjectWithTag("QuickBar").GetComponent <QuickBar>();
     inventaire  = quickBar.inventairePanel.GetComponent <Inventaire>();
     itemImage   = gameObject.transform.GetChild(0).GetComponent <Image>();
     itemEtoiles = gameObject.transform.GetChild(2).GetComponent <Image>();
 }
示例#10
0
 private void Awake()
 {
     if (instance != null)
     {
         Debug.LogWarning("Il y a plus d'une instance d'inventaire dans la scéne");
         return;
     }
     instance = this;
 }
    private float RotationX, RotationY = 0f; //Rotation de la caméra sur l'axe Y

    #endregion Fields

    #region Methods

    void Awake()
    {
        Cursor.visible = false;
        player = this.GetComponent<Player>();
        isAxisInUse = false;
        rigidBody = GetComponent<Rigidbody>();
        inventaire = GetComponent<Inventaire>();
        inventory = GetComponent<Inventory>();
        anim = GetComponent<Animator>();
    }
示例#12
0
    void Awake()
    {
        string currentScene = SceneManager.GetActiveScene().name;

        //Importer les scripts
        if (currentScene != "MainMenu")
        {
            ivt = MenuObjet.GetComponent <Inventaire>();
        }
    }
示例#13
0
        public StubDataManager()
        {
            Article article1 = new Article("AAAA", "brosse à dent");
            Article article2 = new Article("BBBB", "maillot");
            Article article3 = new Article("CCCC", "coca");

            Inventaire.Add(article1);
            Inventaire.Add(article2);
            Inventaire.Add(article3);
        }
    void Awake()
    {
        //Changer les tableau selon la scène
        sceneName = SceneManager.GetActiveScene().name;

        switch (sceneName)
        {
        case ("BureauOuvert"):
            desciptionStockage   = desciptionStockageBureauOuvert;
            findIndexDescription = findIndexDescriptionBureauOuvert;
            boolIndexDescription = boolIndexDescriptionBureauOuvert;
            break;

        case ("ExterieurCommissariat"):
            desciptionStockage   = desciptionStockageExterieurCommissariat;
            findIndexDescription = findIndexDescriptionExterieurCommissariat;
            boolIndexDescription = boolIndexDescriptionExterieurCommisariat;
            break;

        case ("HallPolice"):
            desciptionStockage   = desciptionStockageHallPolice;
            findIndexDescription = findIndexDescriptionHallPolice;
            boolIndexDescription = boolIndexDescriptionHallPolice;
            break;

        case ("SalleDePause"):
            desciptionStockage   = desciptionStockageSalleDePause;
            findIndexDescription = findIndexDescriptionSalleDePause;
            boolIndexDescription = boolIndexDescriptionSalleDePause;
            break;

        case ("Labo"):
            desciptionStockage   = desciptionStockageLabo;
            findIndexDescription = findIndexDescriptionLabo;
            boolIndexDescription = boolIndexDescriptionLabo;
            break;

        case ("BureauChef"):
            desciptionStockage   = desciptionStockageLabo;
            findIndexDescription = findIndexDescriptionLabo;
            boolIndexDescription = boolIndexDescriptionLabo;
            break;
        }


        //Importer le sprite renderer du curseur (pour changer forme et couleur)
        spriteRend = GetComponent <SpriteRenderer>();

        //Importer les scripts
        bdd  = BoiteDeDialogueManager.GetComponent <BoiteDeDialogue>();
        ivt  = InventaireMangers.GetComponent <Inventaire>();
        dico = DicoManager.GetComponent <Dictionnaire>();

        ObjectFound = GetComponent <AudioSource>();
    }
示例#15
0
 private void Awake()
 {
     Load();
     if (instance != null)
     {
         return;
     }
     instance  = this;
     tempMoney = moneyText.text;
     tempAmmo  = ammoText.text;
 }
示例#16
0
    public void AjouterInventaire(Inventaire inventaire)
    {
        ressourcesEnStock += inventaire.stockRessource;

        foreach (Consommable consommable in inventaire.consommables)
        {
            consommables.Add(consommable);
        }

        LimiterStock();
    }
示例#17
0
        public async Task <IActionResult> Create([Bind("InventaireId,StockMax,StockActuel,EmployeId,Visible")] Inventaire inventaire)
        {
            if (ModelState.IsValid)
            {
                _context.Add(inventaire);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EmployeId"] = new SelectList(_context.Employes, "EmployeId", "EmployeId", inventaire.EmployeId);
            return(View(inventaire));
        }
示例#18
0
        // detail de materiel selectionné
        private async void lvInventaire_ItemSelected(object sender, SelectedItemChangedEventArgs e)
        {
            if (lvInventaire.SelectedItem != null)
            {
                Inventaire inv = (lvInventaire.SelectedItem as Inventaire);
                // This will push the MaterielDetailPage onto the navigation stack
                // await Shell.Current.GoToAsync($"{nameof(MaterielDetailPage)}?id={inv.id}");

                MaterielDetailPage page = new MaterielDetailPage(inv.idMateriel);
                await Navigation.PushModalAsync(new NavigationPage(page));
            }
        }
示例#19
0
 public Stagiaire(string n) : base(n)
 {
     Taille      = 190;
     Poids       = 60;
     Charisme    = 1;
     Inteligence = 5;
     Defense     = 1;
     Hp          = 20;
     Vitesse     = 12;
     Force       = 16;
     Inventaire.Add(new Weapon("bloc-note", "Un super bloc-note pour prendre des notes!", 1, Weapon.WeaponType.bloc_note, 0, 0, 1));
     Type = PlayerType.Stagiaire;
 }
示例#20
0
 public LE_DEV(string n) : base(n)
 {
     Taille      = 120;
     Poids       = 140;
     Charisme    = -1;
     Inteligence = 8;
     Defense     = 3;
     Hp          = 35;
     Vitesse     = 2;
     Force       = 8;
     Inventaire.Add(new Weapon("clavier", "Un super clavier de G@merzz!", 2, Weapon.WeaponType.Clavier, 1, -1, 1));
     Type = PlayerType.LE_DEV;
 }
示例#21
0
    private void Start()
    {
        inventaire_script = GameObject.Find("InventoryCode").GetComponent <Inventaire>();
        render            = GetComponent <Image>();
        render.enabled    = false;
        Item.GetComponent <CastelDND>().enabled = false;
        //this.transform.parent.gameObject.SetActive(false);

        /*switch (gameObject.name) {
         *  case ():
         *      break;
         * }*/
    }
示例#22
0
 public RH(string n) : base(n)
 {
     Taille      = 180;
     Poids       = 65;
     Charisme    = 12;
     Inteligence = 7;
     Defense     = 1;
     Hp          = 25;
     Vitesse     = 5;
     Force       = 5;
     Inventaire.Add(new Weapon("lettre de licenciement", "Une petite lettre de licenciement! A utiliser sans modération.", 1, Weapon.WeaponType.Lettre_de_licenciement, 0, 2, 0));
     Type = PlayerType.RH;
 }
示例#23
0
    Taille panelTaille;                                // Permet d'avoir accès au script de déroulement de l'inventaire (animation)



    void Start()
    {
        inventaire_script = GameObject.Find("InventoryCode").GetComponent <Inventaire>(); // permet de trouver le Caneva Inventaire
        panelTaille       = GameObject.Find("Panneau").GetComponent <Taille>();           // Permet d'avoir accès au script de déroulement de l'inventaire
        CouteauSuisseImg  = GameObject.Find("CouteauSuisseInv").GetComponent <Image>();
        CisailleImg       = GameObject.Find("CisailleInv").GetComponent <Image>();
        FleurImg          = GameObject.Find("FleurInv").GetComponent <Image>();
        ChampignonImg     = GameObject.Find("ChampignonInv").GetComponent <Image>();
        ViandeBeteImg     = GameObject.Find("ViandeBeteInv").GetComponent <Image>();
        OeufBeteImg       = GameObject.Find("OeufBeteInv").GetComponent <Image>();
        FruitImg          = GameObject.Find("FruitInv").GetComponent <Image>();
        TeteVolgaImg      = GameObject.Find("TeteVolgaInv").GetComponent <Image>();
    }
示例#24
0
 public Comptable(string n) : base(n)
 {
     Taille      = 160;
     Poids       = 60;
     Charisme    = 3;
     Inteligence = 12;
     Defense     = 1;
     Hp          = 25;
     Vitesse     = 7;
     Force       = 7;
     Inventaire.Add(new Weapon("calculatrice", "Une super calculette!", 2, Weapon.WeaponType.calculatrice, 0, 0, 2));
     Type = PlayerType.Comptable;
 }
示例#25
0
 public Receptionniste(string n) : base(n)
 {
     Taille      = 150;
     Poids       = 70;
     Charisme    = 8;
     Inteligence = 3;
     Defense     = 1;
     Hp          = 25;
     Vitesse     = 11;
     Force       = 7;
     Inventaire.Add(new Weapon("téléphone", "Un super nokia3210!", 2, Weapon.WeaponType.Telephone, 1, 1, 0));
     Type = PlayerType.Receptionniste;
 }
示例#26
0
    public void RetirerInventaire(Inventaire inventaire)
    {
        ressourcesEnStock -= inventaire.stockRessource;

        foreach (Consommable consommable in inventaire.consommables)
        {
            if (consommables.Contains(consommable))
            {
                consommables.Remove(consommable);
            }
        }

        LimiterStock();
    }
示例#27
0
 // Start is called before the first frame update
 void Start()
 {
     bFond = bFond.GetComponent <Button>();
     bFond.onClick.AddListener(UpdateFond);
     Count      = 1;
     inventaire = inventaire.GetComponent <Inventaire>();
     button     = GetComponent <Button>();
     button.onClick.AddListener(TaskOnClick);
     Inc = Inc.GetComponent <Button>();
     Dec = Dec.GetComponent <Button>();
     Inc.onClick.AddListener(Increment);
     Dec.onClick.AddListener(Decrement);
     text.text = Count.ToString() + " / " + maxCount(recettecraft).ToString();
 }
示例#28
0
        public ActionResult AjaxCreate(int inventaireId)
        {
            ActionControllerResult result       = ActionControllerResult.FAILURE;
            Inventaire             unInventaire = this.inventaireService.GetInventaireById(inventaireId);

            if (unInventaire != null)
            {
                ValidationInventaire uneValidation = new ValidationInventaire();
                uneValidation.Inventaire = unInventaire;

                result = this.validationService.InsertValidation(uneValidation, User.Identity.GetUserId());
            }

            return(Json(result));
        }
示例#29
0
    public static void RefreshShop()
    {
        PriceShield = GameObject.FindWithTag("ShieldCost");
        PriceShield.GetComponent <Text>().text = "" + ShieldCost;
        Inventaire.Refresh();

        if (SaveData.ReadValueInt("Money") < ShieldCost)
        {
            PriceShield.GetComponent <Text>().color = Color.red;
        }
        else
        {
            PriceShield.GetComponent <Text>().color = Color.white;
        }
    }
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                string ErrorMessage = "Id Inventaire manquant";
                return(RedirectToAction("Index", new { MessageErreur = ErrorMessage }));
            }
            Inventaire unInventaire = this.inventaireService.GetInventaireById(id);

            if (unInventaire == null)
            {
                return(HttpNotFound());
            }
            return(View(unInventaire));
        }
示例#31
0
    public void ajoutMaterial()
    {
        Inventaire inventaire = GameObject.FindGameObjectWithTag("Inventaire").GetComponent <Inventaire>();

        emplacements = inventaire.emplacements;
        for (int i = 0; i < emplacements.Count - 1; i++)
        {
            if (emplacements[i].childCount == 0)
            {
                transform.position = emplacements[i].transform.position;
                transform.parent   = emplacements[i].transform;
                break;
            }
        }
    }
 protected virtual void Start()
 {
     champVision= new List<Transform>();
     contact=new List<Transform>();
     inventaire=new Inventaire();
     energie = 100;
     dialogue = gameObject.AddComponent <BoucheAgent>() as BoucheAgent;
     actionEnCours=false;
     idAgent = nbAgent++;
     faitDodo = false;
     centreCarte = GameObject.FindGameObjectWithTag ("Plans").transform;
     ville = GameObject.FindGameObjectWithTag("Ville").GetComponent<Ville>();
     murs = new List<Zone> ();
     foreach(GameObject m in GameObject.FindGameObjectsWithTag("Mur"))
     {
         murs.Add(m.GetComponent<Zone>());
     }
     StartCoroutine ("DiminutionEnergie");
 }
示例#33
0
文件: Game1.cs 项目: kylox/Templar
        protected override void LoadContent()
        {
            box = new textbox(new Rectangle(305, 200, 200, 50));

            ressource.loadcontent(Content);
            spriteBatch = new SpriteBatch(GraphicsDevice);

            creation = new creat_perso(this, spriteBatch, ressource.pixel,language);
            Components.Add(creation);
            creation.hide();

            gameover = new GameOverScreen(this, main, spriteBatch, ressource.ecriture, ressource.gameover, language);
            Components.Add(gameover);
            gameover.hide();

            edm = new EDM(this, spriteBatch, language);
            Components.Add(edm);
            edm.hide();

            pause = new menudepause(this, spriteBatch, ressource.ecriture, ressource.pixel, language);
            Components.Add(pause);
            pause.hide();

            menu = new menu(this, spriteBatch, Content.Load<SpriteFont>("SpriteFont"), ressource.templar, language);
            Components.Add(menu);
            menu.hide();

            //main = new gamemain(this, spriteBatch, activeScreen, new Donjon(@"Donjons\" + creation.donjon,false), false, "");
            //Components.Add(main);
            //main.hide();

            menudujeu = new menudujeu(this, spriteBatch, Content.Load<SpriteFont>("spriteFont"), ressource.th, language);
            Components.Add(menudujeu);
            menudujeu.hide();

            Option = new option(this, spriteBatch, Content.Load<SpriteFont>("spriteFont"), ressource.option, language);
            Components.Add(Option);
            Option.hide();

            inventaire = new Inventaire(this, spriteBatch, main, language);
            Components.Add(inventaire);
            inventaire.hide();

            activeScreen = menu;
            activeScreen.Show();
            MediaPlayer.Play(ressource.menu);
            MediaPlayer.IsRepeating = true;
            MediaPlayer.IsMuted = true;
            SoundEffect.MasterVolume = 0f;
        }
示例#34
0
文件: Game1.cs 项目: kylox/Templar
        protected override void Update(GameTime gameTime)
        {
            keyboard = Keyboard.GetState();
            mouse = Mouse.GetState();
            Data.Update();
            # region gameover
            if (activeScreen == gameover)
            {
                if (checkKey(Keys.Enter))
                {
                    if (gameover.SelectedIndex == 0)
                    {
                        main = new gamemain(this, spriteBatch, activeScreen, new Donjon(@"Donjons\" + creation.donjon, false), false, "", creation.donjon, language);
                        Components.Add(main);
                        main.hide();

                        ressource.selection.Play();
                        activeScreen.hide();
                        activeScreen = main;
                        activeScreen.Show();
                    }

                    if (gameover.SelectedIndex == 1)
                    {
                        ressource.selection.Play();
                        activeScreen.hide();
                        activeScreen = menu;
                        activeScreen.Show();
                        if (main.Is_Server)
                            main.Serveur.StopConnexion();
                        if (main.Is_Client)
                            main.Client.StopConnexion();
                    }

                    if (gameover.SelectedIndex == 2)
                    {
                        ressource.selection.Play();
                        if (main.Is_Server)
                            main.Serveur.StopConnexion();
                        if (main.Is_Client)
                            main.Client.StopConnexion();
                        this.Exit();
                    }
                }
            }
            #endregion
            #region menu_deuxJ
            if (activeScreen == menudeux)
            {
                if (Data.keyboardState.IsKeyDown(Keys.Escape))
                {
                    activeScreen.hide();
                    activeScreen = menu;
                    activeScreen.Show();
                }

                if (Data.keyboardState.IsKeyDown(Keys.Enter))
                {

                   /* main = new gamemain(this, spriteBatch, activeScreen, new Donjon(@"Donjons\" + creation.donjon, false), true, box.Saisie, creation.donjon, language);
                    main.IP = menudeux.box.Saisie;
                    main.Is_Client = menudeux.selec;
                    main.Is_Server = !menudeux.selec;*/
                    Is_server = !menudeux.selec;
                    Is_Client = menudeux.selec;
                    if (Is_server)
                    {
                        ressource.selection.Play();
                        activeScreen.hide();
                        activeScreen = creation;
                        activeScreen.Show();
                    }
                    if (Is_Client)
                    {
                        client = new Client(box.Saisie);

                        main = new gamemain(this, spriteBatch, activeScreen, null, true, box.Saisie, creation.donjon,language);
                        Donjon donj = client.ReceiveDungeon(main);
                        main.map = new switch_map(main.player, donj, donj.name);
                        main.map.x = (int)donj.map.X;
                        main.map.y = (int)donj.map.Y;
                        main.Is_Client = true;
                        main.Is_Server = false;
                        main.Client = client;
                        main.lZombie();
                        //main.AddLocalplayer();
                        main.AddHUD();
                        main.AddP2();
                        Components.Add(main);
                        main.hide();
                        ressource.selection.Play();
                        activeScreen.hide();
                        activeScreen = main;
                        activeScreen.Show();
                    }
                   /* main.StartReseauConnexion();
                    Components.Add(main);
                    main.hide();

                    ressource.selection.Play();
                    activeScreen.hide();
                    activeScreen = main;
                    activeScreen.Show();*/

                }
            }
            #endregion
            #region screen_menu_principal
            if (activeScreen == menu)
            {
                if (checkKey(Keys.Enter))
                {
                    if (menu.SelectedIndex == 0)
                    {
                        ressource.selection.Play();
                        menudujeu = new menudujeu(this, spriteBatch, Content.Load<SpriteFont>("spriteFont"), ressource.th, language);
                        Components.Add(menudujeu);
                        activeScreen.hide();
                        activeScreen = menudujeu;
                        activeScreen.Show();
                    }
                    else if (menu.SelectedIndex == 1)
                    {
                        ressource.selection.Play();
                        menudeux = new menudeux(this, spriteBatch, ref box);
                        Components.Add(menudeux);
                        creation.hide();
                        activeScreen.hide();
                        activeScreen = menudeux;
                        activeScreen.Show();
                    }

                    else if (menu.SelectedIndex == 2)
                    {
                        ressource.selection.Play();
                        edm = new EDM(this, spriteBatch, language);
                        Components.Add(edm);
                        activeScreen.hide();
                        activeScreen = edm;
                        activeScreen.Show();
                    }

                    else if (menu.SelectedIndex == 3)
                    {
                        ressource.selection.Play();
                        activeScreen.hide();
                        activeScreen = Option;
                        activeScreen.Show();
                    }

                    else if (menu.SelectedIndex == 4)
                    {
                        ressource.selection.Play();
                        this.Exit();
                    }
                }
            }

            #endregion
            #region creation
            else if (activeScreen == creation)
            {
               if (creation.change == true)
                {
                    if (Is_server)
                    {
                        main = new gamemain(this, spriteBatch, activeScreen, new Donjon(@"Donjons\" + @creation.donjon, false), false, "", creation.donjon,language);
                        main.Is_Server = true;
                        main.Is_Client = false;
                        main.StartReseauConnexion();
                        main.Serveur.SendDungeon(main.donj);
                        Components.Add(main);
                        main.hide();
                        creation.change = false;
                        ressource.selection.Play();
                        activeScreen.hide();
                        activeScreen = main;
                        activeScreen.Show();
                    }
                    else
                    {
                        main = new gamemain(this, spriteBatch, activeScreen, new Donjon(@"Donjons\" + @creation.donjon, false), false, "", creation.donjon, language);
                        Components.Add(main);
                        main.hide();
                        creation.change = false;
                        ressource.selection.Play();
                        activeScreen.hide();
                        activeScreen = main;
                        activeScreen.Show();
                    }
                }
            }
            #endregion
            #region menu_1_Joueur

            else if (activeScreen == menudujeu)
            {
                if (checkKey(Keys.Enter))
                {

                    if (menudujeu.SelectedIndex == 0)
                    {
                        ressource.selection.Play();
                        creation = new creat_perso(this, spriteBatch, ressource.pixel,language);
                        Components.Add(creation);
                        activeScreen.hide();
                        activeScreen = creation;
                        activeScreen.Show();
                    }

                    else
                        if (menudujeu.SelectedIndex == 1)
                        {
                            ressource.selection.Play();
                            activeScreen.hide();
                            activeScreen = main;
                            activeScreen.Show();
                        }

                        else
                            if (menudujeu.SelectedIndex == 2)
                            {
                                ressource.selection.Play();
                                activeScreen.hide();
                                activeScreen = menu;
                                activeScreen.Show();
                            }
                }
            }

            #endregion
            else if (activeScreen == victoire)
            {
                if(checkKey(Keys.Escape))
                {
                    activeScreen.hide();
                    activeScreen = menu;
                    activeScreen.Show();
                }
            }
            #region screen_action
            else if (activeScreen == main)
            {
                if (main.victoire == true)
                {
                    victoire = new victory(this, spriteBatch);
                    Components.Add(victoire);
                    activeScreen.hide();
                    activeScreen = victoire;
                    activeScreen.Show();
                }
                if (main.player.pv_player <= 0)
                {
                    gameover = new GameOverScreen(this, main, spriteBatch, ressource.ecriture, ressource.gameover, language);
                    Components.Add(gameover);
                    activeScreen.hide();
                    activeScreen = gameover;
                    activeScreen.Show();
                }
                if (checkKey(Keys.Escape))
                {
                    pause = new menudepause(this, spriteBatch, ressource.ecriture, ressource.pixel, language);
                    Components.Add(pause);
                    activeScreen.hide();
                    activeScreen = pause;
                    activeScreen.Show();
                }
            }
            #endregion
            #region inventaire
            else if (activeScreen == inventaire)
            {
                if (checkKey(Keys.Escape))
                {
                    activeScreen.hide();
                    activeScreen = main;
                    activeScreen.Show();
                }
            }
            #endregion
            #region screen_pause
            else if (activeScreen == pause)
            {
                if (checkKey(Keys.Enter))
                {
                    if (pause.SelectedIndex == 0)
                    {
                        activeScreen.hide();
                        inventaire = new Inventaire(this, spriteBatch, main, language);
                        Components.Add(inventaire);
                        activeScreen = inventaire;
                        activeScreen.Show();
                    }
                    else
                        if (pause.SelectedIndex == 1)
                        {
                            activeScreen.hide();
                            carac = new Caracteristique(this, spriteBatch, main.player, language);
                            Components.Add(carac);
                            activeScreen = carac;
                            activeScreen.Show();
                        }
                        else
                            if (pause.SelectedIndex == 2)
                            {
                                save = new Sauvegarde(main.map, main.player);
                                save.Save();
                                activeScreen.hide();
                                activeScreen = main;
                                activeScreen.Show();
                            }
                            else
                                if (pause.SelectedIndex == 3)
                                {
                                    load = new Chargement(main.player, main.map, main.player, main);
                                    load.load_game();
                                    activeScreen.hide();
                                    activeScreen = main;
                                    activeScreen.Show();
                                }
                                else
                                    if (pause.SelectedIndex == 4)
                                    {

                                        ressource.selection.Play();
                                        if (main.Is_Server)
                                            main.Serveur.StopConnexion();
                                        if (main.Is_Client)
                                            main.Client.StopConnexion();
                                        activeScreen.hide();
                                        activeScreen = menu;
                                        activeScreen.Show();
                                    }
                }
                if (checkKey(Keys.Escape))
                {
                    activeScreen.hide();
                    activeScreen = main;
                    activeScreen.Show();
                }
            }
            #endregion
            #region screen_option
            else if (activeScreen == Option)
            {
                if (keyboard.IsKeyUp(Keys.H) && keyboard.IsKeyUp(Keys.J) && keyboard.IsKeyUp(Keys.K) && keyboard.IsKeyUp(Keys.L))
                    click_down = false;
                if (keyboard.IsKeyDown(Keys.L) && SoundEffect.MasterVolume < 0.99f && click_down == false)
                    SoundEffect.MasterVolume += 0.01f;
                if (keyboard.IsKeyDown(Keys.K) && SoundEffect.MasterVolume > 0.01f && click_down == false)
                    SoundEffect.MasterVolume -= 0.01f;
                if (keyboard.IsKeyDown(Keys.J) && MediaPlayer.Volume < 0.99f && click_down == false)
                    MediaPlayer.Volume += 0.01f;
                if (keyboard.IsKeyDown(Keys.H) && MediaPlayer.Volume > 0.01f && click_down == false)
                    MediaPlayer.Volume -= 0.01f;
                if (checkKey(Keys.Enter))
                {
                    if (Option.SelectedIndex == 0)
                    {
                        ressource.selection.Play();
                        if (ecran == false)
                        {
                            graphics.ToggleFullScreen();
                            ecran = true;
                        }
                    }
                    if (Option.SelectedIndex == 1)
                    {
                        ressource.selection.Play();
                        if (ecran == true)
                        {
                            graphics.ToggleFullScreen();
                            ecran = false;
                        }
                    }
                    if (Option.SelectedIndex == 2)
                    {
                        ressource.selection.Play();
                        MediaPlayer.IsMuted = false;
                        SoundEffect.MasterVolume = 0.5f;
                    }
                    if (Option.SelectedIndex == 3)
                    {
                        ressource.selection.Play();
                        MediaPlayer.IsMuted = true;
                        SoundEffect.MasterVolume = 0;
                    }
                    if (Option.SelectedIndex == 4)
                    {
                        ressource.selection.Play();
                        language = !language;

                        Option = new option(this, spriteBatch, Content.Load<SpriteFont>("spriteFont"), ressource.option, language);
                        Components.Add(Option);
                        activeScreen.hide();
                        activeScreen = Option;
                        activeScreen.Show();
                    }
                    if (Option.SelectedIndex == 5)
                    {
                        ressource.selection.Play();

                        menu = new menu(this, spriteBatch, Content.Load<SpriteFont>("SpriteFont"), ressource.templar, language);
                        Components.Add(menu);
                        activeScreen.hide();
                        activeScreen = menu;
                        activeScreen.Show();
                    }
                }
            }
            #endregion
            #region screen_EDM

            if (activeScreen == edm)
            {
                if (checkKey(Keys.Escape))
                {
                    activeScreen.hide();
                    activeScreen = menu;
                    activeScreen.Show();
                }
            }
            #endregion
            #region caracteristique
            if (activeScreen == carac)
            {
                if (checkKey(Keys.Escape))
                {
                    activeScreen.hide();
                    activeScreen = main;
                    activeScreen.Show();
                }
            }
            #endregion
            base.Update(gameTime);
            oldKeyboard = keyboard;
            oldmouse = mouse;
        }