Ejemplo n.º 1
0
        public static Door GetWoodDoor()
        {
            Door lDoor = new Door("door_closed_bmp");
            lDoor.Durability = 20;

            return lDoor;
        }
Ejemplo n.º 2
0
        protected void LoadData()
        {
            player = new Player("player_bmp");
            player.AddSkill(new Skill(SkillNames.MEDICAL_SKILL));

            player.Inventory.Add(ItemFactory.CreateDefaultItem());
            player.Inventory.Add(ItemFactory.CreateDefaultItem());
            player.Inventory.Add(ItemFactory.CreateDefaultItem());

            player.Inventory.Add(ItemFactory.CreateBandage(player));
            player.Inventory.Add(ItemFactory.CreateBandage(player));

            Weapon sword2 = WeaponFactory.CreateSword();
            sword2.Name = "OTHER Sword";
            player.Inventory.Add(sword2);
            player.Inventory.Add(WeaponFactory.CreateSword());

            map = new Map(30, 30);
            map.AddObjectAt(player, 5, 5);
            Zombie lZack = new Zombie(player, map);
            map.AddObjectAt(lZack, 10, 10);

            Room lRoom = new Room(new Coord(8, 8), 5, 5, MapGenObject.Direction.SOUTH);
            lRoom.Construct(map);

            Door d = new Door("door_closed_bmp");
            d.Interaction = new UseDoorPAbility(d);
            map.GetBlockAt(5, 10).AddObject(d);

            ToggleSwitch lSwitch = new ToggleSwitch();
            lSwitch.ConnectedProp = d;
            lSwitch.OnGraphic = new Sprite("toggle_off");
            lSwitch.OffGraphic = new Sprite("toggle_on");
            map.AddObjectAt(lSwitch, 7, 7);

            camera = new Camera(player, Game.VISBLE_MAP_WIDTH, Game.VISBLE_MAP_HEIGHT, map);

            Item item = new Item("item_bmp");
            map.GetBlockAt(3, 3).AddObject(item);
        }