public static void InitializeItem() { Player1Item = new PlayerItem(); Player2Item = new PlayerItem(); Player3Item = new PlayerItem(); Player4Item = new PlayerItem(); DestructibleWallItem = new WallItem { WallType = WallType.Destructible }; UndestructibleWallItem = new WallItem { WallType = WallType.Undestructible }; BombItem = new BombItem(); ExplodedBombItem = new BombItem(); GetSpriteForPlayer(Player1Item, 0); GetSpriteForPlayer(Player2Item, 1); GetSpriteForPlayer(Player3Item, 2); GetSpriteForPlayer(Player4Item, 3); GetSpriteForWall(DestructibleWallItem); GetSpriteForWall(UndestructibleWallItem); GetSpriteForBomb(BombItem); GetSpriteForExplodedBomb(ExplodedBombItem); }
private static void GetSpriteForExplodedBomb(BombItem bomb) { string imagePath = String.Format(@"{0}\{1}", GlobalImagePath, GlobalImageName); bomb.ImageInUse = ExtractBackground(new BitmapImage(new Uri(imagePath)), 154, 259, 78, 78); }
private static void GetSpriteForBomb(BombItem bomb) { string imagePath = String.Format(@"{0}\{1}", GlobalImagePath, GlobalImageName); bomb.ImageInUse = ExtractBackground(new BitmapImage(new Uri(imagePath)), 20, 258, 12, 14); }