9 changed files with 29 additions and 10 deletions
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 336 B |
@ -1,3 +1,24 @@ |
|||||
|
Ui = Object:extend() |
||||
|
|
||||
|
--Set game canvas size |
||||
|
function Ui:new(window_width, window_height) |
||||
|
self.playableSpace = { window_width, window_height, (window_width * 0.25) } |
||||
|
self.score = 0 |
||||
|
|
||||
|
love.window.setMode((window_width * 1.5), window_height) |
||||
|
end |
||||
|
--set window size |
||||
|
|
||||
|
function Ui:draw() |
||||
|
local left_line = self.playableSpace[3] |
||||
|
local right_line = self.playableSpace[1] + self.playableSpace[3] |
||||
|
local window_height = self.playableSpace[2] |
||||
|
love.graphics.line(left_line, 0, left_line, window_height) |
||||
|
love.graphics.line(right_line, 0, right_line, window_height) |
||||
|
end |
||||
|
|
||||
|
--set |
||||
|
|
||||
--display the score |
--display the score |
||||
|
|
||||
--display player health |
--display player health |
||||
|
|||||
Loading…
Reference in new issue