/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); background = new Background(0, 0, backgroundImagePath, Content, 1); ground = new Ground(SCREEN_WIDTH / 2, 0, groundImagePath, Content, 1); player = new PlayerBiplane(0, SCREEN_HEIGHT - ground.ScaledHeight, playerPlaneImagePath, Content, PLANE_SCALING); enemy = new EnemyBiplane(SCREEN_WIDTH, SCREEN_HEIGHT - ground.ScaledHeight, enemyPlaneImagePath, Content, PLANE_SCALING, gameMode); gameFont = Content.Load <SpriteFont>("fonts/GameFont"); TextDrawer = new TextDrawer(gameFont, spriteBatch); scoreManager = new ScoreManager(gameState); playerScoreTextPosition = new Vector2(0, 0); enemyScoreTextPosition = new Vector2((float)(SCREEN_WIDTH - SCREEN_WIDTH / 5.1), 0); endGameTextPosition = new Vector2(SCREEN_WIDTH / 2.6f, SCREEN_HEIGHT / 2 - SCREEN_HEIGHT / 4); // TODO: use this.Content to load your game content here Explosion.TextureList = new List <Texture2D>(new Texture2D[MainGame.NUMBER_OF_FRAMES_IN_EXPLOSION_ANIMATION]); for (int numberOfFrame = 0; numberOfFrame < NUMBER_OF_FRAMES_IN_EXPLOSION_ANIMATION; numberOfFrame++) { Explosion.TextureList[numberOfFrame] = Content.Load <Texture2D>($"{explosionAnimationPath}/explosion ({numberOfFrame + 1})"); } Smoke.TextureList = new List <Texture2D>(new Texture2D[MainGame.NUMBER_OF_FRAMES_IN_SMOKE_ANIMATION]); for (int numberOfFrame = 0; numberOfFrame < NUMBER_OF_FRAMES_IN_SMOKE_ANIMATION; numberOfFrame++) { Smoke.TextureList[numberOfFrame] = Content.Load <Texture2D>($"{smokeAnimationPath}/smoke ({numberOfFrame + 1})"); } Fire.TextureList = new List <Texture2D>(new Texture2D[MainGame.NUMBER_OF_FRAMES_IN_FIRE_ANIMATION]); for (int numberOfFrame = 0; numberOfFrame < NUMBER_OF_FRAMES_IN_FIRE_ANIMATION; numberOfFrame++) { Fire.TextureList[numberOfFrame] = Content.Load <Texture2D>($"{fireAnimationPath}/fire ({numberOfFrame + 1})"); } }
public void SpawnPlayerBiplane() { player = new PlayerBiplane(0, SCREEN_HEIGHT - ground.ScaledHeight, playerPlaneImagePath, Content, PLANE_SCALING); }