Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mbn-code/bitwars
Bitwars - Cpp raylib project
https://github.com/mbn-code/bitwars
arm64 cpp17 game game-deve gui-application macos make makefile modern-cpp raylib raylib-c raylib-cpp raylib-game wargame windows windows-10
Last synced: 12 days ago
JSON representation
Bitwars - Cpp raylib project
- Host: GitHub
- URL: https://github.com/mbn-code/bitwars
- Owner: mbn-code
- Created: 2024-10-06T02:12:36.000Z (30 days ago)
- Default Branch: main
- Last Pushed: 2024-10-21T20:10:38.000Z (14 days ago)
- Last Synced: 2024-10-22T14:17:39.023Z (13 days ago)
- Topics: arm64, cpp17, game, game-deve, gui-application, macos, make, makefile, modern-cpp, raylib, raylib-c, raylib-cpp, raylib-game, wargame, windows, windows-10
- Language: C
- Homepage: https://mbn-code.dk
- Size: 42.5 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# âī¸ Bitwars - War Simulation Game
**Bitwars** is a simple war simulation game developed using C++ and the **Raylib** graphics library. In this game, players engage in combat by spawning units and managing a base, trying to outlast the opposing NPC forces. The game includes mechanics like combat handling, points accumulation, and a high score system.
---
## đī¸ Project Structure
The project is organized into several directories and files, each serving a specific purpose. Here's a brief overview:
### đ Directories
- **`.vscode/`**: Contains Visual Studio Code configuration files.
- `c_cpp_properties.json`, `launch.json`, `settings.json`, `tasks.json`: Configuration files for setting up the C++ environment and build tasks.- **`assets/`**: Contains game assets such as images and sounds.
- `generated/`: Holds dynamically generated assets.
- `main.py`: Script for asset generation.- **`bin/`**: Contains the compiled binaries for the game.
- `Bitwars/`, `Bitwars.exe`: The game executable files.- **`includes/`**: Contains header files for various game components.
- `GameDataStructures.hpp`: Defines the data structures used in the game.
- `HandleCombat.hpp`: Header for combat-related functionality.
- `PointMultiplier.hpp`: Header for point multiplier logic.- **`lib/`**: External libraries and headers used by the game.
- `GLFW/`: GLFW library files.
- `libraylib.a`: Static Raylib library.
- `raylib.h`, `raymath.h`: Raylib header files.
- `windows/`: Windows-specific Raylib files.- **`src/`**: Contains source code files.
- `main.cpp`: Main game loop and logic.
- `main.hpp`: Header for the main source file.### đ Key Files
- **`makefile`**: Defines how the project is built. Supports building for macOS and Windows.
- **`README.md`**: The main documentation for the project.
- **`.gitignore`**: Specifies files and directories to be ignored by Git (e.g., build artifacts).---
## âī¸ Building the Project
### macOS
To build the game on macOS, run:
```bash
make PLATFORM=macos
```### Windows
To build the game on Windows, run:
```bash
make PLATFORM=windows
```---
## đšī¸ Running the Game
Once the project is built, you can run the game using the compiled executable.
### macOS Run
```bash
./Bitwars
```### Windows Run
```bash
Bitwars.exe
```---
## đŽ Game Mechanics
### đ Bases
- **Player and NPC Bases**: Each side (player and NPC) has a base represented by the `Base` struct.
- **Attributes**:
- `health`: Represents the base's health.
- `points`: Accumulated points based on game progress.### đĨ Units
- **Spawning**: Both the player and NPC can spawn units to attack the opposing base.
- **Control**: Units are controlled by both the player and NPC.
- **Combat**: Units engage in combat automatically when they collide with enemy units.### âī¸ Combat
- **Handling**: Combat is managed by the `HandleCombat` class, which handles logic for units fighting each other.
- **Points System**: Points are awarded based on unit health and combat outcomes.### đ High Scores
- **Handling**: Managed by the `HandleHighScore` class.
- **Storage**: High scores are stored and retrieved to track the player's best performance.### đĸ Point Multiplier
- **Mechanics**: The `PointMultiplier` class manages conditions for increasing the player's points under certain conditions, adding a strategic layer to gameplay.
---
## đ¤ Contributing
Contributions are welcome! Please follow the standard [GitHub flow](https://guides.github.com/introduction/flow/) when contributing:
1. **Fork** the repository.
2. **Create** a new branch for your feature or bugfix.
3. **Commit** your changes and **push** them to your fork.
4. **Submit** a pull request and provide a clear description of the changes.