Inheritance: Entity
Exemplo n.º 1
0
        public override void UseThis(Player player)
        {
            // "einsammeln"
            if (player == (Game as Game1)._player)
            {
                // Open chest
                player.GivePotion();
            }

            base.OnCollide(player);
        }
Exemplo n.º 2
0
 private DialogManager(Player player)
     : base(Game1.Instance)
 {
     this.DrawOrder = 500;
     _spriteBatch = Game1.Instance.SpriteBatch;
 }
Exemplo n.º 3
0
 public virtual void UseThis(Player player)
 {
 }
Exemplo n.º 4
0
        /// <summary>
        /// LoadContent wird einmal pro Spiel aufgerufen und ist der Platz, wo
        /// Ihr gesamter Content geladen wird.
        /// </summary>
        protected override void LoadContent()
        {
            // Erstellen Sie einen neuen SpriteBatch, der zum Zeichnen von Texturen verwendet werden kann.
            _spriteBatch = new SpriteBatch(GraphicsDevice);

            _tileSetTexture = Content.Load<Texture2D>(@"grass");
            _treeTexture = Content.Load<Texture2D>("tree");
            _deadTreeTexture = Content.Load<Texture2D>("deadtree");
            _gruselUteTexture = Content.Load<Texture2D>("wildboar");
            _blackHoleTexture = Content.Load<Texture2D>("blackhole");
            _potionTexture = Content.Load<Texture2D>("potion");
            _cestTexture = Content.Load<Texture2D>("Schatztruhe");

            _input = new InputManager(this);
            _interface = new Interface(this);

            _player = new Player(this);
            _parser = new XML_Parser(this);
            _dialogSystem = new DialogSystem(this);
            //_parser.SetFilename("Horst");
            //_parser.SaveText();
            _parser.SetFilename("0");

            //_parser.SetLevel();
            //_parser.SaveLevel();
            try
            {
                _parser.LoadLevel();
                _currentLevel = _parser.GetLevel();
            }
            catch (Exception e)
            {
                _currentLevel = new Level(this);
                int[,] layer0 = new int[,] {
                            {1,1,1,1,1,1,1,1},
                            {1,9,9,9,9,9,9,1},
                            {1,9,9,9,9,9,9,1},
                            {1,9,9,54,111,111,9,1},
                            {1,9,9,9,111,111,9,1},
                            {1,9,9,9,9,54,9,1},
                            {1,9,9,9,9,9,9,1},
                            {1,1,1,1,1,1,1,1}};
                int[,] layer1 = { { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 87 } };
                layer0[1, 5] = 65;
                _currentLevel.AddFloor(layer0);
                _currentLevel.AddCeiling(new int[0, 0]);
            }
            PlayerClasses.CollisionDetector.Setup(_currentLevel);

            this.Components.Add(_input);

            _currentLevel.LoadContent();

            _player.LoadContent(Content);

            // TODO: Verwenden Sie this.Content, um Ihren Spiel-Inhalt hier zu laden
        }