Exemple #1
0
 // Player death
 public void Die()
 {
     Alive = false;
     Ressurrection.Reset();
     Ressurrection.Start();
     RemoveGraphic(playerImage);
     AddGraphic(playerDieImage);
 }
 // Igrač umire
 public void Smrt()
 {
     JeZiv = false;
     Ozivljavanje.Reset();
     Ozivljavanje.Start();
     RemoveGraphic(SlikaIgraca);
     AddGraphic(SlikaUnistenogIgraca);
 }
Exemple #3
0
            public override IEnumerable GetEvaluationBlock()
            {
                var emCharacter  = character as EMCharacter;
                var weapon       = GetActiveWeapon();
                var attackTarget = emCharacter.BattleGrid.GetCharacterAtDirectionX(emCharacter.X + typedInfo._direction, emCharacter.Y, typedInfo._direction);

                if (!weapon.CanAttack(attackTarget))
                {
                    yield break;
                }

                if (attackTarget != null && attackTarget.TeamId != character.TeamId)
                {
                    weapon.Attack(attackTarget);
                    _attackTimer.Reset();

                    yield return(null);
                }
            }
Exemple #4
0
        //If UFO appears then it starts moving
        void CheckAppear()
        {
            Random rnd = new Random();

            if (AppearTimer.AtMax)
            {
                int direction = rnd.Next(0, 2);
                Visible    = true;
                Collidable = true;

                SetPosition(new Vector2(850 * direction - 50, 64));

                if (direction == 1)
                {
                    MovementDir = new Vector2(-2.0f, 0.0f);
                }
                else
                {
                    MovementDir = new Vector2(2.0f, 0.0f);
                }

                AppearTimer.Reset();
            }
        }
Exemple #5
0
        //ako se UFO pojavi, nek se pokrene
        void ProvjeraPojavljivanja()
        {
            Random rnd = new Random();

            if (IntervalPojavljivanja.AtMax)
            {
                int smjer = rnd.Next(0, 2);
                Visible    = true;
                Collidable = true;

                SetPosition(new Vector2(850 * smjer - 50, 64));

                if (smjer == 1)
                {
                    SmjerKretanja = new Vector2(-2.0f, 0.0f);
                }
                else
                {
                    SmjerKretanja = new Vector2(2.0f, 0.0f);
                }

                IntervalPojavljivanja.Reset();
            }
        }