Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 /// <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();
 }
Exemplo n.º 3
0
 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;
 }