This has more to do with the arguments love.draw accepts, than what an underscore is. As per
löve wiki, the third argument is rotation, fed by radians. If the third argument is any non-zero number value, the drawn image will be rotated.
In lua, it's a convention to use a single underscore as a shorthand for an "unneeded" value. For example, in a pairs loop you may not be interested in the 'key'.
Code: Select all
-- code assumes that myTable contains other tables, and we're doing something with those
-- as such, the "key" that pairs() usually returns is not needed, hence the _
for _, value in pairs (myTable) do
value.someValue = value.someValue + 1
end
As such, an underscore is basically a normal variable - that us lua programmers tend to use for throwaway values returned by functions or other things. The underscore will still (probably) have some value assigned to it, but you're meant to reason that it's not going to be used later in the same code block, if you follow the convention.
In your case, it seems the underscore in your code happens to contain a numeric non-zero value, which happens to rotate the image as shown. This could be because you're using it within a loop in similar fashion to the example code I wrote above, or maybe you've accidentally created a global variable. Check where you might have assigned a value to an underscore, and see if that's causing the behavior you're experiencing.