public Enemy(Game game, Vector2 initialPosition, float initialAngle, float zOrder, string imageAssetName, float speed, string text, Player player) : base(game, initialPosition, initialAngle, zOrder) { Text = text; this.player = player; this.speed = speed; objectTexture = game.Content.Load<Texture2D>(imageAssetName); IsActive = true; }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { spriteBatch = new SpriteBatch(GraphicsDevice); Services.AddService(typeof(SpriteBatch), spriteBatch); player = new Player(this, new Vector2(GraphicsDevice.PresentationParameters.BackBufferWidth / 2, GraphicsDevice.PresentationParameters.BackBufferHeight - 50), MathHelper.ToRadians(0f), 0.5f, "player"); enemyManager = new EnemyManager(this, player, wordList); player.EnemyManager = enemyManager; player.Y -= player.Height; base.Initialize(); }
public EnemyManager(Game game, Player player, List<string> wordList) : base(game) { randGenerator = new Random(); this.player = player; IsActive = true; InputManager = new EnemyInputManager(wordList, game); this.wordList = wordList; DifficultyBias = maxBias; nextCheckpointScore = checkpointInterval; }