質問

How would one go about making sure that a .love file only runs if the current version of LOVE2D is better than a given minimum version? Without some sort of check, the resulting errors can be obscure and seemingly unrelated to the LOVE version, requiring the user to waste a lot of time trying to diagnose issues based on misleading errors.

役に立ちましたか?

解決

You can add t.version = "0.8.0" to your conf.lua and it will warn the user if he is using a version other than 0.8.0. You shouldn't block mismatched versions, you should warn them.

Here's an example of conf.lua:

function love.conf(t)
    t.title = "Game title"
    t.author = "Your name"
    t.version = "0.8.0"
end

Here's the wiki article on conf.lua.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top