public Player(Game1 game, IEnumerable <Sprite> frames) { this.game = game; this.frames = frames.ToArray(); this.animationState = PlayerAnimState.WalkingRight; }
static void Main() { using (var game = new Game1()) game.Run(); }
public Building(Game1 game, int tileSize, ContentManager content, GraphicsDevice graphicsDevice) { int randomWindowCount; this.game = game; this.content = content; this.graphicsDevice = graphicsDevice; this.tileSize = tileSize; tileSet.Add(new Tile(game, 0)); for (int i = 1; i < tileSize; i++) { Tuple <int, int> location; RedoWindowPicker(windowLocations); randomWindowCount = random.Next(1, 4); tileSet.Add(new Tile(game, tileSet[i - 1].bounds.Y - 1080)); if (i < tileSize - 2) { if (random.Next(1, 3) == 1) { switch (random.Next(1, 4)) { case 1: game.powerupList.Add(new LollipopPowerup(game, content, random.Next(520, 1200), (int)(random.Next(100, 900) - (tileSet[i - 1].bounds.Y - 1080)))); break; case 2: game.powerupList.Add(new BottlePowerup(game, content, random.Next(520, 1200), (int)(random.Next(100, 900) - (tileSet[i - 1].bounds.Y - 1080)))); break; case 3: game.powerupList.Add(new BeanPowerup(game, content, random.Next(520, 1200), (int)(random.Next(100, 900) - (tileSet[i - 1].bounds.Y - 1080)))); break; default: break; } } switch (randomWindowCount) { case 1: location = windowLocations[random.Next(1, windowLocations.Count)]; windowSet.Add(new Window(game, content, random, location.Item1, (int)(location.Item2 - (tileSet[i - 1].bounds.Y - 1080)))); break; case 2: for (int j = 0; j < 2; j++) { int random_location = random.Next(1, windowLocations.Count); location = windowLocations[random_location]; windowSet.Add(new Window(game, content, random, location.Item1, (int)(location.Item2 - (tileSet[i - 1].bounds.Y - 1080)))); windowLocations.RemoveAt(random_location); } break; case 3: for (int j = 0; j < 3; j++) { int random_location = random.Next(1, windowLocations.Count); location = windowLocations[random_location]; windowSet.Add(new Window(game, content, random, location.Item1, (int)(location.Item2 - (tileSet[i - 1].bounds.Y - 1080)))); windowLocations.RemoveAt(random_location); } break; case 4: for (int j = 0; j < 4; j++) { int random_location = random.Next(1, windowLocations.Count); location = windowLocations[random_location]; windowSet.Add(new Window(game, content, random, location.Item1, (int)(location.Item2 - (tileSet[i - 1].bounds.Y - 1080)))); windowLocations.RemoveAt(random_location); } break; default: break; } } } foreach (Window window in windowSet) { if (random.Next(1, 3) == 1) { trashList.Add(new Trash(game, content, (int)window.bounds.X, (int)window.bounds.Y)); } } LoadContent(); }