Has Anyone Made a Crossword Puzzle?

Started by Ghostlady, Sat 14/09/2024 02:35:57

Previous topic - Next topic

Ghostlady

Has anyone coded a Crossword Puzzle in their game? The player would be inputing letters on a crossword puzzle grid.
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Eon_Star

Hi.

You have an interesting topic there. If you have something special in your mind, I suggest you give details.

I would think of, say pre-cut letter blocks (objects) where the player must put the right letter blocks in to the grid  to find the right message, maybe on a board.

Else you may tell us what you have in mind.

You can check my tutorial videos on the subject:

https://www.youtube.com/watch?v=EQyfQ7BOeU8

Happy day/ night to you.

Crimson Wizard

#2
Like with any complex problem, it's essential to divide it in smaller subtasks, decide how do you want to design each of them. Then find which parts you already know how to do, and which not.

Crossword requires following:

1. Describe the crossword in script data, and a way to configure it, either in script, or reading from a file, etc.
Crossword consists of:
 - cells to enter words (you need to define its geometry)
 - solution (a list of correct words per each position)
these are separate data, because same placeholder may be used for different words.

2. Describe the crossword state, where some words are inserted in particular places, regardless whether correctly or not.

3. Present the crossword state on screen. There is a multitude of options here. Personally I'd recommend DynamicSprite drawn using DrawingSurface, as its a single universal object, which may combine graphics and letters, and you may place it anywhere (room background, GUI, etc).

4. Handle player's input, at the start decide how the puzzle is controlled, is it by clicking on crossword, or typing words in certain sequence, and so forth.

5. Handle success detection, matching crossword's state (created by player) with the solution.

Snarky

#3
Has someone done it? I don't know.
Could someone do it? Sure.

Are you looking for advice on how to do it? Then please ask what you want to ask.

One way might be to store the target crossword solution as an array of Strings. (So if the grid is 20x20, it's an array of 20 Strings, each String 20 characters long, using e.g. '_' for blacked-out blocks.) The benefit of this is that it's easy to edit in a text editor and then import into AGS. You could also store the player's proposed solution (i.e. the current state of the crossword) in a similar array of Strings, or alternatively an array of chars. A char array might be easier to work with since the state needs to change a lot, letter by individual letter.

To draw the crossword I would recommend just rawdrawing it (using DrawingSurface functions), since drawing and interacting with a regular grid is trivial. I think this will be more straightforward than using Objects, GUI elements or some other existing elements. For the input you could use a TextBox that you reposition to each square as it gets focus, but you'll have to decide just how the interaction should work (how to navigate to different parts of the grid, what happens after you've entered one letter, etc.).

You would also have to decide how the puzzle solving should be done. One easy way would be to keep count of how many squares are filled in, and when the whole puzzle is filled in compare the answer to the solution, character by character, to check that they are identical. If you wanted to give players feedback along the way (for example a confirmation for each word correctly filled in) that would be a little more work.

Edit: This proposal doesn't consider the clues. Here it depends a bit on what style of crossword you want. I'm assuming it's the "proper" kind where some squares in the grid are numbered, with a corresponding numbered list of clues outside of the grid itself. In that case, I'd simply keep a separate list of clues (possibly two lists, one for horizontal and one for vertical words), with a set of coordinates into the grid for each clue corresponding to the square that should be numbered.

Ghostlady

Hi guys, thanks for the responses.  I'll have to come back to this at a later date.  I had a bunch of work that came in that I need to work on. :)
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

heltenjon

Possibly half-relevant to the question: Elen Heart @elentgirl made a mathematical crossword puzzle in The Garden of Hades She used playing cards that the player had to give the correct value in order to make the correct answers downwards and across. I guess it would be possible to use the same approach to the alphabet instead of numbers. There are probably let's play videos of the game online, if you are interested.

gaminghubpro

Yes, I have but; i can't share right now.

SMF spam blocked by CleanTalk