A Little Space Game made in Love2D
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.7 KiB

User_Interface = Object:extend()
local emblem
--Set game canvas size
function User_Interface:new(window_width, window_height)
self.playableSpace = { window_width, window_height, (window_width * 0.25) }
self.score = 0
emblem = love.graphics.newImage("/assets/ui/red_rocket.png")
love.window.setMode((window_width * 1.5), window_height)
end
--set window size
function User_Interface:draw()
local left_line = self.playableSpace[3]
local right_line = self.playableSpace[1] + self.playableSpace[3]
local window_height = self.playableSpace[2]
--draw the stuff on the left
love.graphics.line(left_line, 0, left_line, window_height)
love.graphics.setColor(0.1, 0.1, 0.1)
love.graphics.rectangle("fill", 0, 0, left_line, window_height)
love.graphics.setColor(1, 1, 1)
love.graphics.circle("line", 50, 50, 25)
love.graphics.draw(emblem, 25, 25, 0, 0.25, 0.25)
--Game Message
love.graphics.print("Little Space Game!", 10, 200)
love.graphics.setColor(0, 0.75, 0)
love.graphics.print("Score: Placeholder", 10, 250)
love.graphics.setColor(0, 0, 0)
love.graphics.setColor(0.75, 0, 0)
love.graphics.print("Health: Placeholder", 10, 300)
love.graphics.setColor(1, 1, 1)
--draw the stuff on the right
love.graphics.line(right_line, 0, right_line, window_height)
love.graphics.setColor(0, 0, 0)
love.graphics.rectangle("fill", right_line, 0, left_line, window_height)
love.graphics.setColor(1, 1, 1)
--Stage Messages
love.graphics.print("Stage 1: In Progress", right_line + 10, 200)
love.graphics.print("Stage: Enemy Swarm", right_line + 10, 250)
end
--set
--display the score
--display player health
function User_Interface:returnBounds()
--return left and right lines
return { self.playableSpace[3], (self.playableSpace[1] + self.playableSpace[3]) }
end