public void Initialize(Animation animation, Vector2 position) { PlayerAnimation = animation; // Set the starting position of the player around the middle of the screen and to the back Position = position; // Set the player to be active Active = true; // Set the player health Health = 100; }
protected override void LoadContent() { Content.RootDirectory = "Content"; //Handle the button creation // Create a new SpriteBatch, which can be used to draw textures. //Vector2 playerPosition = new Vector2(GraphicsDevice.Viewport.TitleSafeArea.X, GraphicsDevice.Viewport.TitleSafeArea.Y + GraphicsDevice.Viewport.TitleSafeArea.Height / 2); Animation playerAnimation = new Animation(); Texture2D playerTexture = Content.Load<Texture2D>("Ryen4"); playerAnimation.Initialize(playerTexture, 0, 50, 50); Vector2 playerPosition = new Vector2(640, 360); //GUI BackButTex = Content.Load<Texture2D>("BackButton"); PlayButtonTexture = Content.Load<Texture2D>("PlayButton"); ExitButtonTexture = Content.Load<Texture2D>("ExitButton"); OptionButtonTexture = Content.Load<Texture2D>("OptionsButton"); ContButtTexture = Content.Load<Texture2D>("Continue"); DifficultyButtonTexture = Content.Load<Texture2D>("Difficulty"); MontageText = Content.Load<Texture2D>("Montage"); player.Initialize(playerAnimation, playerPosition); VictoryScreen = Content.Load<Texture2D>("Victory"); enemyTexture = Content.Load<Texture2D>("EnemyMoveDodge Test"); projectileTexture = Content.Load<Texture2D>("Bullet"); msTexture = Content.Load<Texture2D>("CrossHair1"); explosions = new List<Animation>(); explosionTexture = Content.Load<Texture2D>("EnemyKill"); font = Content.Load<SpriteFont>("gameFont"); spriteBatch = new SpriteBatch(GraphicsDevice); Revolver = Content.Load<SoundEffect>("Colt"); Winchester = Content.Load<SoundEffect>("Winchester"); ReloadSound = Content.Load<SoundEffect>("Reload"); GameMusic = Content.Load<Song>("BeforeDawn"); Start = Content.Load<SoundEffect>("Start2"); toastTexture = Content.Load<Texture2D>("ToastProjectile"); toastEnemyTexture = Content.Load<Texture2D>("ToasterEnemy"); EnemyCrosshairTexture = Content.Load<Texture2D>("EnemyCrosshair"); EnemyBulletTexture = Content.Load <Texture2D>("SniperBulletTexture"); sniperTexture = Content.Load<Texture2D>("Sniper"); powerUpTexture = Content.Load<Texture2D>("PowerUps"); TitleImage = Content.Load<Texture2D>("TitleScreen"); BG1 = Content.Load<Texture2D>("BackGround1"); S1 = Content.Load<Song>("Scene1"); BG2 = Content.Load<Texture2D>("BackGround2"); S2 = Content.Load<Song>("Scene2"); BG3 = Content.Load<Texture2D>("BackGround3"); S3 = Content.Load<Song>("Scene3"); BGMenu = Content.Load<Texture2D>("WesterTown"); S4 = Content.Load<Song>("Scene4"); //CutScenes CS1 = Content.Load<Texture2D>("BreadStall"); CS2 = Content.Load<Texture2D>("kidnap"); CS3 = Content.Load<Texture2D>("tied up"); CS4 = Content.Load<Texture2D>("factory"); Control = Content.Load<Texture2D>("Control Scheme"); bossToasterTexture = Content.Load<Texture2D>("BossToaster"); bossToasterProjectile = Content.Load<Texture2D>("BossProj"); pamBossProjectile = Content.Load<Texture2D>("PamProj"); pamBossTexture = Content.Load<Texture2D>("PamBoss"); //Montage Load Hit = Content.Load<SoundEffect>("HIT"); Wow = Content.Load<SoundEffect>("WOW"); NoScope = Content.Load<SoundEffect>("NOSCOPE"); Sad = Content.Load<SoundEffect>("2SAD"); Triple = Content.Load<SoundEffect>("TRIPLE"); Damnson = Content.Load<SoundEffect>("DAMNSON"); // Create the gun object RevolverLoaded = 6; RevolverAmmo = 60; WinLoaded = 15; WinAmmo = 120; // Initialize the animation with the correct animation information // TODO: use this.Content to load your game content here }