コード例 #1
0
ファイル: GameManager.cs プロジェクト: Insality/match3
        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);
        }
コード例 #2
0
ファイル: Goal.cs プロジェクト: Therrato/FunnieVliegtVertical
        /// <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;
        }
コード例 #3
0
ファイル: Goal.cs プロジェクト: Therrato/FunnieVliegtVertical
 public int getPercentageReachedBananas(PlayerStats p)
 {
     return p.bananas * (this.bananas / 100);
 }
コード例 #4
0
ファイル: Goal.cs プロジェクト: Therrato/FunnieVliegtVertical
 /// <summary>
 ///  in case of 5 min mode
 /// </summary>
 /// <param name="p"></param>
 /// <returns></returns>
 public int getBarInt(PlayerStats p)
 {
     return p.bananas;
 }