aboutsummaryrefslogtreecommitdiffstats
path: root/autoload/space_vlaze/game.vim
diff options
context:
space:
mode:
authorTeddy Wing2015-10-07 03:55:22 -0400
committerTeddy Wing2015-10-07 03:55:22 -0400
commit1a2cdf4bb9b233323d8d7ada63eeffffce6ebd1a (patch)
tree47aa7c1ac394f72d34010f68bda46ccb7882dccf /autoload/space_vlaze/game.vim
parent2223ed7b3a6f347457ba63eef378d071eb9e57e6 (diff)
downloadvim-space-vlaze-1a2cdf4bb9b233323d8d7ada63eeffffce6ebd1a.tar.bz2
Increment score when enemies are destroyed
* Create score.vim to keep track of score and group scoring-related functions * Increment player score when an enemy is defeated. The point count is based on a base value and a multiplier. Currently set to 1 for each such that each enemy is always worth 1 point. The multiplier is there so that as time increases we can increase the multiplier and increase the value of an enemy the longer the player plays. * Render score to the screen so that it's visible to players.
Diffstat (limited to 'autoload/space_vlaze/game.vim')
-rw-r--r--autoload/space_vlaze/game.vim3
1 files changed, 2 insertions, 1 deletions
diff --git a/autoload/space_vlaze/game.vim b/autoload/space_vlaze/game.vim
index f712478..72594b7 100644
--- a/autoload/space_vlaze/game.vim
+++ b/autoload/space_vlaze/game.vim
@@ -1,18 +1,19 @@
function! space_vlaze#game#Init()
let s:loop = 1
- let s:score = 0
let s:start_time = localtime()
let s:ticks = 1
call space_vlaze#game#SetupWindow()
call space_vlaze#colors#Initialize()
call space_vlaze#game#InitializeBoard()
call space_vlaze#mappings#Initialize()
+ call space_vlaze#score#Initialize()
while s:loop ==# 1
sleep 50ms
call space_vlaze#mappings#Listen()
call space_vlaze#enemy#AddEnemiesToBoard()
call space_vlaze#game#RenderBoard()
+ call space_vlaze#score#RenderScore()
let s:ticks += 1
endwhile
endfunction