pgimeno wrote: ↑Fri May 20, 2022 1:04 am
It's crashing because `pointer` (as a gui element) lacks w and h.
Well that's embarrassing. Thanks for catching that! I guess I never actually clicked on it myself. Fixed! Updated version is in OP and also linked here: download/file.php?id=21119
Touch (AKA click) doesn't seem to work right now, as tested on my Android. I don't anticipate having time to investigate that for a while, though.
EDIT - I forgot to ask, for pgimeno & anyone else who has looked at the code, what are your thoughts about the organization & style? I tried a different approach with this project. It's a more callback-centric layout and it's forced me to be more careful with scope & globals.
Last edited by milon on Tue May 24, 2022 2:22 pm, edited 2 times in total.
Any code samples/ideas by me should be considered Public Domain (no attribution needed) license unless otherwise stated.
pgimeno wrote: ↑Fri May 20, 2022 11:13 pm
I don't usually give style advice. I would do some things differently, but that does not mean better.
Since you mention globals, though, I found a global that seems to be global by mistake, namely `offset` in function guesses.redraw().
Thanks for catching that global. Definitely a mistake - copypasta from other functions where 'offset' was a given argument. But I'm working on phasing that out anyway.
About coding style - I'm not too concerned about 'different' (I agree - different is typically fine), but if you see potential problems or a more robust way to code things, I'm all ears. I'll also admit to being curious about how others would do things differently in the big picture, but I'm not planning on changing that for this project.
Side note: I tweaked the game_state logic so object.w/h aren't needed for objects that don't define click() etc. I'll post a new .love when I have a more to show. Probably not soon.
Any code samples/ideas by me should be considered Public Domain (no attribution needed) license unless otherwise stated.
Changes include:
- proper touch support
- on mobile, it automatically chooses fullscreen portrait
- background music (undecided if placeholder or final; open to suggestions)
- a few tweaked visuals
Here's how it looks now (updated in OP too):
I've also begun tinkering with sound effects, but those aren't in this version.
In short: "Mastermind"-like but with English words.
Grey means letter not present, yellow means letter present but in the incorrect position, and green means letter in the correct position. The guesses must be valid English 5-letter words, you can't try just any combo. In the last screenshot, the hidden word has an I in the centre, plus an N and an R. The R does not go in the centre (obvious anyway, because it's an I) and the N does not go in the last place. The hidden word may contain more I's, N's and R's.