Menu additions and Function

- Menu now has buttons
- Menu buttons will change color when hovered over
- Menu "start" button now changes stage to the Game Test
This commit is contained in:
Hannah-Dagemark 2023-09-04 14:17:48 +02:00
commit e9da50897f
6 changed files with 123 additions and 11 deletions

View file

@ -8,14 +8,15 @@ functiongenerator = {}
check_space = {}
function love.load()
window = {}
window.x, window.y = love.window.getDesktopDimensions()
math.randomseed(os.time())
Scene = "menu"
inputs_ini = require('scripts/inputs')
physics_ini = require('physics')
menu_ini = require('menu')
menu.load()
window = {}
NPCs = {}
window.x, window.y = love.window.getDesktopDimensions()
ground = {
x = 0,
y = window.y,
@ -52,7 +53,9 @@ function love.update(dt)
end
function love.draw()
if Scene == "gameTest" then
love.graphics.print(Scene, 100, 100)
if Scene == "gameTest" then
if love.graphics.getColor() ~= 1 then love.graphics.setColor(1, 1, 1) end
love.graphics.rectangle("line", player.x, player.y, player.width, player.height)
if player.bools.isFacingRight then
love.graphics.rectangle("line", player.x+10, player.y-20, 20, 20)