Skip to content

Latest commit

 

History

27 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java RPG Adventure 🎮☕️

Menu Screen Gameplay
Menu Screen Gameplay

📌 Table of Contents

🌐 Overview

Java RPG Adventure is a 2D top-down RPG built from scratch in Java, using only the standard Java libraries.

This project is primarily a learning project. Its main goal is to strengthen my Java knowledge while learning the fundamentals of game development: game loops, rendering, input handling, collision detection, tile-based worlds, and game states. All implemented manually, without relying on abstractions provided by an engine.

The project is being developed incrementally, starting from core systems and gradually expanding into a complete RPG.

🎯 About the Project

I am developing this project to:

  • Improve my Java programming skills through a larger, practical project.
  • Better understand object-oriented programming and software architecture.
  • Learn how game loops, rendering, input handling, collision detection, and game states work.
  • Explore the fundamentals of 2D game development.
  • Practice building systems from scratch using Java's standard libraries.
  • Gradually experiment with and implement my own ideas and mechanics.

Rather than using a game engine to abstract away the underlying systems, I want to understand what happens behind those abstractions and gain practical experience implementing game mechanics directly in Java.

⚙️ Current Features

  • 🪟 Game window and game loop
  • ⌨️ Keyboard input
  • 🚶 Player movement
  • 🖼️ Sprite rendering
  • 🧱 Tile-based world
  • 🎥 Camera system
  • 💥 Collision detection
  • 📦 Objects and object interaction
  • 🎵 Background music and sound effects
  • 🔄 Game states (title, play, pause, dialogue)
  • 🧾 Basic UI
  • 🗺️ World map loading from files

More systems and mechanics will be added as development continues.

💻 Technologies Used

  • Java
  • Java Swing — window, panels and rendering surface
  • Java AWT (Graphics2D, Rectangle, BufferedImage, KeyListener, etc.) — 2D rendering, input handling and geometry
  • Java ImageIO (javax.imageio.ImageIO) — loading sprites and tile images
  • Java Sound API (javax.sound.sampled) — background music and sound effects
  • Git

No game engine or external game development framework is used, everything is built with Java's standard libraries.

🗝️ Key Takeaways

  1. Practiced implementing a game loop from scratch using delta time.
  2. Learned how to structure a 2D game using object-oriented programming.
  3. Implemented tile-based world rendering and a camera system tied to the player.
  4. Studied collision detection between the player, tiles, and objects.
  5. Built a basic entity system shared between the player and NPCs.
  6. Implemented game state management (title, play, pause, dialogue).
  7. Learned how to handle keyboard input in Swing applications.
  8. Practiced loading world/map data from external files.
  9. Explored audio playback (music and sound effects) in Java.
  10. Strengthened my understanding of software architecture in a non-trivial project.

🚀 How to Run the Project

✅ Requirements

  • Java JRE/JDK 8 or higher installed

▶️ Option 1: Download the Ready-to-Play Build

The easiest way to try the game is to download the compiled .jar file from the Releases page and run it with:

java -jar java-rpg-adventure.jar

🛠️ Option 2: Run from Source

  1. Clone the repository:
    git clone https://github.com/Cauebf/java-rpg-adventure.git
    cd java-rpg-adventure
  2. Compile the project (from the source folder):
    javac -d out src/main/*.java src/entity/*.java src/object/*.java src/tile/*.java
  3. Run the compiled game:
    java -cp out main.Main

💡 Tip: adjust the paths above to match your actual package/folder structure if it differs.

🎓 Inspiration & Credits

This project is heavily inspired by RyiSnow's excellent How to Make a 2D Game in Java YouTube series.

The series has been an important reference for learning how to structure a 2D game in Java and understanding concepts such as game loops, rendering, tiles, cameras, collision detection, objects, sound, UI, and game states.

🤝 Contributing

This is primarily a personal study project, but suggestions and feedback are welcome! If you find a bug, have an improvement idea, or want to suggest a new mechanic, feel free to:

  • Open an issue.
  • Submit a pull request.
  • Suggest improvements to existing systems.

When contributing, try to keep the code simple, readable, and aligned with the project's learning-focused nature.

💬 Contact

For inquiries or collaboration, reach out via:

Gmail LinkedIn Instagram GitHub

(back to top)

About

2D top-down RPG built in Java (Swing/AWT), created as a learning project to study core game dev mechanics without a game engine.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages