Minigame Monday: Cryptic
Cryptic:
- The concept:
This time, I wanted to make a game that flexed my creative muscles a bit more, even if that meant having a slightly lower coding intensity. I decided to make a text-based puzzle adventure, where you have to type an answer to a situation, with clues contained in the text, and also in simple pictures. As well as each individual prompt having a solution, I wanted it so that the final question (minor spoilers I guess :P) involved all of the previous parts, so required a bit of memory, or noticing the connection as you went along.
- The challenge:
Coding wise, this wasn't too complicated, but that doesn't mean there weren't chances to be efficient. I did this by seperating the game into two python files, a framework and a level manager. That way, the framework could handle input and drawing the screen, while the bulky text was seperated in a different class.
One issue I did encounter was that of word-wrap, so long strings of text would move onto the next line rather than run off the edge. Pygame doesn't have a native way of doing this contained within it, however I found a function at https://www.pygame.org/wiki/TextWrap that solved the immidiate issue. I did have to adapt this code; it doesn't handle newline '\n' characters, so I added to the function to cut these characters out and move to a new line, allowing me to have returns in the text.
- The result:
Comments
Post a Comment