Hey everyone! It’s been a massive day of coding on NameThatNation. If you’ve been following along, you know the goal: a game where you look at maps/images and guess the country before the timer runs out.
Today, I wired up the core skeleton for the Settings Panel, Country Info Panel, and initialized the beast that is the Game Panel.
Here is exactly what went down today:
- The Settings Panel: I wanted players to be able to customize their UI, but things got a little chaotic in the grid layouts.
The RGB Sliders: Added JSlider controls for Red, Green, and Blue. Players can dynamically alter the theme color (info.setColor).
The Continents Customization: Implemented checkboxes for all 7 continents. But I had to add a hard rule in the ButtonListener: You must choose at least 3 continents before you can leave. Why? Because guessing between just the USA and Canada is too easy everyone is going to get it right…
Image Size Scrollbar: Added a JScrollBar allowing players to scale the image sizes. Scroll down or up.
Difficulty JMenu: A nice dropdown menu (Font.BOLD, 30) to swap between Easy, Medium, and Hard.
Current Visual Bug: The continent checkboxes currently text-render in a terrifying new Color(183, 9, 9) (deep blood red) alongside a red warning label.
- The Country Info Panel:
Players need a place to study up, so I built the CountryInfoPanel. It utilizes a try-catch block inside a custom fileIn() method to read a massive text file: countriesContinentHard.txt.
It dumps all that text into a non-editable, word-wrapping JTextArea wrapped in a JScrollPane so you can scroll through hundreds of countries.
The Aesthetic: On the left side, it renders a nice big sprite of planet Earth (Earth.png), while the data scrolls smoothly on the right.
- The Game Panel (The Brain of the Operation)
Finally, I started prototyping the actual gameplay panel. It’s not fully rendered yet, but the logic infrastructure is going to be a lot!
I will continue to work on this panel this week and make sure to follow along the game making!!!
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.