Esempio n. 1
0
 public Game1()
 {
     graphics = new GraphicsDeviceManager(this);
     Content.RootDirectory = "Content";
     platforms             = new List <Platform>();
     spider = new Spider(this, random);
     bat    = new Bat(this, random);
 }
Esempio n. 2
0
 /// <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);
     }
 }
Esempio n. 3
0
 /// <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);
     }
 }