public void LoadAssets() { // Load textures foregroundTexture = Load <Texture2D>("Textures/Backgrounds/gameplay_screen"); cloud1Texture = Load <Texture2D>("Textures/Backgrounds/cloud1"); cloud2Texture = Load <Texture2D>("Textures/Backgrounds/cloud2"); mountainTexture = Load <Texture2D>("Textures/Backgrounds/mountain"); skyTexture = Load <Texture2D>("Textures/Backgrounds/sky"); defeatTexture = Load <Texture2D>("Textures/Backgrounds/defeat"); victoryTexture = Load <Texture2D>("Textures/Backgrounds/victory"); hudBackgroundTexture = Load <Texture2D>("Textures/HUD/hudBackground"); windArrowTexture = Load <Texture2D>("Textures/HUD/windArrow"); ammoTypeTexture = Load <Texture2D>("Textures/HUD/ammoType"); // Load font hudFont = Load <SpriteFont>("Fonts/HUDFont"); // Define initial cloud position cloud1Position = new Vector2(224 - cloud1Texture.Width, 32); cloud2Position = new Vector2(64, 90); // Define initial HUD positions playerHUDPosition = new Vector2(7, 7); computerHUDPosition = new Vector2(613, 7); windArrowPosition = new Vector2(345, 46); // Initialize human & AI players player = new Human(ScreenManager.Game, ScreenManager.SpriteBatch); player.Initialize(); player.Name = "Player"; computer = new AI(ScreenManager.Game, ScreenManager.SpriteBatch); computer.Initialize(); computer.Name = "Phone"; // Identify enemies player.Enemy = computer; computer.Enemy = player; base.LoadContent(); if (PhoneApplicationService.Current.StartupMode == StartupMode.Activate) { player.Score = int.Parse(PhoneApplicationService.Current.State["playerScore"].ToString()); computer.Score = int.Parse(PhoneApplicationService.Current.State["computerScore"].ToString()); isHumanTurn = !bool.Parse(PhoneApplicationService.Current.State["isHumanTurn"].ToString()); wind = Vector2.Zero; changeTurn = true; computer.Catapult.CurrentState = CatapultState.Reset; } else { // Start the game Start(); } }
public void LoadAssets() { // Load textures foregroundTexture = Load <Texture2D>("Textures/Backgrounds/gameplay_screen"); cloud1Texture = Load <Texture2D>("Textures/Backgrounds/cloud1"); cloud2Texture = Load <Texture2D>("Textures/Backgrounds/cloud2"); mountainTexture = Load <Texture2D>("Textures/Backgrounds/mountain"); skyTexture = Load <Texture2D>("Textures/Backgrounds/sky"); defeatTexture = Load <Texture2D>("Textures/Backgrounds/defeat"); victoryTexture = Load <Texture2D>("Textures/Backgrounds/victory"); hudBackgroundTexture = Load <Texture2D>("Textures/HUD/hudBackground"); windArrowTexture = Load <Texture2D>("Textures/HUD/windArrow"); ammoTypeNormalTexture = Load <Texture2D>("Textures/HUD/ammoTypeNormal"); ammoTypeSplitTexture = Load <Texture2D>("Textures/HUD/ammoTypeSplit"); blankTexture = Load <Texture2D>("Textures/Backgrounds/blank"); // Load font hudFont = Load <SpriteFont>("Fonts/HUDFont"); // Define initial cloud position cloud1Position = new Vector2(224 - cloud1Texture.Width, 32); cloud2Position = new Vector2(64, 90); // Define initial HUD positions playerOneHUDPosition = new Vector2(7, 7); playerTwoHUDPosition = new Vector2(613, 7); windArrowPosition = new Vector2(345, 46); Vector2 healthBarOffset = new Vector2(25, 82); playerOneHealthBarPosition = playerOneHUDPosition + healthBarOffset; playerTwoHealthBarPosition = playerTwoHUDPosition + healthBarOffset; healthBarFullSize = new Vector2(130, 20); // Initialize human & AI players playerOne = new Human(ScreenManager.Game, ScreenManager.SpriteBatch, PlayerSide.Left); playerOne.Initialize(); playerOne.Name = "Player" + (isTwoHumanPlayers ? " 1" : ""); if (isTwoHumanPlayers) { playerTwo = new Human(ScreenManager.Game, ScreenManager.SpriteBatch, PlayerSide.Right); playerTwo.Initialize(); playerTwo.Name = "Player 2"; } else { playerTwo = new AI(ScreenManager.Game, ScreenManager.SpriteBatch); playerTwo.Initialize(); playerTwo.Name = "Phone"; } // Identify enemies playerOne.Enemy = playerTwo; playerTwo.Enemy = playerOne; }
public void LoadAssets() { // Load textures foregroundTexture = Load <Texture2D>("Textures/Backgrounds/gameplay_screen"); cloud1Texture = Load <Texture2D>("Textures/Backgrounds/cloud1"); cloud2Texture = Load <Texture2D>("Textures/Backgrounds/cloud2"); mountainTexture = Load <Texture2D>("Textures/Backgrounds/mountain"); skyTexture = Load <Texture2D>("Textures/Backgrounds/sky"); defeatTexture = Load <Texture2D>("Textures/Backgrounds/defeat"); victoryTexture = Load <Texture2D>("Textures/Backgrounds/victory"); hudBackgroundTexture = Load <Texture2D>("Textures/HUD/hudBackground"); windArrowTexture = Load <Texture2D>("Textures/HUD/windArrow"); ammoTypeTexture = Load <Texture2D>("Textures/HUD/ammoType"); // Load font hudFont = Load <SpriteFont>("Fonts/HUDFont"); // Define initial cloud position cloud1Position = new Vector2(224 - cloud1Texture.Width, 0); cloud2Position = new Vector2(64, 90); // Define initial HUD positions playerHUDPosition = new Vector2(7, 7); computerHUDPosition = new Vector2(613, 7); windArrowPosition = new Vector2(345, 46); mountainPosition = new Vector2(400, 0); isCameraMoving = true; catapultCenterOffset = new Vector2(100, 0); // Initialize human & AI players player = new Human(ScreenManager.Game, ScreenManager.SpriteBatch); player.Initialize(); player.Name = "Player"; computer = new AI(ScreenManager.Game, ScreenManager.SpriteBatch); computer.Initialize(); computer.Name = "Phone"; // Identify enemies player.Enemy = computer; computer.Enemy = player; DrawOffset = new Vector2(-400, 0); DrawScale = 1f; CenterOnPosition(player.Catapult.Position + catapultCenterOffset); }
public void LoadAssets() { // Load textures foregroundTexture = Load <Texture2D>("Textures/Backgrounds/gameplay_screen"); cloud1Texture = Load <Texture2D>("Textures/Backgrounds/cloud1"); cloud2Texture = Load <Texture2D>("Textures/Backgrounds/cloud2"); mountainTexture = Load <Texture2D>("Textures/Backgrounds/mountain"); skyTexture = Load <Texture2D>("Textures/Backgrounds/sky"); defeatTexture = Load <Texture2D>("Textures/Backgrounds/defeat"); victoryTexture = Load <Texture2D>("Textures/Backgrounds/victory"); hudBackgroundTexture = Load <Texture2D>("Textures/HUD/hudBackground"); windArrowTexture = Load <Texture2D>("Textures/HUD/windArrow"); ammoTypeTexture = Load <Texture2D>("Textures/HUD/ammoType"); blankTexture = Load <Texture2D>("Textures/Backgrounds/blank"); // Load font hudFont = Load <SpriteFont>("Fonts/HUDFont"); // Define initial cloud position cloud1Position = new Vector2(224 - cloud1Texture.Width, 32); cloud2Position = new Vector2(64, 90); // Define initial HUD positions playerHUDPosition = new Vector2(7, 7); computerHUDPosition = new Vector2(613, 7); windArrowPosition = new Vector2(345, 46); Vector2 healthBarOffset = new Vector2(25, 82); playerHealthBarPosition = playerHUDPosition + healthBarOffset; computerHealthBarPosition = computerHUDPosition + healthBarOffset; healthBarFullSize = new Vector2(130, 20); // Initialize human & AI players player = new Human(ScreenManager.Game, ScreenManager.SpriteBatch); player.Initialize(); player.Name = "Player"; computer = new AI(ScreenManager.Game, ScreenManager.SpriteBatch); computer.Initialize(); computer.Name = "Phone"; // Identify enemies player.Enemy = computer; computer.Enemy = player; }
public void LoadAssets() { // Load textures foregroundTexture = Load <Texture2D>("Textures/Backgrounds/gameplay_screen"); cloud1Texture = Load <Texture2D>("Textures/Backgrounds/cloud1"); cloud2Texture = Load <Texture2D>("Textures/Backgrounds/cloud2"); mountainTexture = Load <Texture2D>("Textures/Backgrounds/mountain"); skyTexture = Load <Texture2D>("Textures/Backgrounds/sky"); defeatTexture = Load <Texture2D>("Textures/Backgrounds/defeat"); victoryTexture = Load <Texture2D>("Textures/Backgrounds/victory"); hudBackgroundTexture = Load <Texture2D>("Textures/HUD/hudBackground"); windArrowTexture = Load <Texture2D>("Textures/HUD/windArrow"); ammoTypeTexture = Load <Texture2D>("Textures/HUD/ammoType"); // Load font hudFont = Load <SpriteFont>("Fonts/HUDFont"); // Define initial cloud position cloud1Position = new Vector2(224 - cloud1Texture.Width, 32); cloud2Position = new Vector2(64, 90); // Define initial HUD positions playerOneHUDPosition = new Vector2(7, 7); playerTwoHUDPosition = new Vector2(613, 7); windArrowPosition = new Vector2(345, 46); // Initialize human & AI players playerOne = new Human(ScreenManager.Game, ScreenManager.SpriteBatch, PlayerSide.Left); playerOne.Initialize(); playerOne.Name = "Player 1"; playerTwo = new Human(ScreenManager.Game, ScreenManager.SpriteBatch, PlayerSide.Right); playerTwo.Initialize(); playerTwo.Name = "Player 2"; // Identify enemies playerOne.Enemy = playerTwo; playerTwo.Enemy = playerOne; }
public void LoadAssets() { // Load textures foregroundTexture = Load<Texture2D>("Textures/Backgrounds/gameplay_screen"); cloud1Texture = Load<Texture2D>("Textures/Backgrounds/cloud1"); cloud2Texture = Load<Texture2D>("Textures/Backgrounds/cloud2"); mountainTexture = Load<Texture2D>("Textures/Backgrounds/mountain"); skyTexture = Load<Texture2D>("Textures/Backgrounds/sky"); defeatTexture = Load<Texture2D>("Textures/Backgrounds/defeat"); victoryTexture = Load<Texture2D>("Textures/Backgrounds/victory"); hudBackgroundTexture = Load<Texture2D>("Textures/HUD/hudBackground"); windArrowTexture = Load<Texture2D>("Textures/HUD/windArrow"); ammoTypeTexture = Load<Texture2D>("Textures/HUD/ammoType"); // Load font hudFont = Load<SpriteFont>("Fonts/HUDFont"); // Define initial cloud position cloud1Position = new Vector2(224 - cloud1Texture.Width, 32); cloud2Position = new Vector2(64, 90); // Define initial HUD positions playerHUDPosition = new Vector2(7, 7); computerHUDPosition = new Vector2(613, 7); windArrowPosition = new Vector2(345, 46); // Initialize human & AI players player = new Human(ScreenManager.Game, ScreenManager.SpriteBatch); player.Initialize(); player.Name = "Player"; computer = new AI(ScreenManager.Game, ScreenManager.SpriteBatch); computer.Initialize(); computer.Name = "Phone"; // Identify enemies player.Enemy = computer; computer.Enemy = player; }
public void LoadAssets() { // Load textures foregroundTexture = Load<Texture2D>("Textures/Backgrounds/gameplay_screen"); cloud1Texture = Load<Texture2D>("Textures/Backgrounds/cloud1"); cloud2Texture = Load<Texture2D>("Textures/Backgrounds/cloud2"); mountainTexture = Load<Texture2D>("Textures/Backgrounds/mountain"); skyTexture = Load<Texture2D>("Textures/Backgrounds/sky"); defeatTexture = Load<Texture2D>("Textures/Backgrounds/defeat"); victoryTexture = Load<Texture2D>("Textures/Backgrounds/victory"); hudBackgroundTexture = Load<Texture2D>("Textures/HUD/hudBackground"); windArrowTexture = Load<Texture2D>("Textures/HUD/windArrow"); ammoTypeTexture = Load<Texture2D>("Textures/HUD/ammoType"); // Load font hudFont = Load<SpriteFont>("Fonts/HUDFont"); // Define initial cloud position cloud1Position = new Vector2(224 - cloud1Texture.Width, 32); cloud2Position = new Vector2(64, 90); // Define initial HUD positions playerHUDPosition = new Vector2(7, 7); computerHUDPosition = new Vector2(613, 7); windArrowPosition = new Vector2(345, 46); // Initialize human & AI players player = new Human(ScreenManager.Game, ScreenManager.SpriteBatch); player.Initialize(); player.Name = "Player"; computer = new AI(ScreenManager.Game, ScreenManager.SpriteBatch); computer.Initialize(); computer.Name = "Phone"; // Identify enemies player.Enemy = computer; computer.Enemy = player; base.LoadContent(); if (PhoneApplicationService.Current.StartupMode == StartupMode.Activate) { player.Score = int.Parse(PhoneApplicationService.Current.State["playerScore"].ToString()); computer.Score = int.Parse(PhoneApplicationService.Current.State["computerScore"].ToString()); isHumanTurn = !bool.Parse(PhoneApplicationService.Current.State["isHumanTurn"].ToString()); wind = Vector2.Zero; changeTurn = true; computer.Catapult.CurrentState = CatapultState.Reset; } else // Start the game Start(); }
public void LoadAssets () { NetworkSession = ScreenManager.Game.Services.GetService (typeof(NetworkSession)) as NetworkSession; IsNetworking = NetworkSession != null; // Load textures foregroundTexture = Load<Texture2D> ("Textures/Backgrounds/gameplay_screen"); cloud1Texture = Load<Texture2D> ("Textures/Backgrounds/cloud1"); cloud2Texture = Load<Texture2D> ("Textures/Backgrounds/cloud2"); mountainTexture = Load<Texture2D> ("Textures/Backgrounds/mountain"); skyTexture = Load<Texture2D> ("Textures/Backgrounds/sky"); defeatTexture = Load<Texture2D> ("Textures/Backgrounds/defeat"); victoryTexture = Load<Texture2D> ("Textures/Backgrounds/victory"); hudBackgroundTexture = Load<Texture2D> ("Textures/HUD/hudBackground"); windArrowTexture = Load<Texture2D> ("Textures/HUD/windArrow"); ammoTypeTexture = Load<Texture2D> ("Textures/HUD/ammoType"); // Load font hudFont = Load<SpriteFont> ("Fonts/HUDFont"); // Define initial cloud position cloud1Position = new Vector2 (224 - cloud1Texture.Width, 32); cloud2Position = new Vector2 (64, 90); // Define initial HUD positions playerOneHUDPosition = new Vector2 (7, 7); computerHUDPosition = new Vector2 (613, 7); windArrowPosition = new Vector2 (345, 46); // Initialize human & other players if (IsNetworking) { if (NetworkSession.RemoteGamers.Count > 0) { if (NetworkSession.IsHost) { playerOne = new Human (ScreenManager.Game, ScreenManager.SpriteBatch, PlayerSide.Left); playerOne.Initialize (); playerOne.Name = NetworkSession.LocalGamers [0].Gamertag + " (host)"; playerTwo = new Human (ScreenManager.Game, ScreenManager.SpriteBatch, PlayerSide.Right); playerTwo.Initialize (); playerTwo.Name = NetworkSession.RemoteGamers [0].Gamertag; } else { playerOne = new Human (ScreenManager.Game, ScreenManager.SpriteBatch, PlayerSide.Left); playerOne.Initialize (); playerOne.Name = NetworkSession.RemoteGamers [0].Gamertag + " (host)"; playerTwo = new Human (ScreenManager.Game, ScreenManager.SpriteBatch, PlayerSide.Right); playerTwo.Initialize (); playerTwo.Name = NetworkSession.LocalGamers [0].Gamertag; } } else { playerOne = new Human (ScreenManager.Game, ScreenManager.SpriteBatch, PlayerSide.Left); playerOne.Initialize (); playerOne.Name = NetworkSession.LocalGamers [0].Gamertag + " (host)"; playerTwo = new Human (ScreenManager.Game, ScreenManager.SpriteBatch, PlayerSide.Right); playerTwo.Initialize (); playerTwo.Name = "Player 2"; IsNetworking = false; NetworkSession.Dispose(); NetworkSession = null; } } else { playerOne = new Human (ScreenManager.Game, ScreenManager.SpriteBatch, PlayerSide.Left); playerOne.Initialize (); playerOne.Name = "Player 1"; playerTwo = new AI (ScreenManager.Game, ScreenManager.SpriteBatch); playerTwo.Initialize (); playerTwo.Name = "Player 2"; } // Identify enemies playerOne.Enemy = playerTwo; playerTwo.Enemy = playerOne; }
public void LoadAssets() { NetworkSession = ScreenManager.Game.Services.GetService(typeof(NetworkSession)) as NetworkSession; IsNetworking = NetworkSession != null; // Load textures foregroundTexture = Load <Texture2D> ("Textures/Backgrounds/gameplay_screen"); cloud1Texture = Load <Texture2D> ("Textures/Backgrounds/cloud1"); cloud2Texture = Load <Texture2D> ("Textures/Backgrounds/cloud2"); mountainTexture = Load <Texture2D> ("Textures/Backgrounds/mountain"); skyTexture = Load <Texture2D> ("Textures/Backgrounds/sky"); defeatTexture = Load <Texture2D> ("Textures/Backgrounds/defeat"); victoryTexture = Load <Texture2D> ("Textures/Backgrounds/victory"); hudBackgroundTexture = Load <Texture2D> ("Textures/HUD/hudBackground"); windArrowTexture = Load <Texture2D> ("Textures/HUD/windArrow"); ammoTypeTexture = Load <Texture2D> ("Textures/HUD/ammoType"); // Load font hudFont = Load <SpriteFont> ("Fonts/HUDFont"); // Define initial cloud position cloud1Position = new Vector2(224 - cloud1Texture.Width, 32); cloud2Position = new Vector2(64, 90); // Define initial HUD positions playerOneHUDPosition = new Vector2(7, 7); computerHUDPosition = new Vector2(613, 7); windArrowPosition = new Vector2(345, 46); // Initialize human & other players if (IsNetworking) { if (NetworkSession.RemoteGamers.Count > 0) { if (NetworkSession.IsHost) { playerOne = new Human(ScreenManager.Game, ScreenManager.SpriteBatch, PlayerSide.Left); playerOne.Initialize(); playerOne.Name = NetworkSession.LocalGamers [0].Gamertag + " (host)"; playerTwo = new Human(ScreenManager.Game, ScreenManager.SpriteBatch, PlayerSide.Right); playerTwo.Initialize(); playerTwo.Name = NetworkSession.RemoteGamers [0].Gamertag; } else { playerOne = new Human(ScreenManager.Game, ScreenManager.SpriteBatch, PlayerSide.Left); playerOne.Initialize(); playerOne.Name = NetworkSession.RemoteGamers [0].Gamertag + " (host)"; playerTwo = new Human(ScreenManager.Game, ScreenManager.SpriteBatch, PlayerSide.Right); playerTwo.Initialize(); playerTwo.Name = NetworkSession.LocalGamers [0].Gamertag; } } else { playerOne = new Human(ScreenManager.Game, ScreenManager.SpriteBatch, PlayerSide.Left); playerOne.Initialize(); playerOne.Name = NetworkSession.LocalGamers [0].Gamertag + " (host)"; playerTwo = new Human(ScreenManager.Game, ScreenManager.SpriteBatch, PlayerSide.Right); playerTwo.Initialize(); playerTwo.Name = "Player 2"; IsNetworking = false; NetworkSession.Dispose(); NetworkSession = null; } } else { playerOne = new Human(ScreenManager.Game, ScreenManager.SpriteBatch, PlayerSide.Left); playerOne.Initialize(); playerOne.Name = "Player 1"; playerTwo = new AI(ScreenManager.Game, ScreenManager.SpriteBatch); playerTwo.Initialize(); playerTwo.Name = "Player 2"; } // Identify enemies playerOne.Enemy = playerTwo; playerTwo.Enemy = playerOne; }