alunizaje/assets/scripts/game.lua

21 lines
649 B
Lua
Raw Normal View History

2016-11-14 00:35:14 +01:00
local game = {}
2016-12-01 21:23:35 +01:00
local bump = require 'assets/scripts/vendor/bump'
2016-11-14 00:35:14 +01:00
function game.load()
-- Configuration
math.randomseed(os.time())
local width, height = love.window.getDesktopDimensions( display )
game.window = { width = width , height = height }
game.canvas = { width = width, height = 2880 }
love.window.setMode(game.window.width, game.window.height)
game.level = 1
-- Physics
local world_meter = 64
local gravity = 2
love.physics.setMeter(world_meter) -- Height earth in meters
game.world = love.physics.newWorld(0, gravity * world_meter, true) -- Make earth
2016-12-01 21:23:35 +01:00
-- Collisions
game.collisions = bump.newWorld(50)
2016-11-14 00:35:14 +01:00
end
return game