aboutsummaryrefslogtreecommitdiffstats
path: root/autoload/space_vlaze/life.vim
diff options
context:
space:
mode:
authorTeddy Wing2015-10-07 23:24:25 -0400
committerTeddy Wing2015-10-07 23:24:25 -0400
commit794d8f872a36a29c56a4e921d33fc1a4ee497910 (patch)
tree6257f4574f39ef335f74c5ef2e64c4d211010274 /autoload/space_vlaze/life.vim
parent3f8fc7ff1758fc9276d163026212d1cbb08d9bbf (diff)
downloadvim-space-vlaze-794d8f872a36a29c56a4e921d33fc1a4ee497910.tar.bz2
Create "Game Over" state
When the player has 0 lives left then quit the game and display "Game Over" text. TODO: Request player name at this point to store in the leaderboard.
Diffstat (limited to 'autoload/space_vlaze/life.vim')
-rw-r--r--autoload/space_vlaze/life.vim4
1 files changed, 4 insertions, 0 deletions
diff --git a/autoload/space_vlaze/life.vim b/autoload/space_vlaze/life.vim
index 1d300bd..a66529d 100644
--- a/autoload/space_vlaze/life.vim
+++ b/autoload/space_vlaze/life.vim
@@ -10,6 +10,10 @@ endfunction
function! space_vlaze#life#DecrementLives()
let s:lives -= 1
+
+ if s:lives ==# 0
+ call space_vlaze#game#GameOver()
+ endif
endfunction