I decided to take the game in a slightly different direction when I realized I had overlooked a major aspect: the actual narrative. What’s happening to the player, and why would they want to run around in the game to begin with?
My son had an excellent idea: seed the game with loose journal pages that the player could collect throughout the game. These pages would gradually introduce the player to some of the less obvious aspects of the game, while also building the story of why the player’s character is there in the first place. The journal pages could also serve to incrementally piece together the game’s overarching narrative—introducing bad guys, bosses, and maybe even some twists and turns along the way.
Pop-ups are a pretty standard component of video games, but, to be honest, I had never implemented one in Unity before. After some Googling, I figured out how to create the necessary panel game object to make the pop-up work. I added text and a button, then found some loose paper prefabs in a texture pack I grabbed from the Unity Asset Store. After attaching a collider and a simple script, voilà! I was in business.
Well... sort of.
The problem I encountered was that while the pop-up worked when the player triggered the collider, those pesky AI monsters would continue attacking, racking up Madness Points while the player was trying to read. That wouldn’t do!
A little more research revealed that my pop-up script needed a method to pause the game. I adjusted the script to stop game time while keeping the UI functional, so the player could still use the mouse to click the “OK” button and close the pop-up after reading it.
It took some tinkering and a bit of help from ChatGPT, but we finally got everything working. Here’s a screenshot of the first pop-up in action:
It’s not perfect yet, and I’ll probably tweak the settings in the inspector to clean it up a bit more, but it works! This will go a long way toward fleshing out the game and building a solid narrative.
Eventually, I plan to upload all the scripts for this game to GitHub and share the link here—just in case anyone out there might want to peek under the hood of this project. But that’s a task for another day!
No comments:
Post a Comment