Exemple #1
0
    void InitProperties()
    {
        //Grid Setup (should of made a grid level base class for abstraction and inherit from there... next time)
        xMax = GameManager.Instance.config.xMax;
        yMax = GameManager.Instance.config.yMax;

        rightBorder = GameManager.Instance.config.rightBorder;
        leftBorder  = GameManager.Instance.config.leftBorder;

        xDistance = GameManager.Instance.config.xDistance;
        yDistance = GameManager.Instance.config.yDistance;

        //Enemy Props
        // Reset movement speed state/flags
        tickTime             = GameManager.Instance.config.enemySpeed;
        randomShootTimeRange = GameManager.Instance.config.randomEnemyShootingInterval;
        movementState        = States.EnemyMovementState.LeftBorder;
        // todo add horizontal/vertical movement state instead of flags
        // ran out of time
        moveDown          = false;
        moveLeft          = false;
        combos            = 0;
        totalNumOfEnemies = 0;
        variableSpeed     = tickTime;
        bottomEnemies     = new List <GameObject> ();
        rngShootDelay     = UnityEngine.Random.value * randomShootTimeRange;
    }
Exemple #2
0
 void CheckBounds(GameObject go)
 {
     if (go.activeInHierarchy)
     {
         if (go.transform.position.x >= rightBorder)
         {
             movementState = States.EnemyMovementState.RightBorder; moveDown = true;
         }
         if (go.transform.position.x <= leftBorder)
         {
             movementState = States.EnemyMovementState.LeftBorder; moveDown = true;
         }
     }
 }