Beispiel #1
0
        protected void LoadData()
        {
            player = new Player(new Vector2(0, 0), "player_bmp");
            player.Graphic.Texture = GraphicsDispenser.getTexture("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(80, 80);
            map.GetBlockAt(5, 5).AddObject(player);
            MapGenerator.map = map;
            MapGenerator.CreateWoodenBuilding(10, 10, 30, 30);

            Light l = new Light(80, Color.Blue);

            map.AddObjectAt(l, 21, 23);

            Door d = new Door("door_closed_bmp");

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

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

            Zombie z = EntityFactory.CreateZombie(player);

            z.ChangeStateTo(ZombieStateNames.SEARCH_STATE, player.Location);
            entities.Add(z);
            map.GetBlockAt(6, 6).AddObject(z);
            MapGenerator.PutZombiesEverywhere(100, player);

            Item item = new Item("item_bmp");

            map.GetBlockAt(3, 3).AddObject(item);

            MessageBus.Instance.AddMessage(new DominatingMessage(player, z, item));
        }
Beispiel #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);
        }