public Game1() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; platforms = new List <Platform>(); spider = new Spider(this, random); bat = new Bat(this, random); }
/// <summary> /// checks wheter the player has passed the bat /// </summary> /// <param name="spider">Whether the player has passed the bat</param> /// <returns></returns> public bool isAboveBat(Bat bat) { if (bat.Bounds.Y > Bounds.Y + 470) { return(true); } else { return(false); } }
/// <summary> /// Checks if the player has collided with the bat /// </summary> /// <param name="spider">Whether the player has collided with the bat</param> /// <returns></returns> public bool collidesWithBat(Bat bat) { if ((bat.Bounds.X < Bounds.X + FRAME_WIDTH) && (Bounds.X < (bat.Bounds.X + bat.Bounds.Width)) && (bat.Bounds.Y < Bounds.Y + FRAME_HEIGHT) && (Bounds.Y < bat.Bounds.Y + bat.Bounds.Height)) { return(true); } else { return(false); } }