Welcome to Pirate Game, a thrilling platformer game built entirely in Java, with no external libraries! In this exciting adventure, you'll take on the role of a brave pirate, navigating through five challenging levels filled with enemies, obstacles, and hidden treasures.
! Find the code in `master` branch

- Use A to move left and D to move right.
- Press SPACE to jump over gaps and obstacles.
- Use X to perform a regular attack against enemies.
- Unleash the powerful Z attack to defeat stronger foes.
- BufferedImage: Used for handling images and sprites, creating visual elements for characters, enemies, and backgrounds.
- Clip: Utilized for handling sound effects and background music, enhancing the gaming experience.
- FloatControls: Implemented to adjust the volume of the sound effects and music in the game.
- The game features five challenging levels, each with its unique design, enemies, and obstacles.
- The gameplay revolves around a game loop, ensuring smooth rendering, updating, and input handling during runtime.
- Collision detection is implemented to manage interactions between the player, enemies, and the environment, allowing for dynamic gameplay.
The game is built using object-oriented principles, with the following class hierarchy:
-
Entity: Serves as the base class for all characters in the game, including the player and enemies.
- Player: Represents the player-controlled pirate character, inheriting from
Entity
. - Enemy: Represents various enemy types, inheriting from
Entity
.- Crabby: Represents the
Enemy
crab. Other enemy types can also be added in a similar manner.
- Crabby: Represents the
- Player: Represents the player-controlled pirate character, inheriting from
-
AudioPlayer: Handles audio and sound effects in the game.
-
State: Represents different states of the game.
- Menu: Manages the main menu of the game.
- Playing: Controls the gameplay state.
- GameOptions: Allows the player to customize game settings.
-
Objects: Represents various objects and entities present in the game world.
- Cannon: Represents a cannon that the player can interact with.
- GameContainer: Represents a container with hidden treasures or power-ups.
- Potion: Represents a health potion that the player can collect to restore health.
- Spikes: Represents dangerous spikes that the player needs to avoid.
- Animations are used to bring characters and objects to life, creating a more immersive experience.
- Characters have animations for walking, jumping, attacking, and taking damage.
Feel free to explore the repository, analyze the code, and use it as a foundation to build your own games or simply play the Pirate Game. The code is designed to be beginner-friendly while demonstrating essential Java concepts, making it a great learning resource for aspiring game developers.
Get ready for an adventure of a lifetime. Set sail, fight enemies, and uncover hidden treasures in Pirate Game! Enjoy the journey and may the wind be in your favor!