Skip to content

Commit

Permalink
Add licence, update readme (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
bilalkah authored Dec 19, 2024
1 parent 28e468b commit 9566d25
Show file tree
Hide file tree
Showing 10 changed files with 164 additions and 25 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Bilal Kahraman

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
146 changes: 135 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,138 @@
# Project-Wolfenstein
# Wolfenstein Project

## Views from the game
Welcome to the Wolfenstein project! This README provides an overview of the game's features, setup instructions, and how to contribute to the development. Dive into a dynamic and immersive world built using **C++** and **SDL**, where you'll experience real-time combat and a rich environment.

![](images/screenshot1.png)
![](images/screenshot2.png)
![](images/screenshot3.png)
![](images/minimap.png)
## View from the game

<p float="left">
<img src="images/game_view_with_mp5.png" width="400" />
<img src="images/game_view_with_shotgun.png" width="400" />
</p>

---

## Features

### Core Gameplay
- **Dynamic Combat**: Engage in fast-paced action using a variety of weapons.
- **Pathfinding with A***: Enemies dynamically navigate the environment using the A* algorithm.
- **Player Interactions**: Smooth controls for movement and combat.

### Environment
- **Static Maps with Dynamic Elements**: Navigate a static map populated with dynamic objects and enemies.

### Enemy Behavior
- **State Design Pattern**: Enemies utilize a flexible state system with the following behaviors:
- Idle
- Walk
- Attack
- Pain
- Death

### Weapons
- **State Design Pattern**: Weapons use states for the following functionalities:
- Loaded
- OutOfAmmo
- Reloading
- **Synchronized Execution**: All weapon and enemy animations are synchronized with the main game clock to maintain fluid gameplay.

---

## Technical Highlights

- **Pathfinding and Navigation**: A* algorithm is used for efficient enemy movement and navigation. For more details on the implementation, see my [path-planning](https://github.com/bilalkah/path-planning) project.
- **Ray Casting with DDA**: The Digital Differential Analyzer (DDA) algorithm is used for efficient ray casting, creating realistic field of view.
- **Templates and Type Traits**: Advanced template programming ensures modular and reusable code.
- **Instant State Transitions**: Transitions between states happen instantly, ensuring smooth gameplay.

---

## Setup Instructions

### Prerequisites
1. **C++ Compiler**: Ensure you have a modern C++ compiler (C++17 or higher).
2. **SDL Library**: Install SDL for rendering, sound, and input handling.

### Build Instructions
1. Clone the repository:
```bash
git clone https://github.com/bilalkah/wolfenstein --recurse-submodules
cd wolfenstein
```
2. Install dependencies:
```bash
./scripts/install_deps.sh
```
3. Build the project using `cmake` or your preferred build system:
```bash
./scripts/compile.sh # or you can your own way to build
```
4. Run the executable:
```bash
./build/bin/wolfenstein
```

---

## How to Play

- **Movement**: Use `W`, `A`, `S`, `D` to move around.
- **Attack**: Use `Left Click` to attack enemies.
- **Select Weapon**: Use `Left Arrow`, `Right Arrow`, and `Space` to navigate and select your weapon.

---

## Contribution Guidelines

We welcome contributions! Here are a few ways you can help:

1. **Report Bugs**: Submit issues on the GitHub repository.
2. **Suggest Features**: Share your ideas to improve gameplay.
3. **Write Code**: Fork the repository and submit a pull request with your improvements.

### Development Workflow
1. Create a new branch for your feature:
```bash
git checkout -b feature-name
```
2. Commit your changes:
```bash
git commit -m "Description of changes"
```
3. Push the branch and open a pull request:
```bash
git push origin feature-name
```

---

## Troubleshooting

### Common Issues
1. **Performance drops**:
- Use caching mechanism to prevent extensively running pathfinding algorithm.
- Optimize pathfinding algorithms to enemies do not block each other.
2. **Better to have**:
- Collision check with static and dynamic objects
---

## Future Plans

- Expand maps and introduce new enemy types.

---

## License

This project is open-source and available under the MIT License. See the `LICENSE` file for details.

---

## Contact

For questions or feedback, reach out at:
- Email: [email protected]
- GitHub: [bilalkah](https://github.com/bilalkah)

Enjoy the game and happy coding!

## Install dependencies and build
```batch
./scripts/install_deps.sh
./scripts/compile.sh
```
2 changes: 1 addition & 1 deletion app/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
add_executable(${EXECUTABLE} main.cpp)
target_compile_definitions(${EXECUTABLE} PRIVATE DEBUG=1)
target_compile_definitions(${EXECUTABLE} PRIVATE DEBUG=0)
target_link_libraries(
${EXECUTABLE}
game
Expand Down
2 changes: 1 addition & 1 deletion app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

int main() {
using namespace wolfenstein;
GeneralConfig config(800, 600, 0, 20, 120, 15.0, ToRadians(60.0), false);
GeneralConfig config(1200, 900, 0, 20, 120, 15.0, ToRadians(60.0), false);

Game game(config);
game.Run();
Expand Down
3 changes: 3 additions & 0 deletions images/game_view_with_mp5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions images/game_view_with_shotgun.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions images/minimap.png

This file was deleted.

3 changes: 0 additions & 3 deletions images/screenshot1.png

This file was deleted.

3 changes: 0 additions & 3 deletions images/screenshot2.png

This file was deleted.

3 changes: 0 additions & 3 deletions images/screenshot3.png

This file was deleted.

0 comments on commit 9566d25

Please sign in to comment.