Example #1
0
        /// <summary>
        /// Initializes new enemy.
        /// </summary>
        public Enemy()
        {
            BoxCollider collider = new BoxCollider(24, 24, Tags.Enemy);

            AddCollider(collider);
            ShootingCooldown.Start();
        }
        /// <summary>
        /// Inicijalizira neprijatelja
        /// </summary>
        public Neprijatelj()
        {
            BoxCollider collider = new BoxCollider(24, 24, Oznake.Neprijatelj);

            AddCollider(collider);
            IntervalPucanja.Start();
        }
Example #3
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);
 }
Example #5
0
 private void StartButton_Click(object sender, EventArgs e)
 {
     _isRunning = !_isRunning;
     SetUI(_isRunning);
     if (_isRunning)
     {
         AutoTimer.Start();
     }
     else
     {
         AutoTimer.Stop();
     }
 }
Example #6
0
        //postavi slučajni timer kad se UFO pojavljuje
        public UFO()
        {
            Random rnd = new Random();

            IntervalPojavljivanja = new AutoTimer(rnd.Next(1000, 2000));
            if (Neprijatelj.SePomaknuo)
            {
                IntervalPojavljivanja.Start();
            }

            BoxCollider collider = new BoxCollider(24, 24, Oznake.Ufo);

            Visible    = false;
            Collidable = false;

            Bodovi = rnd.Next(0, 3) * 50;

            AddCollider(collider);
            AddGraphic(IkonaNeprijatelja);
        }
Example #7
0
        //Sets a random timer when UFO appears
        public UFO()
        {
            Random    rnd   = new Random();
            MainScene scene = Program.game.GetScene <MainScene>();

            AppearTimer = new AutoTimer(rnd.Next(1000, 2000));
            if (Enemy.hasMoved)
            {
                AppearTimer.Start();
            }

            BoxCollider collider = new BoxCollider(24, 24, Tags.Ufo);

            Visible    = false;
            Collidable = false;

            Score = rnd.Next(0, 3) * 50;

            AddCollider(collider);
            AddGraphic(EnemyImage);
        }