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; } }
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...."); } } }
void spawnStateCondition() { Debug.Log("spawn"); // go to roaming state currentState = pacManStates.roamingState; SceneManager.LoadScene(SceneManager.GetActiveScene().name); }
public void Reset() { transform.position = initialPosition; animator.SetBool("isDead", false); animator.SetBool("isMoving", false); currentDirection = down; currentState = pacManStates.roamingState; }
void winStateCondition() { Debug.Log("Win "); if (totalCrums == 240) { currentState = pacManStates.winState; Debug.Log("Win State Condition True"); Reset(); } }
// 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(); }
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(); }