48 lines
1.2 KiB
Lua
48 lines
1.2 KiB
Lua
--load peachy
|
|
peachy = require("libs/peachy")
|
|
|
|
--load globals
|
|
local globals = require("modules/globals")
|
|
game = globals.game
|
|
|
|
--load player
|
|
player = require("modules/player")
|
|
|
|
--load floors
|
|
floors = require("modules/floors")
|
|
|
|
--load content_loader
|
|
local content_loader = require("modules/content_loader")
|
|
spritesheets = content_loader.spritesheets
|
|
sound_effects = content_loader.sound_effects
|
|
|
|
player:init(sound_effects, spritesheets, game)
|
|
--load hump camera
|
|
Camera = require("libs/hump/camera")
|
|
camera = Camera(player.object.body:getX(), player.object.body:getY())
|
|
|
|
--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
|
|
|
|
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)
|
|
|
|
--play music for level
|
|
game:getcurlevel().music:play()
|
|
|
|
function love.draw()
|
|
draw_callback()
|
|
end
|
|
|
|
function love.update(dt)
|
|
update_callback(dt)
|
|
end |