Exemplo n.º 1
0
 private void Init()
 {
     alive = new Ship(Constants.ObjectSize, Constants.ObjectSize, String.Format("{0}{1}{2}", Constants.playerBasePath, Constants.SelectedShip, Constants.imageExtension));
     hit = new Ship(Constants.ObjectSize, Constants.ObjectSize, String.Format("{0}{1}{2}{3}", Constants.playerBasePath, Constants.SelectedShip, "Hit", Constants.imageExtension));
     selectedAlive = new Ship(Constants.ObjectSize, Constants.ObjectSize, String.Format("{0}{1}{2}{3}", Constants.playerBasePath, Constants.SelectedShip, "Selected", Constants.imageExtension));
     selectedHit = new Ship(Constants.ObjectSize, Constants.ObjectSize, String.Format("{0}{1}{2}{3}", Constants.playerBasePath, Constants.SelectedShip, "SelectedHit", Constants.imageExtension));
 }
Exemplo n.º 2
0
        public Player(double x, double y, int id)
            : base(x, y, Constants.ObjectSize, Constants.ObjectSize, false)
        {
            this.id = id;
           
            Init();

            currentShip = alive;
            
        }
Exemplo n.º 3
0
        public void CheckSelection()
        {
            if (selected)
            {

                if (GetObjectState() == Constants.ObjectState.Hit) currentShip = selectedHit;
                if (GetObjectState() == Constants.ObjectState.Alive) currentShip = selectedAlive; return;
                
            }
            if (!selected)
            {

                if (GetObjectState() == Constants.ObjectState.Hit) currentShip = hit; 
                if (GetObjectState() == Constants.ObjectState.Alive) currentShip = alive;return;
            }
        }