예제 #1
0
 public void Draw()
 {
     Globals.SpriteDrawer.Begin();
     Globals.Map.Draw();
     Entities.ForEach(b => b.Draw());
     Enemies.ForEach(b => b.DrawHealthbar());
     Allies.ForEach(b => b.DrawHealthbar());
     DamageTexts.ForEach(d => d.Draw());
     Globals.SpriteDrawer.End();
 }
예제 #2
0
 public void Update(GameTime gameTime)
 {
     Level.Update(gameTime);
     Globals.Camera.Update(gameTime);
     Beings.ForEach(b => b.Update(gameTime));
     Enemies = Enemies.Where(e => e.IsActive).ToList();
     Enemies.ForEach(e => e.GetAI().Run(gameTime));
     Allies = Allies.Where(e => e.IsActive).ToList();
     Allies.ForEach(e => e.GetAI().Run(gameTime));
     Missiles = Missiles.Where(m => m.IsActive).ToList();
     Missiles.ForEach(m => m.Update(gameTime));
     Items = Items.Where(i => i.IsActive).ToList();
     Items.ForEach(i => i.Update(gameTime));
     DamageTexts = DamageTexts.Where(d => d.IsActive).ToList();
     DamageTexts.ForEach(d => d.Update(gameTime));
     EnemyCreatorFactory.Update(gameTime);
 }