aboutsummaryrefslogtreecommitdiffstats
path: root/autoload/space_vlaze/score.vim
AgeCommit message (Collapse)Author
2015-10-08Save high scoresTeddy Wing
When you get a game over, save your high score to a file so that we can display it on the leaderboard. The saved scores get sorted from highest to lowest. If we don't have your name yet (saved to a separate file), we prompt you for it. This means that you can only have one player (name) per installation. Not the best scenario because maybe you have multiple people playing on your computer, but I made a judgement call to do it this way so we don't have to keep prompting the player for their name every time they get a Game Over. That could get annoying fast.
2015-10-08Add space padding to Lives and Score linesTeddy Wing
Pad these 2 status lines with spaces to the right of their string values so that their background colours extend to the full width of the game board. First tried `len()`, then `strlen()` when counting characters in `padding#RightPadding()` but turns out those deal with bytes and the player character is a multi-byte character so we would come up sort on spaces for padding in the Lives line because the player diamond counts for double. To get around this, used `strchars()` which gives us a count of the characters instead of the bytes.
2015-10-07Add livesTeddy Wing
* Create life.vim to keep track of lives * Players start with 3 lives * Add increment and decrement functions for lives because they'll be useful in the future (although there's a more immediate need for the decrement function) * Render lives at the bottom of the board * Move the score line down so that it appears just below the life count display
2015-10-07Increment score when enemies are destroyedTeddy Wing
* 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.