Weeeeee/main.lua

48 lines
1.2 KiB
Lua
Raw Normal View History

2022-03-02 18:36:52 +01:00
--load peachy
peachy = require("libs/peachy")
2022-03-03 13:13:17 +01:00
--load globals
local globals = require("modules/globals")
game = globals.game
2022-03-02 18:36:52 +01:00
--load player
player = require("modules/player")
2022-03-03 13:13:17 +01:00
--load floors
floors = require("modules/floors")
2022-03-02 20:31:33 +01:00
2022-03-02 18:36:52 +01:00
--load content_loader
local content_loader = require("modules/content_loader")
spritesheets = content_loader.spritesheets
sound_effects = content_loader.sound_effects
2022-03-03 13:13:17 +01:00
player:init(sound_effects, spritesheets, game)
--load hump camera
Camera = require("libs/hump/camera")
camera = Camera(player.object.body:getX(), player.object.body:getY())
2022-03-02 18:36:52 +01:00
--load draw_callback
draw_mod = require("modules/draw_callback")
local draw_callback = draw_mod.draw
local drawerinit = draw_mod.drawerinit
--load update_callback
update_mod = require("modules/update_callback")
local update_callback = update_mod.update
local updateinit = update_mod.updateinit
2022-03-03 13:13:17 +01:00
floors:addFloor("Bottom", game, 0, (game:getcurlevel().height /4) - 160, game:getcurlevel().width, 160, 255, 255, 255, 255)
drawerinit(spritesheets, player, game, camera, floors)
updateinit(game, camera, floors)
2022-03-02 18:36:52 +01:00
2022-03-02 20:31:33 +01:00
--play music for level
game:getcurlevel().music:play()
2022-03-02 18:36:52 +01:00
function love.draw()
draw_callback()
end
function love.update(dt)
2022-03-03 13:13:17 +01:00
update_callback(dt)
2022-03-02 18:36:52 +01:00
end