Commit 2cddb7a7 authored by Gerard Gascón's avatar Gerard Gascón
Browse files

fix: first clicks now are properly detected

parent db839ea9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -158,6 +158,7 @@ MonoBehaviour:
    y: -5
    width: 12
    height: 10
  initialSpawnerAvoidedRegion: 4
  rose: {fileID: 2147392553565862127, guid: 72ac2e17b1585614eb5c2eb65a0d37c0, type: 3}
--- !u!4 &4783506
Transform:
+3 −0
Original line number Diff line number Diff line
@@ -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) { }

+6 −2
Original line number Diff line number Diff line
@@ -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();
		}
+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
+6 −3
Original line number Diff line number Diff line
@@ -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