public void Draw(SpriteBatch spriteBatch, List<GameObject> all)
{
foreach (GameObject gameObject in all)
{
if (gameObject.Sprite != null && gameObject.Enabled)
{
Vector2 pos = gameObject.Position + gameObject.Sprite.Origin;
if (gameObject.Baby != null)
{
gameObject.Baby.Torso.Animation.Draw(spriteBatch, pos + gameObject.Baby.Torso.Origin, 0f, false);
}
if (gameObject.Sprite.BackgroundAnimation != null)
{
gameObject.Sprite.BackgroundAnimation.Draw(spriteBatch, gameObject.Position, 0f, gameObject.Sprite.Flipped);
}
if (gameObject.Sprite.Animation == null)
{
spriteBatch.Draw(gameObject.Sprite.Texture, pos, Color.White);
}
else
{
gameObject.Sprite.Animation.Draw(spriteBatch, pos, 0f,gameObject.Sprite.Flipped);
}
}
}
}