Created
February 3, 2012 01:24
-
-
Save ruprict/1726974 to your computer and use it in GitHub Desktop.
ROFLBALT Scoreboard and GameOverBanner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Scoreboard | |
include Renderable | |
def initialize world | |
@world = world | |
end | |
def height; 3 end | |
def width; 20 end | |
def x; -18 end | |
def y; 1 end | |
def template | |
[ | |
' ', | |
' Score: %9s ' % [ @world.distance], | |
' ' | |
] | |
end | |
def pixel x, y, rx, ry, ticks | |
Pixel.new template[ry][rx], 244, 234 | |
end | |
end | |
class GameOverBanner | |
FG = 16 | |
BG = 244 | |
include Renderable | |
def x; 28 end | |
def y; 14 end | |
def width; 28 end | |
def height; 3 end | |
def template | |
[ | |
' ', | |
' YOU DIED. LOL. ', | |
' ', | |
] | |
end | |
def pixel x, y, rx, ry, ticks | |
Pixel.new template[ry][rx], FG, BG | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment