MinecraftU / 2021-computer-adventures

Repository for our 2021 Computer Adventures Ruby project!
0 stars 0 forks source link

Detects game over #53

Closed jamespeilunli closed 3 years ago

jamespeilunli commented 3 years ago

closes #52

tetris.rb now detects when a game over happens by checking if the tetromino died at the same y value it spawned in at (so the "highest" y value. In quotes because that's actually y index 0 on the gameboard).

When a game over happens, the gameboard is cleared (to empty most of the screen) and the background is set to red. A "GAME OVER" text box is initialized at the center of the screen. Then, after 3 seconds, the Ruby2D window closes and the program exits.