diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index 18dd403..59a4f8c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -268,6 +268,14 @@ impl Game { } } + fn update_feeding(&mut self) { + for i in 0..COLUMNS { + if self.grid[0][i].occupant == Occupant::None { + self.grid[0][i].occupant = rand::random(); + } + } + } + fn update_frames(&mut self) { for row in self.grid.iter_mut() { for cell in row.iter_mut() { @@ -315,6 +323,7 @@ impl EventHandler for Game { self.update_explosions(); self.update_frames(); self.update_dropping(); + self.update_feeding(); Ok(()) } |