Skip to content

bugramatik/Maze-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maze Game - Pac-Man Style

This repository contains a Pac-Man style Maze game implemented using Java and object-oriented programming principles, including design patterns such as Strategy Pattern, Singleton Pattern, Observer Pattern, and Decorator Pattern. The game is a fun and engaging experience for users who enjoy solving puzzles and exploring mazes, featuring various actors such as the player, enemies, bullets, power-ups, and walls.

Maze Game Screenshot

Features

  • User-controlled player navigating the maze to collect all power-ups to win the game.
  • Enemies patrolling the maze, capable of killing the player upon collision.
  • Walls defining impassable locations on the game map.
  • Bullets created by the player to damage enemies upon collision.
  • Power-ups spread around the map for the player to collect.
  • Win condition: collect all power-ups; lose condition: killed by an enemy.
  • UML class diagram and Javadoc documentation provided.

Design Patterns and OOP Principles

The Maze Game is designed using various design patterns and OOP principles to ensure a clean, maintainable, and scalable codebase. Some of the key concepts used in the project are:

  1. Strategy Pattern: Used for implementing different enemy patrol strategies (horizontal, vertical, or stationary).
  2. Singleton Pattern: Applied to the GameDisplay class to provide a global access point for the display window.
  3. Observer Pattern: Implemented for handling collisions between actors, with the CollisionComponent class notifying ICollisionListener objects of collisions.
  4. Decorator Pattern: Used in the AbstractActor class, with IRealTimeComponent acting as the decorator.

Class Hierarchy

The provided class hierarchy consists of various classes and interfaces, including Main, GameDisplay, GameEngine, GameMapLoader, Position2D, AABB, AbstractActor, IRealTimeComponent, IDrawable, SpriteComponent, PlayerInputComponent, CollisionComponent, ICollisionListener, AbstractPatrolStrategy, and various game actors (Player, PowerUp, Bullet, Wall, Enemy). The hierarchy is extensible and modifiable to accommodate additional features and improvements.

Game Details

The game includes various actors with specific properties and functionalities:

  1. Enemy: Health: 100 units, Movement Speed: 120 pixels per second, Sprite Path: "./data/img/enemy.png".
  2. Player: Movement Speed: 110 pixels per second, Sprite Path: "./data/img/player.png".
  3. Wall: Sprite Path: "./data/img/wall.png".
  4. Bullet: Bullet Life: 0.7 seconds, Bullet Speed: 300 pixels per second, Sprite Path: "./data/img/bullet.png".
  5. Power-Up: Sprite Path: "./data/img/scroll.png".

UML Class Diagram

A UML class diagram is provided to document the code, showing important fields, methods, and relations between classes. The diagram should include composition, aggregation, dependency, and other relationships. StarUML is a recommended tool for creating the class diagram.

Build and Run

This project can be compiled and run via Intellij Idea's Java Compiler API. From Run/Edit Configurations/Program Arguments, path of map (data/map1.dat) can be given.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages