Beispiel #1
0
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Space))
     {
         int n = 0;
         foreach (var enemy in EnemyManager.GetAllEnemies())
         {
             for (int i = 0; i < enemy.word.Length; ++i)
             {
                 if (Score.GetScore() <= 0 || Score.GetScore() < consume * n)
                 {
                     break;
                 }
                 var alphabet = enemy.OnAttack(enemy.word[i].ToString());
                 if (alphabet)
                 {
                     AddBullet(alphabet, n++ *0.05f);
                 }
             }
         }
         if (n > 0)
         {
             Score.AddScore(-consume * n);
             KeyboardReturn.Emit();
         }
     }
 }
Beispiel #2
0
 void AttackCurrentEnemy()
 {
     foreach (var key in keys_)
     {
         if (Input.GetKeyDown(key))
         {
             QueryBullet(currentLockingEnemy_, key);
             if (currentLockingEnemy_.isAllLocked)
             {
                 int score = (currentLockingEnemy_.word.Length == 1) ? 30 :
                             (int)(currentLockingEnemy_.word.Length / (Time.time - startTime_) * currentLockingEnemy_.word.Length);
                 currentLockingEnemy_.score = score;
                 KeyboardReturn.OnReady();
                 isAttacking_ = false;
             }
         }
     }
 }
Beispiel #3
0
 void Awake()
 {
     instance = this;
 }