Example #1
0
    void Update()
    {
        foreach (GameObject Log in Logs)
        {
            GameBoard.AI_Move(Log, v_log);         // Move obj C with velocity of v
            if (Mathf.Abs(Log.transform.position.x) >= GameBoard.RespawnPoint)
            {
                GameBoard.RespawnObject(Log);
            }
        }

        foreach (GameObject Lily in Lilys)
        {
            if (AmountOfSinkingElements < MaxAmountOfSinkingElements)
            {
                AmountOfSinkingElements++;
                StartCoroutine(SinkingSequence(Lily));
            }
            GameBoard.AI_Move(Lily, v_lily);         // Move obj C with velocity of v
            if (Mathf.Abs(Lily.transform.position.x) >= GameBoard.RespawnPoint)
            {
                GameBoard.RespawnObject(Lily);
            }
        }
    }
Example #2
0
 void Update()
 {
     foreach (GameObject Car in Cars)
     {
         GameBoard.AI_Move(Car, v);                                          // Move obj C with velocity of v
         if (Mathf.Abs(Car.transform.position.x) >= GameBoard.RespawnPoint)  // if goes too far on the board
         {
             GameBoard.RespawnObject(Car);
         }
     }
 }
Example #3
0
 void Update()
 {
     foreach (GameObject Snake in Snakes)
     {
         GameBoard.AI_Move(Snake, v_snake);         // Move obj C with velocity of v
         Snake.GetComponent <SpriteRenderer>().flipY = snakeflip;
         if (Mathf.Abs(Snake.transform.position.x) >= GameBoard.RespawnPoint)
         {
             GameBoard.RespawnObject(Snake);
         }
     }
 }