/// <summary> /// Initializes a new instance of the <see cref="GameFrame"/> class. /// </summary> public GameFrame() { mainTexture = Program.INSTANCE.loadTexture("Border"); ecoUpgrade = Program.INSTANCE.Content.Load<GifAnimation>("Molen-GIF"); oilUpgrade = Program.INSTANCE.loadTexture("olie generator"); boerderijTexture = Program.INSTANCE.loadTexture("boerderij0"); boerderijPositie = new Vector2(Width - boerderijTexture.Width / 2, Height - boerderijTexture.Height * 1.2f); raamAchtergrond = Program.INSTANCE.loadTexture("WindowBackground"); raamAchtergrondPositie = new Vector2(boerderijPositie.X + raamAchtergrond.Width / 2, boerderijPositie.Y + raamAchtergrond.Height / 2); hpBarTextureRood = Program.INSTANCE.loadTexture("HPBarRood"); hpBarTextureGroen = Program.INSTANCE.loadTexture("HPBarGroen"); hpBarPositie = new Vector2((Width - hpBarTextureGroen.Width) / 1.025f , hpBarTextureGroen.Height); rectangleHP = new Rectangle(0, 0, hpBarTextureGroen.Width, hpBarTextureGroen.Height); oilBarTextureEmpty = Program.INSTANCE.loadTexture("OilEmpty"); oilBarTextureFull = Program.INSTANCE.loadTexture("OilFull"); oilBarPositie = new Vector2((Width - oilBarTextureFull.Width) / 1.025f, oilBarTextureFull.Height *2.5f); rectangleOil = new Rectangle(0, 0, oilBarTextureFull.Width, oilBarTextureFull.Height); gameFrameFont = Program.INSTANCE.Content.Load<SpriteFont>("ButtonFont"); //dit is een font geen image goldPositie = new Vector2((Width - hpBarTextureGroen.Width) + 5, hpBarTextureGroen.Height * 4); goldTextPositie = new Vector2(goldPositie.X - gameFrameFont.MeasureString("Gold:").X - 20, goldPositie.Y); goldTextUpgradePositie = new Vector2(Program.INSTANCE.IManager.upgradeAchtergrond.getX() + Program.INSTANCE.IManager.upgradeAchtergrond.mainTexture.Width, Program.INSTANCE.IManager.upgradeAchtergrond.getY() / 2); goldUpgradePositie = new Vector2(goldTextUpgradePositie.X + gameFrameFont.MeasureString("Gold:").X + 10, goldTextUpgradePositie.Y); hpBarTextPositie = new Vector2(hpBarPositie.X - gameFrameFont.MeasureString("HP:").X - 30, hpBarPositie.Y); oilBarTextPositie = new Vector2(oilBarPositie.X - gameFrameFont.MeasureString("Oil:").X - 20, oilBarPositie.Y); hpBarHpLeftPositie = new Vector2(hpBarPositie.X + hpBarTextureGroen.Width /2 - gameFrameFont.MeasureString(hpText).X / 2, hpBarPositie.Y); oilBaroilLevelPositie = new Vector2(oilBarPositie.X + oilBarTextureFull.Width / 2 - gameFrameFont.MeasureString(oilText).X / 2, oilBarPositie.Y); scorePositie = new Vector2(GameFrame.Width - Program.INSTANCE.IManager.font.MeasureString(scoreText).X * 1.1f, GameFrame.Height - Program.INSTANCE.IManager.font.MeasureString(scoreText).Y); UpgradePositie = new Vector2(GameFrame.Width / 3 - ecoUpgrade.GetTexture().Width / 2, GameFrame.Height / 3); }
public Candle(GifAnimation inImage, int locX, int inID) { image = inImage; location.X = locX; location.Y = 390; location.Width = 32; location.Height = 64; id = inID; }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> /// protected override void LoadContent() { gameFont = Content.Load<SpriteFont>(@"Fonts\GameFont"); x = new Candle(lgCandle, 0, 0); Camera.WorldRectangle = new Rectangle(0, 0, 2291, 480); Camera.ViewPortWidth = 1024; Camera.ViewPortHeight = 480; // Load the images background = Content.Load<Texture2D>(@"Images\Castlevaniast1"); background2 = Content.Load<Texture2D>(@"Images\stage2"); lgCandle = Content.Load<GifAnimation>(@"Images\LargeCandleGif"); // Add music to game. Song song = Content.Load<Song>(@"Music\music"); // Put the name of your song in instead of "song_title" MediaPlayer.Play(song); for (int i = 0; i < num_candles; i++) { candles.Add(new Candle(lgCandle, candleLocX[i], i+1)); } // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); // Medusa medusa = Content.Load<GifAnimation>(@"Images\MedusaR"); // Player trevor = Content.Load<Texture2D>(@"Images\trevorwalk"); // Weapon(s) dagger = Content.Load<Texture2D>(@"Images\daggerR"); // Skeleton skeleton = Content.Load <Texture2D>(@"Images\skeletons"); }