Skip to content

Notjef/game-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌍 Read this in other languages:

🎮 Game Engine Java

A Game Engine developed in pure Java, created as a portfolio project to demonstrate knowledge in game development, object-oriented programming, and software architecture.

📋 About the Project

This project implements a basic Game Engine in Java, following good development practices and software architecture patterns. The engine provides the fundamental components required for 2D game development, including:

  • Game Loop: Game loop system with FPS control
  • Entity System: Class hierarchy for players, NPCs, and objects
  • Graphics Engine: Components for rendering, camera, and textures
  • Input System: Keyboard and mouse management
  • Audio System: Sound and music management
  • Utilities: Mathematical tools and performance measurement

🚀 Technologies

  • Java 11+: Main project language
  • Maven: Dependency management and build tool
  • JUnit 4: Unit testing framework

📁 Project Structure

src/
├── main/
│   ├── java/
│   │   └── com/
│   │       └── meujogo/
│   │           ├── Main.java              # Main class
│   │           ├── core/                  # Engine core
│   │           │   ├── Game.java          # Game manager
│   │           │   └── GameLoop.java      # Main loop
│   │           ├── entities/              # Game entities
│   │           │   ├── Entity.java        # Base class
│   │           │   ├── Player.java        # Player
│   │           │   └── NPC.java           # NPCs
│   │           ├── graphics/              # Graphics system
│   │           │   ├── Renderer.java      # Renderer
│   │           │   ├── Camera.java        # Camera
│   │           │   └── Texture.java       # Textures
│   │           ├── input/                 # Input system
│   │           │   ├── KeyboardInput.java # Keyboard
│   │           │   └── MouseInput.java    # Mouse
│   │           ├── audio/                 # Audio system
│   │           │   └── AudioManager.java  # Manager
│   │           └── utils/                 # Utilities
│   │               ├── MathUtils.java     # Math
│   │               └── Timer.java         # Timer
│   └── resources/                         # Game resources
└── test/                                  # Unit tests
    └── java/

⚙️ Requirements

  • Java JDK 11 or higher
  • Maven 3.6 or higher

🔧 How to Run

1. Clone the repository

git clone https://github.com/Notjef/teste-game-java.git
cd teste-game-java

2. Compile the project

mvn clean compile

3. Run the game

mvn exec:java -Dexec.mainClass="com.meujogo.Main"

4. Create executable JAR

mvn clean package
java -jar target/teste-game-java-1.0-SNAPSHOT.jar

🧪 Run Tests

mvn test

📚 Architecture Documentation

Core

  • Game: Manages the game lifecycle
  • GameLoop: Implements the main loop with FPS control (60 FPS)

Entities

  • Entity: Abstract base class for all entities
  • Player: Represents the player with health and movement systems
  • NPC: Non-playable characters with basic AI and dialogues

Graphics

  • Renderer: Responsible for drawing elements on the screen
  • Camera: Controls the game world view
  • Texture: Manages textures and images

Input

  • KeyboardInput: Captures and processes keyboard input
  • MouseInput: Captures and processes mouse input

Audio

  • AudioManager: Manages music and sound effects

Utils

  • MathUtils: Useful mathematical functions (interpolation, distance, etc.)
  • Timer: Time measurement and FPS calculation

🎯 Implemented Features

  • ✅ Game Loop with FPS control
  • ✅ Entity system (Player, NPC)
  • ✅ Rendering structure
  • ✅ Camera system
  • ✅ Input management (keyboard and mouse)
  • ✅ Basic audio system
  • ✅ Mathematical utilities
  • ✅ Extensible and modular architecture

🔮 Next Steps

  • Implement real rendering with graphics libraries (LWJGL, JavaFX)
  • Add physics system
  • Implement collision system
  • Create tile/map system
  • Add animations
  • Implement particle system
  • Create example games using the engine

🤝 Contributing

Contributions are welcome! Feel free to:

  1. Fork the project
  2. Create a branch for your feature (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📝 License

This project is licensed under the Apache License 2.0 License. See the LICENSE file for more details.

👨‍💻 Author

Jeferson Rodrigo - GitHub


⭐ If this project helped you, consider giving it a star!

About

repositorio para portifolio

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published