Search found 509 matches
- Sat Oct 21, 2023 4:07 pm
- Forum: Libraries and Tools
- Topic: Simple button library help
- Replies: 3
- Views: 27569
Re: Simple button library help
I bet it doesn't, this is not Javascript. Please refer to the wiki and mousepressed events.
- Wed Oct 18, 2023 10:58 pm
- Forum: Support and Development
- Topic: Table insert name
- Replies: 7
- Views: 8025
Re: Table insert name
This is basic Lua. Did you search before posting? basic="search" tutorials={} tutorials[basic]=1 print (tutorials.search) Doesn't seem to quite work When i try to print,it give me an error(nil value)like it actually don't put any value in the table It prints 1 correctly. Check your setup.
- Wed Oct 18, 2023 5:41 pm
- Forum: Support and Development
- Topic: Table insert name
- Replies: 7
- Views: 8025
Re: Table insert name
This is basic Lua. Did you search before posting?
Code: Select all
basic="search"
tutorials={}
tutorials[basic]=1
print (tutorials.search)
- Tue Oct 10, 2023 10:23 am
- Forum: Support and Development
- Topic: Optimal way to track mouse-hover/touch over a tile position ?
- Replies: 10
- Views: 12427
Re: Optimal way to track mouse-hover/touch over a tile position ?
I still beg to differ and call it a microoptimization. Sorry, not into spanking.BrotSagtMist wrote: ↑Tue Oct 10, 2023 12:11 am I does not depend.
Its two lines for less cpu usage. That is ALWAYS a profit.
Not adding it if you can is a harmful mindset.
You should be spanked.
- Mon Oct 09, 2023 1:20 pm
- Forum: Support and Development
- Topic: Optimal way to track mouse-hover/touch over a tile position ?
- Replies: 10
- Views: 12427
Re: Optimal way to track mouse-hover/touch over a tile position ?
Whaaat? How can you be so wasteful when the fix to pull it to almost zero cpu is just adding two lines? It depends on what's going on in the background. If zero to nothing, it does not matter. If nothing to something and it's not CPU intensive, it does not matter. Etc. until you actually hit some p...
- Sun Oct 08, 2023 11:28 am
- Forum: Support and Development
- Topic: Optimal way to track mouse-hover/touch over a tile position ?
- Replies: 10
- Views: 12427
Re: Optimal way to track mouse-hover/touch over a tile position ?
That sounds like microoptimization to me. This basic hover check is not CPU intensive at all.BrotSagtMist wrote: ↑Sat Oct 07, 2023 2:59 pm ^
Yea the check itself is fine.
But you can optimize how often it runs. Eg check if the mouse has actually moved before.
- Sun Oct 08, 2023 7:57 am
- Forum: Support and Development
- Topic: I have a question about how lua works in general
- Replies: 8
- Views: 7337
- Sat Oct 07, 2023 7:08 pm
- Forum: Support and Development
- Topic: I have a question about how lua works in general
- Replies: 8
- Views: 7337
Re: I have a question about how lua works in general
And your question is?
- Tue Oct 03, 2023 3:14 pm
- Forum: Support and Development
- Topic: I'm making progress with my coin collection system, but I have a problem with destroying coins
- Replies: 9
- Views: 8445
Re: I'm making progress with my coin collection system, but I have a problem with destroying coins
Yep, the generation is fine.
- Mon Oct 02, 2023 10:07 pm
- Forum: Support and Development
- Topic: I'm making progress with my coin collection system, but I have a problem with destroying coins
- Replies: 9
- Views: 8445
Re: I'm making progress with my coin collection system, but I have a problem with destroying coins
Your issue was that you were looping over `coin` using `for` and `#coin` length. But with gaps, your table could contain index 7, but the length would be e.g. just 5. So you would never come to coin index 7. I recommend using pairs to iterate. You former buggy code (main.lua, line 73): for i = 1, #c...