コード例 #1
0
        // constructor
        public Cell(int row, int col, byte number)
        {
            _row = row;
            _col = col;
            _number = number;

            _owner = EOwner.Empty;
            _isBingo = false;
        }
コード例 #2
0
ファイル: Enemy.cs プロジェクト: khrisparrales/SpaceInvaders
 public bool DealDamage(EOwner owner)
 {
     if (owner == EOwner.PLAYER) //jesli wroga dosiegla kula gracza, ma umrzec.
     {
         dead = true;
         return(true); //zwracamy prawde jako sygnal ze pocisk mozna usunac
     }
     else
     {
         return(false); //kula nie znika po trafieniu swojego
     }
 }
コード例 #3
0
 public bool DealDamage(EOwner owner)
 {
     if (owner == EOwner.ENEMY) //jesli gracza dosiegla wroga kula, ma umrzec.
     {
         dead = true;
         return(true); //zwracamy prawde jako sygnal ze pocisk mozna usunac
     }
     else
     {
         return(false);
         //raczej niepotrzebne, gracza nie trafi nigdy jego wlasna kula
         //glownie zeby kompilator poszedl plumkac sie gdzie indziej
     }
 }
コード例 #4
0
        public Bullet(float x, float y, EOwner owner, bool directionUp)
        {
            this.directionUp = directionUp; // domyslna wartosc
            this.owner       = owner;
            this.deleteThis  = false;
            this.speed       = 10.0f;
            this.SetSymbol('+');

            try
            {
                SetPosition(x, y);
            }
            catch (Exception ex)
            {
                deleteThis = true;
            }
        }