public Dog(Game game, Texture2D texture, Vector2 position, int spriteWidth, int spriteHeigth) : base(game, texture, position, spriteWidth, spriteHeigth) { MoveHorizontal(game.GraphicsDevice.Viewport.Width / 2 - SpriteWidth / 2); CurrentState = DogState.WalkingRight; _bark = new AudioEffect(Game1._soundEffects["dogBark"]); }
public ThrowFrisbee(Game game, int difficulty) : base(game, difficulty) { Random random = new Random(); var targetItemPositions = new List<Vector2>(); targetItemPositions.Add(new Vector2(Center.X - 310, 530)); targetItemPositions.Add(new Vector2(Center.X - 300, 550)); Vector2 targetItemPosition = targetItemPositions[random.Next(0, targetItemPositions.Count)]; var itemPositions = new List<Vector2>(); //itemPositions.Add(new Vector2(Center.X + 100, 500)); //itemPositions.Add(new Vector2(Center.X + 140, 530)); //itemPositions.Add(new Vector2(Center.X + 220, 560)); //itemPositions.Add(new Vector2(Center.X + 280, 520)); itemPositions.Add(new Vector2(Center.X + 105, 475)); Vector2 itemPosition = itemPositions[random.Next(0, itemPositions.Count)]; Vector2 resultItemPosition = new Vector2(targetItemPosition.X + 10, targetItemPosition.Y); TargetItem = new DrawableGameElement(game, Game1._textures["ball_position"], targetItemPosition); Item = new MouseGameElement(game, Game1._textures["frisbee"], itemPosition); ResultItem = new DrawableGameElement(game, Game1._textures["frisbee"], resultItemPosition); TutorialSound = new AudioEffect(Game1._soundEffects["ThrowFrisbee_Intro"]); RewardSound = new AudioEffect(Game1._soundEffects["ThrowFrisbee_Reward"]); }
/// <summary> /// Initialize a new minigame called Feed The Dog /// </summary> public FeedTheDog(Game game, int difficulty) : base(game, difficulty) { Random random = new Random(); var targetItemPositions = new List<Vector2>(); targetItemPositions.Add(new Vector2(Center.X - 180, 540)); targetItemPositions.Add(new Vector2(Center.X - 240, 550)); targetItemPositions.Add(new Vector2(Center.X - 320, 500)); Vector2 targetItemPosition = targetItemPositions[random.Next(0, targetItemPositions.Count)]; var itemPositions = new List<Vector2>(); //itemPositions.Add(new Vector2(Center.X + 70, 525)); itemPositions.Add(new Vector2(Center.X + 100, 350)); // aanrechtblad //itemPositions.Add(new Vector2(Center.X + 80, 535)); Vector2 itemPosition = itemPositions[random.Next(0, itemPositions.Count)]; TargetItem = new DrawableGameElement(game, Game1._textures["food_empty"], targetItemPosition); Item = new MouseGameElement(game, Game1._textures["food"], itemPosition); ResultItem = new DrawableGameElement(game, Game1._textures["food_full"], targetItemPosition); TutorialSound = new AudioEffect(Game1._soundEffects["GiveFood_Intro"]); RewardSound = new AudioEffect(Game1._soundEffects["GiveFood_Reward"]); }
public GiveBoneToDog(Game game, int difficulty) : base(game, difficulty) { Random random = new Random(); var targetItemPositions = new List<Vector2>(); targetItemPositions.Add(new Vector2(Center.X - 180, 510)); targetItemPositions.Add(new Vector2(Center.X - 280, 550)); //targetItemPositions.Add(new Vector2(Center.X - 330, 480)); Vector2 targetItemPosition = targetItemPositions[random.Next(0, targetItemPositions.Count)]; var itemPositions = new List<Vector2>(); itemPositions.Add(new Vector2(Center.X + 70, 520)); itemPositions.Add(new Vector2(Center.X + 220, 370)); itemPositions.Add(new Vector2(Center.X + 240, 490)); itemPositions.Add(new Vector2(Center.X + 90, 470)); Vector2 itemPosition = itemPositions[random.Next(0, itemPositions.Count)]; Vector2 resultItemPosition = new Vector2(targetItemPosition.X, targetItemPosition.Y - 3); // This one needs to be 3 px lower TargetItem = new DrawableGameElement(game, Game1._textures["food_empty"], targetItemPosition); Item = new MouseGameElement(game, Game1._textures["bone"], itemPosition); ResultItem = new DrawableGameElement(game, Game1._textures["bone_full"], resultItemPosition); TutorialSound = new AudioEffect(Game1._soundEffects["GiveBone_Intro"]); RewardSound = new AudioEffect(Game1._soundEffects["GiveBone_Reward"]); }
public DifficultyScreen(Game game, SpriteFont _arial) : base(game) { DifficultyTutorial = new AudioEffect(Game1._soundEffects["DifficultySelect"]); DrawableGameElement _backgroundRoom = new DrawableGameElement(game, Game1._textures["background"], new Vector2(-Game1._textures["background"].Width / 2, 0)); GameElements.Add(_backgroundRoom); EasyModeButton = new MouseGameElement(game, Game1._textures["difficulty_one"], new Vector2(Center.X - (int)Game1._textures["difficulty_one"].Width * 2 + 50, 200)); NormalModeButton = new MouseGameElement(game, Game1._textures["difficulty_two"], new Vector2(Center.X - (int)Game1._textures["difficulty_two"].Width / 2, 200)); HardModeButton = new MouseGameElement(game, Game1._textures["difficulty_three"], new Vector2(Center.X + (int)Game1._textures["difficulty_three"].Width - 50, 200)); GameElements.Add(EasyModeButton); GameElements.Add(NormalModeButton); GameElements.Add(HardModeButton); }
// This should be a GameElement override and called automatically after the constructor public void Initialize() { //Create elements _house = new House(Game); _hud = new Hud(Game); _dog = new Dog(Game, Game1._textures["spritesheet"], new Vector2(-100, 320), 163, 213); //Add elements _backgrounds.Add(_house); _overlays.Add(_hud); GameElements.Add(_dog); _introSound = new AudioEffect(Game1._soundEffects["Intro"]); _pauseScreen = new PauseScreen(Game); InitializeKitchenMinigames(); InitializeLivingRoomMinigames(); }
public RepairFlower(Game game, int difficulty) : base(game, difficulty) { Random random = new Random(); var targetItemPositions = new List<Vector2>(); targetItemPositions.Add(new Vector2(Center.X - 280, 380)); targetItemPositions.Add(new Vector2(Center.X - 340, 390)); Vector2 targetItemPosition = targetItemPositions[random.Next(0, targetItemPositions.Count)]; var itemPositions = new List<Vector2>(); itemPositions.Add(new Vector2(Center.X + 70, 510)); itemPositions.Add(new Vector2(Center.X + 100, 550)); itemPositions.Add(new Vector2(Center.X + 10, 540)); Vector2 itemPosition = itemPositions[random.Next(0, itemPositions.Count)]; TargetItem = new DrawableGameElement(game, Game1._textures["vase_empty"], targetItemPosition); Item = new MouseGameElement(game, Game1._textures["flower"], itemPosition); ResultItem = new DrawableGameElement(game, Game1._textures["vase_full"], targetItemPosition); TutorialSound = new AudioEffect(Game1._soundEffects["RepairFlowers_Intro"]); RewardSound = new AudioEffect(Game1._soundEffects["RepairFlowers_Reward"]); }
public WashTheDog(Game game, int difficulty) : base(game, difficulty) { Random random = new Random(); var targetItemPositions = new List<Vector2>(); targetItemPositions.Add(new Vector2(Center.X - 260, 420)); targetItemPositions.Add(new Vector2(Center.X - 290, 420)); targetItemPositions.Add(new Vector2(Center.X - 320, 420)); Vector2 targetItemPosition = targetItemPositions[random.Next(0, targetItemPositions.Count)]; var itemPositions = new List<Vector2>(); itemPositions.Add(new Vector2(Center.X + 70, 460)); itemPositions.Add(new Vector2(Center.X + 100, 480)); Vector2 itemPosition = itemPositions[random.Next(0, itemPositions.Count)]; TargetItem = new DrawableGameElement(game, Game1._textures["water_empty"], targetItemPosition); Item = new MouseGameElement(game, Game1._textures["shampoo"], itemPosition); ResultItem = new DrawableGameElement(game, Game1._textures["water_full"], targetItemPosition); TutorialSound = new AudioEffect(Game1._soundEffects["WashDog_Intro"]); RewardSound = new AudioEffect(Game1._soundEffects["WashDog_Reward"]); }