local backgroundColor = {255,0,0}
...
love.graphics.setColor(backGroundColor) -- the G is uppercase here, will set the color to white instead of red, with no error message
If this is a concern, I would add this at the beginning of your game:
local backgroundColor = {255,0,0}
...
love.graphics.setColor(backGroundColor) -- the G is uppercase here, will set the color to white instead of red, with no error message
If this is a concern, I would add this at the beginning of your game:
There is a hacky workaround, that involves the difference between nothing and nil (it exists, but only in c), this is in fact used in 0.9.0 for setCanvas, but it's a bit weird that setColor() would not equal setColor(nil).
bartbes wrote:There is a hacky workaround, that involves the difference between nothing and nil (it exists, but only in c), this is in fact used in 0.9.0 for setCanvas, but it's a bit weird that setColor() would not equal setColor(nil).
I don't actually like the setCanvas thing, it's inconsistent and annoying when you actually want to take advantage of passing a potentially nil value to setCanvas.
I vote for throwing errors on invalid data going through love's API functions. That sort of Mechanism Vs Policy design comes up here and having a consistency there is important.