Exemplo n.º 1
0
 public bool destroy_asteroid()
 {
     if (has_collided)
     {
         return(false);
     }
     score_keeper.add(points);
     if (spawned_debris != null)
     {
         for (int space_rock = 0; space_rock < 2; ++space_rock)
         {
             PlanetariaGameObject game_object = PlanetariaGameObject.Instantiate(spawned_debris, planetaria_transform.position, planetaria_transform.direction);
             Debris debris = game_object.GetComponent <Debris>();
             debris.speed = this.speed;
             DebrisNoirs.live(game_object);
             // while asteroid revenge velocity (targetting satellite) is an interesting idea,
             // I don't think it's necessary (or would fully work as intended for that matter - it might be exploitable).
             // The game will probably be hard enough head/joystick controls
             // (and pros will still make mistakes eventually, even if its because of sleep deprivation)
         }
     }
     DebrisNoirs.die(this.gameObject);
     PlanetariaGameObject.Destroy(this.gameObject);
     return(true);
 }
Exemplo n.º 2
0
 public IEnumerator spawn_debris_subroutine()
 {
     while (true)
     {
         if (DebrisNoirs.empty())
         {
             int round_difficulty = Mathf.Min(Mathf.CeilToInt(debris_to_spawn / 20f), 5); // give the player 0-5 second break, depending on last round's difficulty
             for (int cooldown = round_difficulty; cooldown >= 1; cooldown -= 1)          // let the player refresh
             {
                 yield return(second_delay);                                              // give the player time to refresh
             }
             debris_to_spawn += 1;                                                        // spawn one more debris than last round
             for (int countdown = 3; countdown >= 1; countdown -= 1)                      // print countdown on user interface
             {
                 text.text = countdown.ToString();                                        // display countdown
                 yield return(second_delay);
             }
             DebrisNoirs.expand(debris_to_spawn);
             text.text = ""; // clear the screen
             round    += 1;  // enter next round
             spawn_debris();
         }
         yield return(second_delay);
     }
 }
Exemplo n.º 3
0
 private void respawn()
 {
     DebrisNoirs.heat_death();
     debris_spawner.spawn();
     stopwatch.start_clock();
     dead = false;
     internal_collider.enabled  = true;
     satellite_renderer.enabled = true;
     loading_disc.fillAmount    = 0;
     satellite_renderer.sprite  = satellite_sprite;
 }
Exemplo n.º 4
0
        private void spawn_debris()
        {
            Vector3 satellite_position = satellite.position;

            for (int debris = 0; debris < debris_to_spawn; debris += 1)
            {
                Vector3 random_position = UnityEngine.Random.onUnitSphere;
                if (Vector3.Dot(random_position, satellite_position) > 0)
                {
                    random_position *= -1;
                }
                DebrisNoirs.live(PlanetariaGameObject.Instantiate(large_debris, random_position));
            }
        }
Exemplo n.º 5
0
        private void spawn_debris()
        {
            Vector3 satellite_position = satellite.position;

            for (int debris = 0; debris < debris_to_spawn; debris += 1)
            {
                Vector3 random_position = UnityEngine.Random.onUnitSphere;
                if (Vector3.Dot(random_position, satellite_position) > 0)
                {
                    random_position *= -1;
                }
                Debris large_debris = DebrisNoirs.live();
                large_debris.planetaria_transform.position = random_position;
                large_debris.speed = 0.09f;
                large_debris.initialize();
            }
        }
Exemplo n.º 6
0
 public bool destroy_asteroid()
 {
     if (has_collided)
     {
         return(false);
     }
     ScoreKeeper.instance.add(points);
     if (left_debris != null)
     {
         DebrisNoirs.live(left_debris);
         left_debris.planetaria_transform.position  = this.planetaria_transform.position;
         left_debris.planetaria_transform.direction = this.planetaria_transform.direction;
         left_debris.speed = this.speed;
         left_debris.initialize();
         DebrisNoirs.live(right_debris);
         right_debris.planetaria_transform.position  = this.planetaria_transform.position;
         right_debris.planetaria_transform.direction = this.planetaria_transform.direction;
         right_debris.speed = this.speed;
         right_debris.initialize();
     }
     DebrisNoirs.die(this);
     return(true);
 }