Weeeeee/modules/globals.lua

33 lines
983 B
Lua

local game = {}
game.debug = true
game.width = 1024
game.height = 768
game.title = "Weeeeeeeee"
game.version = "0.0.1"
game.fullscreen = false
game.level = 1
game.level_count = 1
game.levels = {}
game.objects = {}
--set up physics
love.physics.setMeter(64)
game.world = love.physics.newWorld(0, 9.81*64, true)
game.getcurlevel = function(self)
return self.levels[self.level]
end
for i = 1, game.level_count, 1 do
game.levels[i] = {}
game.levels[i].background = love.graphics.newImage("assets/images/backgrounds/level".. i .."_hires.png")
game.levels[i].width = game.levels[i].background:getWidth()
game.levels[i].height = game.levels[i].background:getHeight()
--print level dimensions
print("Level " .. i .. " dimensions: " .. game.levels[i].width .. "x" .. game.levels[i].height)
game.levels[i].music = love.audio.newSource("assets/audio/music/track".. i ..".ogg", "static")
game.levels[i].music:setLooping(true)
end
return {
game = game
}