A dodgeball game based entirely on Swing and custom custom Java classes. Designed on a Windows computer, but interoperability is half the point of Java anyways. Uses a host-client network because I'm not paying to run a server for a game nobody will play.
Before you play, make sure you have installed the JDK onto your computer. The JDK can be downloaded here; make sure you have installed JDK 22 or later before proceeding.
You will also have to download this folder.
In order to play dodgeball, one person must start a server. Make sure you have downloaded and unzipped the java-dodgeball
folder before doing this.
When it's downloaded, open a new terminal window in the folder. (🪟 🍎 🐧) and paste the following command:
java -jar "Host Dodgeball.jar"
(If you're on Windows, you can also double-click "Host Dodgeball - Windows.bat".)
Your host name will pop up on your screen, and you should be good to go. Don't forget to join the server!
Once someone's started a server, everyone else can join! Each player should download the java-dodgeball
folder and store it in a safe location.
When it's downloaded, open a new terminal window in the folder (🪟 🍎 🐧) and paste the following command:
java -jar "Play Dodgeball.jar"
(If you're on Windows, you can also double-click "Play Dodgeball - Windows.bat".)
Enter the host name, and you should join shortly!
- WASD to move
- Mouse to look
- Left click to throw
- Hold C to catch
- ALT+F4 to quit (sorry)
Anyone who is hit by a dodgeball will be kicked from the game - unless they catch it, in which case the thrower will be kicked instead.
Beyond that, the rules are up to you!
- Infinite respawns. Feel free to join back in whenever you get out.
- No spawn camping. It's not hard to figure out where everyone's spawning. It's also not hard to ruin the game given that information.
- Winner: None. Play to your heart's content!
- No respawns. When you're out, you're out.
- Grace period. No throwing for a set time after the game starts - use this time to run away!
- Winner: Last one standing
- Fixed respawns. Everyone gets to respawn a couple times - but once you're done, that's it.
- Grace period. No throwing dodgeballs at people who just spawned in. That's just human decency, yall.
- Winner: Last one standing
Whenever you're done with the game, the host should focus back into their terminal window and hit CTRL+C. Not vital, but it'll save some battery.