// Update is called once per frame void Update() { ICommand commandTemp = _inputHandler.HandleInput(); if (commandTemp != null) { newDirection = commandTemp.Execute(_playerObject); } if (PlayerAlarm.TickingTimer()) { _player.MoveActor(_playerObject, newDirection, _levelGeneration.Path); foreach (Enemy enemy in _levelGeneration.EnemyList) { if (enemy.CheckCollision(_playerObject.transform.position)) { Die(); break; } } int points = _powerUpManager.checkPickUp(_playerObject.transform.position, _powerUpPool); _score.AddPoints(points, 300 * _currentLevel); } if (_score._levelUp) { LevelCleared(); } }
// Update is called once per frame void Update() { ICommand commandTemp = _inputHandler.HandleInput(); if (commandTemp != null) { newDirection = commandTemp.Execute(playerObject); } if (PlayerAlarm.TickingTimer()) { _player.MoveActor(playerObject, newDirection, _levelGeneration.Path); int points = powerUpManager.checkPickUp(playerObject.transform.position, _powerUpPool); _score.AddPoints(points, 300 * _currentLevel); } if (_score._levelUp) { LevelCleared(); } }