World Gen #1, Inventory #1

-- Added loading of .vsmf map files
-- Updated some variable names
-- Added developer information to the top left of the screen
-- Added a trial inventory
This commit is contained in:
Hannah-Dagemark 2023-09-15 20:52:30 +02:00
commit c9a1ef3d82
7 changed files with 164 additions and 10 deletions

View file

@ -16,12 +16,12 @@ function keyboard_input_held(object, dt)
if love.keyboard.isDown("lshift") then
object.bools.isRunning = true
end
if love.keyboard.isDown(keybind.left) and love.keyboard.isDown(keybind.right) then
if love.keyboard.isDown(keybinds.left) and love.keyboard.isDown(keybinds.right) then
-- you're stopped now :3c
elseif love.keyboard.isDown(keybind.left) then
elseif love.keyboard.isDown(keybinds.left) then
object.bools.isWalking = true
if math.abs(object.physics.velocityX) + 0.1 < object.functions.getRunningSpeed(object.bools.isRunning) then object.physics.velocityX = object.physics.velocityX - 0.1 else object.physics.velocityX = object.functions.getRunningSpeed(object.bools.isRunning)* -1 end
elseif love.keyboard.isDown(keybind.right) then
elseif love.keyboard.isDown(keybinds.right) then
object.bools.isWalking = true
if math.abs(object.physics.velocityX) < object.functions.getRunningSpeed(object.bools.isRunning) then object.physics.velocityX = object.physics.velocityX + 0.1 else object.physics.velocityX = object.functions.getRunningSpeed(object.bools.isRunning) end
end
@ -38,19 +38,26 @@ end
function love.keypressed(key)
if Scene == "gameTest" then
if key == keybind.jump then player.physics.velocityY = player.physics.velocityY - 3 end
if key == keybind.interact then
if key == keybinds.jump and player.bools.isAirborne == false then player.physics.velocityY = player.physics.velocityY - 5 end
if key == keybinds.interact then
check_space.interactables(player.x, player.y)
end
if key == keybind.create then
if key == keybinds.create then
NPCs[#NPCs+1] = character.create({"attributes", "functions","bools","physics"}, false)
NPCs[#NPCs].x = math.random(0, window.x-20)
NPCs[#NPCs].y = window.y/2-window.y/20
NPCs[#NPCs].width = 20
NPCs[#NPCs].height = 80
end
if key == keybinds.primary then
player.current_equip = 1
end
if key == keybinds.secondary then
player.current_equip = 2
end
else
if key == keybind.jump then
if key == keybinds.jump then
titleCard.duration = true
end
end