/** * Draw all the world elements **/ public void draw(SpriteBatch spritebatch) { foreach (Obstacle obs in obstacles) { obs.draw(spritebatch, obstacleTexture); } Vector2 adjustedObj = new Vector2(objective.X - objectiveTexture.Width / 2, objective.Y - objectiveTexture.Height / 2); spritebatch.Draw(objectiveTexture, adjustedObj, Color.White); pathFinder.debugDraw(spritebatch, obstacleTexture); }
/** * Draw all the world elements **/ public void draw(SpriteBatch spritebatch) { foreach (Obstacle obs in obstacles) { obs.draw(spritebatch, obstacleTexture); } foreach (Entity ent in entities) { ent.draw(spritebatch, entityTexture); //debugDraw for the stuck problem if (ent.checkIfStuck()) { ent.debugDrawDestination(spritebatch); } } Vector2 adjustedObj = new Vector2(objective.X - objectiveTexture.Width / 2, objective.Y - objectiveTexture.Height / 2); spritebatch.Draw(objectiveTexture, adjustedObj, Color.White); pathFinder.debugDraw(spritebatch, obstacleTexture); }