public Entity MakePlayer() { Vector2 offset = new Vector2(123, 45); string shotSound = "Shot"; Sprite s = new Sprite(new Vector2(ScreenHelper.TitleSafeArea.X, ScreenHelper.Viewport.Height / 2 - playerPistol.Height / 2), playerPistol, AnimationType.None); Entity e = new Hunter(ControllingIndex, playerBarFront, playerBarBack, health, "Damage", air, s, collisionDamage, speed, arrowTexture, shotSound, offset, bulletHits, bulletDamage, bulletSpeed, shotTime); e.OnDeath += new Action1(SpawnBlood); return(e); }
/// <summary> /// This is called when the game should draw itself. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.CornflowerBlue); // TODO: Add your drawing code here spriteBatch.Begin(); spriteBatch.Draw(backdrop, ScreenHelper.Viewport.Bounds, Color.White); manager.Draw(spriteBatch); spriteBatch.DrawString(screenManager.Font, "$" + coins.ToString(), new Vector2(ScreenHelper.TitleSafeArea.Location.X, ScreenHelper.TitleSafeArea.Location.Y), Color.Green); if (InGame) { Vector2 size = screenManager.Font.MeasureString("High Score: " + highScore); size.Y = 0; Vector2 position = new Vector2(ScreenHelper.TitleSafeArea.Right, ScreenHelper.TitleSafeArea.Top) - size; spriteBatch.DrawString(screenManager.Font, "High score: " + highScore, position, Color.Yellow); position.X -= screenManager.Font.MeasureString("Score: " + score + " ").X; spriteBatch.DrawString(screenManager.Font, "Score: " + score + " ", position, Color.White); } Hunter h = manager.Get("Player") as Hunter; if (h != null) { h.DrawBars(spriteBatch); } spriteBatch.End(); base.Draw(gameTime); }
public Entity MakePlayer() { Vector2 offset = new Vector2(123, 45); string shotSound = "Shot"; Sprite s = new Sprite(new Vector2(ScreenHelper.TitleSafeArea.X, ScreenHelper.Viewport.Height / 2 - playerPistol.Height / 2), playerPistol, AnimationType.None); Entity e = new Hunter(ControllingIndex, playerBarFront, playerBarBack, health, "Damage", air, s, collisionDamage, speed, arrowTexture, shotSound, offset, bulletHits, bulletDamage, bulletSpeed, shotTime); e.OnDeath += new Action1(SpawnBlood); return e; }