Search found 3556 matches
- Mon Jan 01, 2024 3:13 pm
- Forum: General
- Topic: [Just for fun] Roast my code.
- Replies: 14
- Views: 259194
Re: [Just for fun] Roast my code.
I did this myself at one point - for some unknown reason, I have one module that uses a local variable named, and a global for the rest of the program also called mouse. For a while it wasn't an issue, but when I eventually wanted to make use of the functionality of the global version, I found that...
- Sun Dec 31, 2023 12:41 pm
- Forum: General
- Topic: New User / Game Idea Help
- Replies: 5
- Views: 26130
Re: New User / Game Idea Help
I don't know that particular game, but I've played quite a few text adventure games, and even used a text adventure writing system called The Quill for ZX Spectrum and another called DAAD for PC. Most text adventures in that time were based on one- or two-word sentences: INVENTORY, TAKE GEM, OPEN CH...
- Sun Dec 31, 2023 12:14 pm
- Forum: General
- Topic: [Just for fun] Roast my code.
- Replies: 14
- Views: 259194
Re: [Just for fun] Roast my code.
Globals have two big pitfalls. First, they are prone to bugs. Consider this situation (very simplified, but hopefully you'll understand how it generalizes): function swap_a_and_b() tmp = a a = b b = tmp end a = 7 b = 8 tmp = 9 swap_a_and_b() print(tmp) You typically expect tmp to still be 9, but bei...
- Tue Dec 26, 2023 2:59 pm
- Forum: General
- Topic: I used ChatGPT
- Replies: 16
- Views: 229731
Re: I used ChatGPT
It appears that I'm smarter than ChatGPT. lol Surprised? You shouldn't ;) The formulas answered for one of the questions make no sense whatsoever (the ones "based on the ratio of the longer and shorter axes"). The answer you need is: local speed = 1 -- in pixels per second local dt = 1/60...
- Mon Dec 25, 2023 12:53 pm
- Forum: General
- Topic: I Imagine A Color Picker Has Been Done A Thousand Times
- Replies: 5
- Views: 22065
Re: I Imagine A Color Picker Has Been Done A Thousand Times
I'm not sure which method is best suited for a more complex game. Interested in hearing others' opinions on this. If you don't care missing presses or releases within a single frame, then you're good using isScancodeDown (generally speaking, always avoid isDown, for the benefit of non-QWERTY keyboa...
- Fri Dec 15, 2023 11:18 pm
- Forum: Support and Development
- Topic: Black screen
- Replies: 11
- Views: 39111
Re: Black screen
Maybe you wanted to use love.graphics.setBackgroundColor instead?
- Mon Dec 11, 2023 12:12 pm
- Forum: Support and Development
- Topic: Justified text displaying one character at a time
- Replies: 13
- Views: 65551
Re: Justified text displaying one character at a time
Just use left-alignment instead of justification. Even if it worked as you expect, it would have to justify the whole line every time one is completed, and if you're still reading that, it's uncomfortable. If you absolutely want to try it, you can try printing all lines except the last one justified...
- Mon Dec 04, 2023 11:10 pm
- Forum: Support and Development
- Topic: [SOLVED] Scaling and camera issues :'D [im probably very stoopid]
- Replies: 5
- Views: 20320
Re: Scaling and camera issues :'D [im probably very stoopid]
I think you have made a mess of coordinate systems. According to the code, self.x and self.y are in screen coordinates, while it appears that Camera:setPosition(x, y) expects world coordinates. Your coordinate transformation formulas are messed up. My recommendation is that you use a camera library ...
- Thu Nov 30, 2023 5:45 pm
- Forum: General
- Topic: Collision not being registered
- Replies: 10
- Views: 29419
Re: Collision not being registered
Without having looked much, this looks like the typical case of deleting elements from a table that is being iterated. At least the first loop looks like that. When you're removing an element from a table, all elements after it are renumbered. If you're deleting element 4 in a table of 6 elements, t...
- Sat Nov 25, 2023 5:20 pm
- Forum: General
- Topic: What makes a good level?
- Replies: 6
- Views: 34115
Re: What makes a good level?
Or you can add some new mechanics to it - like mari0 by Stabyourself.