public virtual void Update() { if (!hero.dead) { hero.Update(offset); for (int i = 0; i < spawnPoints.Count; i++) { spawnPoints[i].Update(offset); } for (int i = 0; i < projectiles.Count; i++) { projectiles[i].Update(offset, mobs.ToList <Unit>()); if (projectiles[i].done) { projectiles.RemoveAt(i); i--; } } for (int i = 0; i < mobs.Count; i++) { mobs[i].Update(offset, hero); if (mobs[i].dead) { numKilled++; mobs.RemoveAt(i); i--; } } } else { if (Globals.keyboard.GetPress("Enter")) { resetWorld(null); } } ui.Update(this); }
public virtual void Update(Player ENEMY, Vector2 OFFSET) { if (hero != null) { hero.Update(OFFSET); } for (int i = 0; i < spawnPoints.Count; i++) { spawnPoints[i].Update(OFFSET); if (spawnPoints[i].dead) { spawnPoints.RemoveAt(i); i--; } } for (int i = 0; i < units.Count; i++) { units[i].Update(OFFSET, ENEMY); if (units[i].dead) { ChangeScore(1); units.RemoveAt(i); i--; } } for (int i = 0; i < buildings.Count; i++) { buildings[i].Update(OFFSET, ENEMY); if (buildings[i].dead) { ChangeScore(1); buildings.RemoveAt(i); i--; } } }
public virtual void Update() { hero.Update(); }