示例#1
0
 void superPMStateCondition()
 {
     Debug.Log("Super state");
     if (isTabletCollision == true)
     {
         // stay here
         isTabletCollision  = false;
         _timerforsupermood = DateTime.Now.AddSeconds(Super_mood_interval);
     }
     if (DateTime.Now >= _timerforsupermood)
     {
         //go to normal roaming state
         currentState = pacManStates.roamingState;
     }
     if (isGhostCollision)
     {
         // staty here
         isGhostCollision = false;
         Destroy(_ghostObject.gameObject);
         _ghostObject = null;
         Debug.Log("Ghost Destroyed");
     }
     if (totalCrums == 240)
     {
         //go to win state
         currentState = pacManStates.winState;
     }
 }
示例#2
0
    void roamingStateCondition()
    {
        if (currentState == pacManStates.roamingState)
        {
            Debug.Log("roaming");
            //eat crums
            totalCrums   = totalCrums + 1;
            CurrentEvent = GameEvents.EatCrum;

            if (isGhostCollision)
            {
                // go to dead state
                isGhostCollision = false;
                isDead           = true;
                Debug.Log("Dead");
                currentState = pacManStates.deadState;
            }
            if (isTabletCollision)
            {
                isTabletCollision  = false;
                currentState       = pacManStates.superPMState;
                _timerforsupermood = DateTime.Now.AddSeconds(Super_mood_interval);
            }
            if (totalCrums == 240)
            {
                //    go to win state
                currentState = pacManStates.winState;
                Debug.Log("Win State....");
            }
        }
    }
示例#3
0
 void spawnStateCondition()
 {
     Debug.Log("spawn");
     // go to roaming state
     currentState = pacManStates.roamingState;
     SceneManager.LoadScene(SceneManager.GetActiveScene().name);
 }
示例#4
0
    public void Reset()
    {
        transform.position = initialPosition;
        animator.SetBool("isDead", false);
        animator.SetBool("isMoving", false);

        currentDirection = down;
        currentState     = pacManStates.roamingState;
    }
示例#5
0
 void winStateCondition()
 {
     Debug.Log("Win ");
     if (totalCrums == 240)
     {
         currentState = pacManStates.winState;
         Debug.Log("Win State Condition True");
         Reset();
     }
 }
示例#6
0
    // Use this for initialization
    void Start()
    {
        QualitySettings.vSyncCount = 0;

        initialPosition     = transform.position;
        animator            = GetComponent <Animator>();
        currentState        = pacManStates.roamingState;
        totalCrums          = 0;
        Super_pills         = 0;
        Super_mood_interval = 7;
        Reset();
    }
示例#7
0
 void deadStateCondition()
 {
     //  Debug.Log("Dead State");
     if (isDead == true)
     {
         animator.SetBool("isDead", true);
         currentState = pacManStates.gameOverState;
     }
     if (currentState == pacManStates.deadState)
     {
         // go to game over state
         gameOverStateCondition();
     }
     gameOverStateCondition();
 }