Example #1
0
 /// <summary>
 /// Default constructor
 /// </summary>
 /// <param name="x">X position on screen</param>
 /// <param name="y">Y position on screen</param>
 public DeathPoint(int x, int y)
     : base(x,y)
 {
     this.moveManager = new GameEngine.MoveManagers.WalkMoveManager();
 }
Example #2
0
        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="type">Type of monster to build</param>
        public Monster(MonsterType type, Map.Points.SpawnPoint spawnPoint)
        {
            // Assign type
            this.type = type;

            // Default values
            this.location = null;
            this.orientation = MonsterOrientation.NULL;
            this.step = 1;
            this.stepCounter = 1;

            // Basic location (spawn point)
            this.x = spawnPoint.X;
            this.y = spawnPoint.Y;

            // Type-dependant values
            String name;
            switch (type)
            {
                case MonsterType.CHELL:
                    this.strenghArmor = 20;
                    this.magicArmor = 5;
                    this.health = 100;
                    this.money = 20;
                    name = "Chell\\";
                    break;
                default:
                    this.strenghArmor = 0;
                    this.magicArmor = 0;
                    this.health = 1;
                    this.money = 0;
                    name = "";
                    break;
            }

            // Prepare visual control
            Dictionary<int,String> images = new Dictionary<int,string>();
            images.Add(11, Monster.baseFolder + name + "fl1.png");
            images.Add(12, Monster.baseFolder + name + "fl2.png");
            images.Add(13, Monster.baseFolder + name + "fl3.png");
            images.Add(14, Monster.baseFolder + name + "fl4.png");
            images.Add(21, Monster.baseFolder + name + "fr1.png");
            images.Add(22, Monster.baseFolder + name + "fr2.png");
            images.Add(23, Monster.baseFolder + name + "fr3.png");
            images.Add(24, Monster.baseFolder + name + "fr4.png");
            images.Add(31, Monster.baseFolder + name + "rl1.png");
            images.Add(32, Monster.baseFolder + name + "rl2.png");
            images.Add(33, Monster.baseFolder + name + "rl3.png");
            images.Add(34, Monster.baseFolder + name + "rl4.png");
            images.Add(41, Monster.baseFolder + name + "rr1.png");
            images.Add(42, Monster.baseFolder + name + "rr2.png");
            images.Add(43, Monster.baseFolder + name + "rr3.png");
            images.Add(44, Monster.baseFolder + name + "rr4.png");

            // Add visual control to UI
            Application.Current.Dispatcher.BeginInvoke((Action)delegate()
            {
                this.control = new View.Control.MonsterControl(images,27,68);
                this.control.move(x, y);
                this.control.changeImage(11);
                this.control.changeZIndex(5);
            });

            // Associate linked location
            this.location = spawnPoint.getExactLocation();
            this.moveManager = null;

            // Add to Tickable list
            GameEngine.GameManager.Instance.clockRegister(this);
        }