public override void Draw(GameTime gameTime, SpriteBatch spriteBatch) { // draw the top and bottom pipes so it connects to this game object when added to the heirarchy TopPipe.Draw(gameTime, spriteBatch); BottomPipe.Draw(gameTime, spriteBatch); base.Draw(gameTime, spriteBatch); }
public Pipes() { LocalPosition = new Vector2(500, ExtendedGame.Random.Next(-380, -25)); TopPipe = new TopPipe(); BottomPipe = new BottomPipe(); Speed = -150; OffScreen = false; //Make this object the Parent of the top and bottom pipes so they can move together as a unit TopPipe.Parent = this; BottomPipe.Parent = this; }