feat: Roses spawn
This commit is contained in:
parent
ff2d68ed07
commit
f8a29f1501
206 changed files with 12637 additions and 19 deletions
|
@ -2,12 +2,27 @@
|
|||
public class Model {
|
||||
public int Score { private set; get; }
|
||||
|
||||
public Model(int score) {
|
||||
private readonly int _spawnRate;
|
||||
private bool _needsToSpawn;
|
||||
|
||||
public Model(int spawnRate) : this(0, spawnRate) { }
|
||||
|
||||
public Model(int score, int spawnRate) {
|
||||
Score = score;
|
||||
_spawnRate = spawnRate;
|
||||
}
|
||||
|
||||
public void AddScore(int score) {
|
||||
Score += score;
|
||||
public void AddScore() {
|
||||
Score++;
|
||||
if (Score % _spawnRate == 0)
|
||||
_needsToSpawn = true;
|
||||
}
|
||||
|
||||
public bool NeedsToSpawn() {
|
||||
bool needs = _needsToSpawn;
|
||||
_needsToSpawn = false;
|
||||
|
||||
return needs;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue