private void Start() { Camera = Camera.main; _player = GetComponent<PlayerStats>(); _gameState = Constants.GameState.WaitingInput; _cursor = new GameObject {name = "Cursor"}; _cursor.AddComponent<SpriteRenderer>(); _cursor.GetComponent<SpriteRenderer>().sprite = CursorSprite; SetActiveGem(null); BoardLogic = GameObject.FindGameObjectWithTag("Board").GetComponent<BoardLogic>(); BoardLogic.InitBoard(this, 6, 8); }
/// <summary> /// will check if all requerements for ending thelevel are met /// </summary> /// <param name="playerStats">give the current stats of the player</param> /// <returns>when true requeirements are met</returns> public bool isGoalReached(PlayerStats playerStats) { if (this.duration != 0) { if (this.duration > playerStats.calculateRunTime()) return false; } if (this.bananas > playerStats.bananas) return false; if (this.feathersCollected > playerStats.feathersCollected) return false; if (this.figuresPassed > playerStats.figuresPassed) return false; if (this.obstaclesHit > playerStats.obstaclesHit) return false; if (this.obstaclesPassed > playerStats.obstaclesPassed) return false; if (this.tilesPassed > playerStats.tilesPassed) return false; return true; }
public int getPercentageReachedBananas(PlayerStats p) { return p.bananas * (this.bananas / 100); }
/// <summary> /// in case of 5 min mode /// </summary> /// <param name="p"></param> /// <returns></returns> public int getBarInt(PlayerStats p) { return p.bananas; }