aboutsummaryrefslogtreecommitdiffstats
path: root/autoload/space_vlaze/life.vim
AgeCommit message (Collapse)Author
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-08life#RenderLives: Add space between `|` and diamondsTeddy Wing
Add a space after the `|` pipe character we added in c9934c4b1192f50ae0d6930381622c58fbe7048a to put some breathing room between it and the diamond characters. Went back and forth on this and neither looked quite right but I think I'm going to go with this one.
2015-10-08Add coloursTeddy Wing
* Need to hard-code the enemy and player characters in order for the `syntax match` calls to work * Enemies are a brownish colour (to remind you of popcorn kernels) * The player is a pinkish colour because it's vibrant and contrasts with the brown of the enemies * Lives have a maroon/burgundy background colour * Score has a purple background colour that's similar enough in shade to the lives section to make it part of the same context but different enough to make it it's own section * Add a `|` pipe character in front of score in order to be able to colour it correctly even if the player has 0 lives left.
2015-10-07Create "Game Over" stateTeddy Wing
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.
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