-- Added item interaction -- Changed inventory management slightly -- Added slide-show system to world, world can now "move" to show more space.
This commit is contained in:
parent
360d26a036
commit
3a3bea1ead
8 changed files with 164 additions and 22 deletions
12
main.lua
12
main.lua
|
|
@ -13,6 +13,7 @@ function love.load()
|
|||
window.x, window.y = love.window.getDesktopDimensions()
|
||||
math.randomseed(os.time())
|
||||
Scene = "menu"
|
||||
items_ini = require('scripts/items')
|
||||
inputs_ini = require('scripts/inputs')
|
||||
physics_ini = require('physics')
|
||||
menu_ini = require('menu')
|
||||
|
|
@ -47,6 +48,7 @@ function love.update(dt)
|
|||
end
|
||||
keyboard_input_held(player, dt)
|
||||
gravity(player, dt)
|
||||
World.mapMovement(player.x)
|
||||
mouvement(player, dt)
|
||||
for i = 1, #NPCs do
|
||||
gravity(NPCs[i], dt)
|
||||
|
|
@ -98,6 +100,10 @@ function love.draw()
|
|||
end
|
||||
end
|
||||
if globalMode == "devMode" then
|
||||
|
||||
love.graphics.print("World X " .. World.map.x, 100, 150)
|
||||
love.graphics.print("X " .. player.x, 100, 200)
|
||||
love.graphics.print("Y " .. player.y, 100, 250)
|
||||
love.graphics.print("Velocity X " .. player.physics.velocityX, 100, 300)
|
||||
love.graphics.print("Velocity Y " .. player.physics.velocityY, 100, 350)
|
||||
love.graphics.print("Airtime " .. player.physics.airtime, 100, 400)
|
||||
|
|
@ -193,11 +199,11 @@ end
|
|||
|
||||
function inventory(mode, slot, item)
|
||||
if mode == "add" then
|
||||
hotbar_cont[slot] = item
|
||||
player.hotbar_cont[slot] = item
|
||||
elseif mode == "remove" then
|
||||
hotbar_cont[slot] = nil
|
||||
player.hotbar_cont[slot] = nil
|
||||
elseif mode == "move" then
|
||||
item = hotbar_cont[slot[1]]
|
||||
hotbar_cont[slot[2]] = item
|
||||
player.hotbar_cont[slot[2]] = item
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue