Name That Nation
- 4 Devlogs
- 7 Total hours
Name That NATION game project: want to test people's ability of naming countries through a game!
Name That NATION game project: want to test people's ability of naming countries through a game!
Continued to work on the project!
Short Dev Log Today!
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 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.
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.
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!!!
Dev Log: Name That Nation Implementation of Core UI Panels (Start, Instructions, & Settings)
Overview:
Key Implementations:
StartPanelUser Onboarding: Added a JTextField for name entry along with strict data validation. If the field is empty or left as default, a warning message (noName JLabel) triggers in red text, blocking gameplay progression. Animated Background: Integrated a javax.swing.Timer alongside a modified paintComponent method to alternate every 0.5 seconds between three unique world images (World1.png to World3.png), creating a smooth looping animation of a rotating Earth.CardLayout Navigation: Configured centralized action listeners (buttons and exitListener) to pass state data to the parent container, cleanly swapping panels or closing the application altogether.
InstructionsPanelLayout & Scrolling: Used a BorderLayout to organize an informative overview of rules, score tallies, powerups, and level details.
Scroll Mechanics: Embedded a heavy block of instruction text into a non-editable JTextArea wrapped in a JScrollPane, forcing explicit vertical navigation while keeping horizontal scrolling locked.
Visual Assets: Overlaid a game preview snapshot (Game.png) on top of a custom backdrop image to give players context before starting.
Game Parameters: Combined a JScrollBar to control image scale thresholds, a JMenuBar with JMenuItem nodes for changing the match difficulty (Easy, Medium, Hard), and an array of JCheckBox fields representing all seven continents.
Challenges:
Absolute Layout Positioning: Managing explicit component bounds (setBounds) in the null-layout StartPanel requires highly specific coordinates that can scale poorly if window sizes are dramatically altered later.
Validation Multi-threading: Syncing state requirements—such as throwing warnings when fewer than 3 continents are selected or managing name checks—requires seamless communication between panel instances and the core Information holder class.
Next Steps:
Enforce Continent Validation: Active counters ensuring the validation warning dynamically locks or unlocks the “Back” button if the 3-continent minimum isn’t met.
Integrate Game Logic: Establish properties inside the GamePanel constructor that ingest the finalized values set by the sliders, checkboxes, and scrollbars from the configuration stage.
Working on a game to allow people to get better at identifying countries based on the shape (will have powerups, customized settings, etc.).
This project will be done in java through vscode!
Feel free to give any feedback or advice on what I should add to the game. I currently only have the JPanels working for the settings panel as well as the start panel with buttons.
Stay tuned for more updates!!!
Issues encountered and fixed: