コード例 #1
0
 public IState Update()
 {
     if (progression == 0 || progression == 2)
     {
         timer -= Time.deltaTime;
     }
     if (progression == 0 && timer < 0)
     {
         progression++;
         dockingShip = GameObject.Instantiate(dockingShip, sd.transform.position + spawnerOffset + Vector3.up * -5, Quaternion.identity);
     }
     if (progression == 1 && DataDump.GetInt("PlayerDocked") > 0)
     {
         DialogueQueue.AddMessage("Well done!");
         DialogueQueue.AddMessage("This was an entry to Ludum Dare 39: Running out of Power, created by Zak Reynolds in 48 hours.");
         DialogueQueue.AddMessage("Thanks for playing!");
         progression++;
         timer = 15;
         var st = GameObject.FindWithTag("MainCamera").GetComponent <SmoothTrack>();
         st.target         = dockingShip.transform;
         st.smoothTime     = 0.5f;
         st.positionOffset = new Vector3(13, 5, -45);
     }
     if (progression == 2)
     {
         if (timer < 0)
         {
             // TODO: End
             progression++;
             DialogueQueue.AddMessage("END GAME\nESC to quit\nBACKSPACE to restart", 20);
             return(this);
         }
     }
     return(this);
 }
コード例 #2
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag.Equals("Player"))
     {
         DialogueQueue.AddMessage("Great hit!", 2);
         sentMessage = true;
         Doomed();
         DataDump.SetInt("TrainingTargetsHit", DataDump.GetInt("TrainingTargetsHit") + 1);
     }
 }
コード例 #3
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag.Equals("Player"))
     {
         DialogueQueue.AddMessage("Gah! Shoot them, don't ram them you maniac!", 2);
         sentMessage = true;
         Doomed();
     }
     if (other.tag.Equals("PlayerBullet"))
     {
         DialogueQueue.AddMessage("Boom! Way to go!", 2);
         sentMessage = true;
         Doomed();
         DataDump.SetInt("TrainingTargetsShot", DataDump.GetInt("TrainingTargetsShot") + 1);
     }
 }
コード例 #4
0
        public IState Update()
        {
            if (Input.GetKeyDown(KeyCode.Space))
            {
                // TODO: skip
            }
            if (progression == 0 && DataDump.GetInt("TrainingTargetsHit") >= ramCount)
            {
                DialogueQueue.AddMessage("Well done! Now try shooting them. Remember to move between the gun and engine using 'A' and 'D'.");
                progression++;
                var targets = GameObject.FindGameObjectsWithTag("TrainingTarget");
                foreach (var t in targets)
                {
                    t.GetComponent <TrainingTarget>().Doomed();
                }

                engineTrainingSpawner.SetActive(false);
                shootTrainingSpawner = GameObject.Instantiate(shootTrainingSpawner, sd.transform.position + spawnerOffset, Quaternion.FromToRotation(Vector3.up, Vector3.left));
                shootTrainingSpawner.GetComponent <SmoothTrack>().target = sd.transform;
            }
            if (progression == 1 && DataDump.GetInt("TrainingTargetsShot") >= shootCount)
            {
                var targets = GameObject.FindGameObjectsWithTag("TrainingTargetShoot");
                foreach (var t in targets)
                {
                    t.GetComponent <TrainingTargetShoot>().Doomed();
                }
                shootTrainingSpawner.SetActive(false);
                DialogueQueue.AddMessage("Nice shooting! You're pretty much a professional at this point.");
                DialogueQueue.AddMessage("Deliver the package safely. There might be a few birds on the way to watch out for, but nothing to worry about.");
                DialogueQueue.AddMessage("...");
                progression++;
            }
            if (progression == 2)
            {
                timer -= Time.deltaTime;
                if (timer < 0)
                {
                    progression++;
                    return(new BirdsState());
                }
            }
            return(this);
        }
コード例 #5
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag.Equals("PlayerBullet"))
     {
         GobPool.Destroy(other.gameObject);
         DataDump.SetInt("BirdsKilled", DataDump.GetInt("BirdsKilled") + 1);
         var df = GobPool.Instantiate(deadFacade);
         df.transform.SetPositionAndRotation(transform.position, Quaternion.identity);
         Doomed();
     }
     if (other.tag.Equals("Player"))
     {
         DataDump.SetInt("BirdsKilled", DataDump.GetInt("BirdsKilled") + 1);
         other.GetComponent <ShipDriver>().TakeDamage(1);
         var df = GobPool.Instantiate(deadFacade);
         df.transform.SetPositionAndRotation(transform.position, Quaternion.identity);
         Doomed();
     }
 }
コード例 #6
0
        public IState Update()
        {
            if (progression == 0 && DataDump.GetInt("BirdsKilled") >= 20)
            {
                DataDump.SetInt("BirdsKilled", 0);
                progression++;

                birdSpawner.SetActive(true);
            }
            if (progression == 1 && DataDump.GetInt("BirdsKilled") >= 20)
            {
                DataDump.SetInt("BirdsKilled", 0);
                progression++;

                birdBomberSpawner.SetActive(true);
            }
            if (progression == 2 && DataDump.GetInt("BirdsKilled") >= 20)
            {
                DataDump.SetInt("BirdsKilled", 0);
                progression++;

                birdSpawner.SetActive(false);
                birdTightSpawner.SetActive(false);
                birdBomberSpawner.SetActive(false);
            }
            if (progression == 3)
            {
                timer -= Time.deltaTime;
                if (timer < 0)
                {
                    loops--;
                    progression = 0;
                    birdTightSpawner.SetActive(true);
                    timer = 10;
                    if (loops <= 0)
                    {
                        return(new BossState());
                    }
                    return(this);
                }
            }
            return(this);
        }
コード例 #7
0
 public IState Update()
 {
     if (progression == 0 || progression == 4)
     {
         timer -= Time.deltaTime;
     }
     if (progression == 0 && timer < 0)
     {
         DialogueQueue.AddMessage("Here they come!");
         boss = GameObject.Instantiate(boss, sd.transform.position + spawnerOffset + Vector3.up * -5, Quaternion.FromToRotation(Vector3.forward, Vector3.left));
         boss.GetComponent <SmoothTrack>().target = sd.transform;
         progression++;
     }
     if (progression == 1 && DataDump.GetInt("BossHP") < 500)
     {
         DialogueQueue.AddMessage("Keep it up!");
         progression++;
     }
     if (progression == 2 && DataDump.GetInt("BossHP") < 250)
     {
         DialogueQueue.AddMessage("You have them on the ropes!");
         progression++;
     }
     if (progression == 3 && DataDump.GetInt("BossHP") <= 0)
     {
         DialogueQueue.AddMessage("Yeah! Great work comrade! The drop point is just ahead!");
         timer = 5;
         progression++;
     }
     if (progression == 4 && timer < 0)
     {
         progression++;
         return(new DropoffState());
     }
     return(this);
 }