Re:How to make a game from scratch using Lua and Löve
by snarfy on Sunday February 18, 2018 @06:47AM
(#16405603)
They don't have to, since Lua tables are hash sets and you can use anything as a key. You can start them at 0 if you want. table[0] = "foo" is valid and works. The downside is you have to add '-1' in a few places, but it's not as many as you'd think. All of my Lua code uses zero based arrays. I think the only place I had to add -1 was initializing numeric for loops.
[ Parent
| on HN ]
There are no comments on this comment yet.