Beispiel #1
0
 public void Draw(SpriteBatch spriteBatch, Player player)
 {
     spriteBatch.Draw(_texture, _position, Color.White);
     var text = string.Format("Gold: {0}     Lives: {1}", player.Money, player.Lives);
     spriteBatch.DrawString(_font, text, _textPosition, Color.White);
 }
Beispiel #2
0
 /// <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);
     _waveController = new WaveController(_currentLevel, 24, Content.Load<Texture2D>("enemy"));
     var font = Content.Load<SpriteFont>("GUIFont");
     toolbar = new Toolbar(Content.Load<Texture2D>("toolbar"), font,
         new Vector2(0, Level.LevelHeight));
     player = new Player(_currentLevel, Content.Load<Texture2D>("tower"), Content.Load<Texture2D>("bullet"));
     arrowButton = new Button(Content.Load<Texture2D>("Buttons/1/normal"),
         Content.Load<Texture2D>("Buttons/1/hover"), Content.Load<Texture2D>("Buttons/1/pressed"),
         new Vector2(0, 0*Level.LevelHeight*32));
     arrowButton.Clicked+=new EventHandler(arrowButton_Clicked);
 }