I was away for some time again...
Thank you all to have given new advices meanwhile, I'm sure I'll find what I need there!
Search found 36 matches
- Thu Jul 22, 2021 9:03 pm
- Forum: Support and Development
- Topic: [Solved] Technique for different modes?
- Replies: 8
- Views: 7853
- Fri Jul 16, 2021 7:03 pm
- Forum: Support and Development
- Topic: [Solved] Technique for different modes?
- Replies: 8
- Views: 7853
Re: Technique for different modes?
My naive approach would be to handle it as a big conditional. Might be slow or clunky but it should work. I will probably go this way... Better keep things simple as it's still my first project, I guess... thanks! One more thing : I saw I could name these functions like "update.menu" and ...
- Fri Jul 16, 2021 5:49 pm
- Forum: Support and Development
- Topic: [Solved] Technique for different modes?
- Replies: 8
- Views: 7853
[Solved] Technique for different modes?
Hi! In a simple game I'm making, I wanted to have different modes : Main menu and battle (how unusual) To avoid having all the code at the same place, I would have wanted to have different callback functions for each mode, as in the following : For example, with files "main", "menu&qu...
- Mon May 10, 2021 1:54 pm
- Forum: Support and Development
- Topic: math.round() doesn't work
- Replies: 4
- Views: 6107
Re: math.round() doesn't work
Still new there, but I'll give a try...
From what I understood, there isn't "math.round" in Lua ; instead, we have math.floor and math.ceil (pretty much self-explanatory).
From what I understood, there isn't "math.round" in Lua ; instead, we have math.floor and math.ceil (pretty much self-explanatory).
- Tue May 04, 2021 6:25 pm
- Forum: Support and Development
- Topic: [Solved] "Unmodifiable" table gets wiped after using it
- Replies: 7
- Views: 6862
Re: "Unmodifiable" table gets wiped after using it
Searched a bit about it and found something better that works properly : function shuffle(tbl) for i = #tbl, 2, -1 do local j = math.random(i) tbl[i], tbl[j] = tbl[j], tbl[i] end return tbl end It simply shuffles the targetted table, good enough for me. Though thank you all for your answers! I didn'...
- Tue May 04, 2021 2:59 pm
- Forum: Support and Development
- Topic: [Solved] "Unmodifiable" table gets wiped after using it
- Replies: 7
- Views: 6862
[Solved] "Unmodifiable" table gets wiped after using it
My problem is about a small code I wrote to take a table, then copy its content in a randomized order into another table ({1,2,3,4} -> {3,2,4,1}) : I want to take the table "choices", shuffle it into "shuffled", then print both "choices" and "shuffled" content...