Compare commits

...

4 Commits

Author SHA1 Message Date
Ishaan Bhardwaj df19129228 Update main.lua 2023-07-01 23:30:36 -04:00
--global 80de771d2a Elaborate on TARGET_FPS 2023-07-01 23:27:10 -04:00
--global 7c32273971 Alias Lua random functions to Love2D's 2023-07-01 23:15:14 -04:00
--global 9d5dbb4674 Bump version to v0.3.3 2023-07-01 22:34:34 -04:00
2 changed files with 11 additions and 4 deletions

View File

@ -1 +1 @@
version = "v0.3.2"
version = "v0.3.3"

View File

@ -1,5 +1,4 @@
function love.load()
math.randomseed(os.time())
highscores = {}
love.graphics.setDefaultFilter("linear", "nearest")
require "load.rpc"
@ -24,6 +23,11 @@ function love.load()
-- used for screenshots
GLOBAL_CANVAS = love.graphics.newCanvas()
-- aliasing to prevent people using math.random by accident
math.random = love.math.random
math.randomseed = love.math.setRandomSeed
math.randomseed(os.time())
-- init config
initConfig()
@ -285,13 +289,16 @@ function love.focus(f)
end
function love.resize(w, h)
GLOBAL_CANVAS:release()
GLOBAL_CANVAS = love.graphics.newCanvas(w, h)
GLOBAL_CANVAS:release()
GLOBAL_CANVAS = love.graphics.newCanvas(w, h)
end
-- higher values of TARGET_FPS will make the game run "faster"
-- since the game is mostly designed for 60 FPS
local TARGET_FPS = 60
local FRAME_DURATION = 1.0 / TARGET_FPS
-- custom run function; optimizes game by syncing draw/update calls
function love.run()
if love.load then love.load(love.arg.parseGameArguments(arg), arg) end