Exemple #1
0
        //Stats //lvl,Hp,Exp,Mana,Gold
        //StatsofPower:STR,INT,AGI

        public Player(AbstractRoom spawnPoint, int x, int y)
        {
            RigidBody   = new RigidBodyRec(LocationX, LocationY, 30, 60);//size of player
            SpawnPoint  = spawnPoint;
            CurrentRoom = SpawnPoint;
            LocationX   = x;
            LocationY   = y;

            Speed = (decimal)5;

            ISMoving = false;
        }
 //Check on intersection
 public static bool Check(RigidBodyRec player, RigidBodyRec someRec)
 {
     if (someRec != null)
     {
         if (!((player.LocationX > someRec.LocationX + someRec.Width) |
               (player.LocationX + player.Width < someRec.LocationX) |
               (player.LocationY > someRec.LocationY + someRec.Height) |
               (player.LocationY + player.Height < someRec.LocationY)))
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     else
     {
         return(false);
     }
 }