The difference is that RECT is 4 points with single-precision floating point values. That's a number stored in 32-bits. RECTd, however, is 4 points with double-precision floating point values. That's a number stored in 64-bits. This gives you more accuracy. You'll rarely need this, though.Oddwrath wrote:In LunaLua, what is the difference between RECT and RECTd? And which one would be the TriggerZone of LunaLua?
I don't think LunaLua has the "TriggerZone" function built in, so neither is the answer to that. What you can do instead is simply check the player's coordinates when looping. This way you can use either, or even your own values. Something like this will work:
Code: Select all
function onLoop()
if(player.x > leftside and player.y > topside and player.x < rightside and player.y < bottomside) then
--do things
end
end