コード例 #1
0
 public void update(MouseState _mouseState, Vector2 _tileHover, MoteurPhysique _moteurPhysique, GameTime _gameTime)
 {
     if (_mouseState.RightButton == ButtonState.Pressed)// si on clique c'est qui faut bouger le personnage
     {
         SetNextPosPersonnage(_mouseState, _tileHover, _moteurPhysique, _gameTime);
     }
     BougerPersonnage(_path);
 }
コード例 #2
0
        public void Initialize(MoteurSysteme _moteurSysteme, MoteurPhysique _moteurPhysique, Color[] _colorMouseMap)
        {
            this._moteurSysteme = _moteurSysteme;
            this._moteurPhysique = _moteurPhysique;

            _personnage1 = new Personnage("Meta", 100, 90, 6, 3);
            _carte1 = new Carte(_moteurSysteme.CarteTableau1, _colorMouseMap, _moteurSysteme.CarteTableauWidth, _moteurSysteme.CarteTableauHeight, 64, 64, 32, 16);
            _carte2 = new Carte(_moteurSysteme.CarteTableau2, _colorMouseMap,_moteurSysteme.CarteTableauWidth, _moteurSysteme.CarteTableauHeight, 64, 64, 32, 16);
            _elementDecor = new ElementDecor(_moteurSysteme.ElementDecorTableau);
        }
コード例 #3
0
ファイル: Game1.cs プロジェクト: MetaCorp/ThePowerOfZonhya2
        // ============= Proivisoire ==============
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
            this.IsMouseVisible = true;

            _moteurPhysique = new MoteurPhysique();
            _moteurAudio = new MoteurAudio();
            _moteurGraphique = new MoteurGraphique();
            _moteurJeu = new MoteurJeu();
            _moteurReseau = new MoteurReseau();
            _moteurSysteme = new MoteurSysteme();
        }
コード例 #4
0
        // ============= Proivisoire ==============


        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
            this.IsMouseVisible   = true;

            _moteurPhysique  = new MoteurPhysique();
            _moteurAudio     = new MoteurAudio();
            _moteurGraphique = new MoteurGraphique();
            _moteurJeu       = new MoteurJeu();
            _moteurReseau    = new MoteurReseau();
            _moteurSysteme   = new MoteurSysteme();
        }
コード例 #5
0
        public void Initialize(MoteurSysteme _moteurSysteme, MoteurPhysique _moteurPhysique)
        {
            this._moteurSysteme  = _moteurSysteme;
            this._moteurPhysique = _moteurPhysique;

            _interfaceUtilisateur = new InterfaceUtilisateur(new String[4] {
                "Reprendre", "Reglage", "Sauvegarder", "Quitter"
            });                                                                                                                // chaque string correspond a un bouton

            _camera = new Vector2(50, -50);

            _personnage1  = new Personnage("Meta", 100, 90, 6, 3);
            _carte1       = new Carte(_moteurSysteme.CarteTableau1, _moteurSysteme.CarteTableauWidth, _moteurSysteme.CarteTableauHeight, _camera, 64, 64, 32, 16);
            _carte2       = new Carte(_moteurSysteme.CarteTableau2, _moteurSysteme.CarteTableauWidth, _moteurSysteme.CarteTableauHeight, _camera, 64, 64, 32, 16);
            _elementDecor = new ElementDecor(_moteurSysteme.ElementDecorTableau);
        }
コード例 #6
0
        public void SetNextPosPersonnage(MouseState _mouseState, Vector2 _tileHover, MoteurPhysique _moteurPhysique, GameTime _gameTime)
        {
            _isMouving = true;

            _finalPositionTile = _tileHover;

            if (_path.Count == 0)                                                   // si il n'y a pas de déplacement
            {
                _path = _moteurPhysique.GetPath(_positionTile, _finalPositionTile); // retourne toutes les positions en tile par les quelles le personnage va devoir passer
                _path.RemoveAt(0);                                                  // on enleve la premiere position car c'est celle de départ
            }


            /*Console.WriteLine("Path a effectuer : ");
             * foreach (Vector2 v in _path)
             *  Console.Write(v + ", ");
             * Console.WriteLine();*/
        }
コード例 #7
0
 public void update(MouseState _mouseState, Vector2 _tileHover, MoteurPhysique _moteurPhysique, GameTime _gameTime)
 {
     if (_mouseState.RightButton == ButtonState.Pressed)// si on clique c'est qui faut bouger le personnage
         SetNextPosPersonnage(_mouseState, _tileHover, _moteurPhysique, _gameTime);
     BougerPersonnage(_path);
 }
コード例 #8
0
        public void SetNextPosPersonnage(MouseState _mouseState, Vector2 _tileHover, MoteurPhysique _moteurPhysique, GameTime _gameTime)
        {
            _isMouving = true;

            _finalPositionTile = _tileHover;

            if (_path.Count == 0)// si il n'y a pas de déplacement
            {
                _path = _moteurPhysique.GetPath(_positionTile, _finalPositionTile);// retourne toutes les positions en tile par les quelles le personnage va devoir passer
                _path.RemoveAt(0); // on enleve la premiere position car c'est celle de départ
            }

            /*Console.WriteLine("Path a effectuer : ");
            foreach (Vector2 v in _path)
                Console.Write(v + ", ");
            Console.WriteLine();*/
        }
コード例 #9
0
        public void Initialize(MoteurSysteme _moteurSysteme, MoteurPhysique _moteurPhysique)
        {
            this._moteurSysteme = _moteurSysteme;
            this._moteurPhysique = _moteurPhysique;

            _interfaceUtilisateur = new InterfaceUtilisateur(new String[4] {"Reprendre", "Reglage", "Sauvegarder", "Quitter"});// chaque string correspond a un bouton

            _camera = new Vector2(50, -50);

            _personnage1 = new Personnage("Meta", 100, 90, 6, 3);
            _carte1 = new Carte(_moteurSysteme.CarteTableau1, _moteurSysteme.CarteTableauWidth, _moteurSysteme.CarteTableauHeight, _camera, 64, 64, 32, 16);
            _carte2 = new Carte(_moteurSysteme.CarteTableau2,_moteurSysteme.CarteTableauWidth, _moteurSysteme.CarteTableauHeight, _camera, 64, 64, 32, 16);
            _elementDecor = new ElementDecor(_moteurSysteme.ElementDecorTableau);
        }