diff --git a/assets/ui/red_rocket.png b/assets/ui/red_rocket.png new file mode 100644 index 0000000..7e50bc0 Binary files /dev/null and b/assets/ui/red_rocket.png differ diff --git a/entities/enemy.lua b/entities/enemy.lua index 5fdb5a5..9857197 100644 --- a/entities/enemy.lua +++ b/entities/enemy.lua @@ -22,7 +22,7 @@ function Enemy:new(x, y, radius, playableArea) self.height = 22 self.width = 24 - self.x_offset = 18 --18 + self.x_offset = 18 self.y_offset = 20 self.hitbox = { @@ -41,6 +41,7 @@ end function Enemy:draw() --draw stuff love.graphics.rectangle("line", self.hitbox[1], self.hitbox[3], self.width, self.height) + --TODO: Resolve this magic number bullshit on line 52. (Why do I subtract 4?) love.graphics.draw( self.image, self.x, @@ -48,7 +49,7 @@ function Enemy:draw() 3.14159, 1, 1, - (self.x_offset + self.width * 2), + (self.x_offset + self.width * 2 - 4), (self.y_offset + self.height * 2) ) diff --git a/userInterface.lua b/userInterface.lua index cf2dad5..dad6da4 100644 --- a/userInterface.lua +++ b/userInterface.lua @@ -1,10 +1,14 @@ 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 @@ -13,8 +17,36 @@ 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