Loading Assets/Scenes/Main.unity +1 −0 Original line number Diff line number Diff line Loading @@ -158,6 +158,7 @@ MonoBehaviour: y: -5 width: 12 height: 10 initialSpawnerAvoidedRegion: 4 rose: {fileID: 2147392553565862127, guid: 72ac2e17b1585614eb5c2eb65a0d37c0, type: 3} --- !u!4 &4783506 Transform: Loading Assets/Scripts/Domain/Score.cs +3 −0 Original line number Diff line number Diff line Loading @@ -2,10 +2,13 @@ public class Score { public int Value { private set; get; } public const int InitialRosesThreshold = 5; public readonly int SpawnRate; public readonly int GrowIterations; public float GrowPercentage { private set; get; } public int Roses => Value / (SpawnRate * GrowIterations); public Score(int spawnRate, int growIterations) : this(0, spawnRate, growIterations) { } Loading Assets/Scripts/Presenter/ExpressionClick.cs +6 −2 Original line number Diff line number Diff line Loading @@ -23,8 +23,12 @@ namespace Presenter { _view.UpdateView(_score.Value); _onInputReceived.OnInputReceived(); if (CanSpawn) if (CanSpawn) { if(_score.Value > Score.InitialRosesThreshold) _spawner.SpawnRose(); else _spawner.SpawnInitialRose(); } if (_score.Value % _score.GrowIterations == 0) _grow.GrowStep(); } Loading Assets/Scripts/Presenter/IRoseSpawner.cs +1 −0 Original line number Diff line number Diff line namespace Presenter { public interface IRoseSpawner { void SpawnRose(); void SpawnInitialRose(); } } No newline at end of file Assets/Scripts/Presenter/SaveSystem/LoadGame.cs +6 −3 Original line number Diff line number Diff line Loading @@ -22,9 +22,12 @@ namespace Presenter.SaveSystem { _scoreView.UpdateView(_score.Value); _growAnimation.GrowStep(); int roses = _score.Value / (_score.SpawnRate * _score.GrowIterations); for (int i = 0; i < roses; i++) for (int i = 0; i < _score.Roses; i++) { if (_score.Roses > Score.InitialRosesThreshold) _spawner.SpawnRose(); else _spawner.SpawnInitialRose(); } } } } No newline at end of file Loading
Assets/Scenes/Main.unity +1 −0 Original line number Diff line number Diff line Loading @@ -158,6 +158,7 @@ MonoBehaviour: y: -5 width: 12 height: 10 initialSpawnerAvoidedRegion: 4 rose: {fileID: 2147392553565862127, guid: 72ac2e17b1585614eb5c2eb65a0d37c0, type: 3} --- !u!4 &4783506 Transform: Loading
Assets/Scripts/Domain/Score.cs +3 −0 Original line number Diff line number Diff line Loading @@ -2,10 +2,13 @@ public class Score { public int Value { private set; get; } public const int InitialRosesThreshold = 5; public readonly int SpawnRate; public readonly int GrowIterations; public float GrowPercentage { private set; get; } public int Roses => Value / (SpawnRate * GrowIterations); public Score(int spawnRate, int growIterations) : this(0, spawnRate, growIterations) { } Loading
Assets/Scripts/Presenter/ExpressionClick.cs +6 −2 Original line number Diff line number Diff line Loading @@ -23,8 +23,12 @@ namespace Presenter { _view.UpdateView(_score.Value); _onInputReceived.OnInputReceived(); if (CanSpawn) if (CanSpawn) { if(_score.Value > Score.InitialRosesThreshold) _spawner.SpawnRose(); else _spawner.SpawnInitialRose(); } if (_score.Value % _score.GrowIterations == 0) _grow.GrowStep(); } Loading
Assets/Scripts/Presenter/IRoseSpawner.cs +1 −0 Original line number Diff line number Diff line namespace Presenter { public interface IRoseSpawner { void SpawnRose(); void SpawnInitialRose(); } } No newline at end of file
Assets/Scripts/Presenter/SaveSystem/LoadGame.cs +6 −3 Original line number Diff line number Diff line Loading @@ -22,9 +22,12 @@ namespace Presenter.SaveSystem { _scoreView.UpdateView(_score.Value); _growAnimation.GrowStep(); int roses = _score.Value / (_score.SpawnRate * _score.GrowIterations); for (int i = 0; i < roses; i++) for (int i = 0; i < _score.Roses; i++) { if (_score.Roses > Score.InitialRosesThreshold) _spawner.SpawnRose(); else _spawner.SpawnInitialRose(); } } } } No newline at end of file