コード例 #1
0
ファイル: ZombieState.cs プロジェクト: kjchiu/zomgame-2
 public ZombieState(Zombie aZombie, Player nPlayer, Map aMap)
 {
     zombie = aZombie;
     player = nPlayer;
     rand = new Random(zombie.ThisID);
     iMap = aMap;
 }
コード例 #2
0
ファイル: Camera.cs プロジェクト: kjchiu/zomgame-2
 public Camera(Creature focus, int width, int height, Map nMap)
 {
     this.focus = focus;
     this.width = width;
     this.height = height;
     this.map = nMap;
     origin = new Coord(width / 2, height / 2);
     visiblePositions = new bool[width, height];
 }
コード例 #3
0
ファイル: WanderState.cs プロジェクト: kjchiu/zomgame-2
 public WanderState(Zombie aZombie, Player nPlayer, Map aMap)
     : base(aZombie, nPlayer, aMap)
 {
     graphic = new Sprite("zombie_wander_bmp");
 }
コード例 #4
0
ファイル: Game.cs プロジェクト: kjchiu/zomgame-2
        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);
        }
コード例 #5
0
ファイル: Camera.cs プロジェクト: kjchiu/zomgame-2
 public Camera(int width, int height, Map nMap)
     : this(null, width, height, nMap)
 {
 }