/// <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(); }
// 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); }
private void StartButton_Click(object sender, EventArgs e) { _isRunning = !_isRunning; SetUI(_isRunning); if (_isRunning) { AutoTimer.Start(); } else { AutoTimer.Stop(); } }
//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); }
//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); }