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.
The project is organized into several directories and files, each serving a specific purpose. Here's a brief overview:
-
.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.
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).
To build the game on macOS, run:
make PLATFORM=macos
To build the game on Windows, run:
make PLATFORM=windows
Once the project is built, you can run the game using the compiled executable.
./Bitwars
Bitwars.exe
- 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.
- 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.
- 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.
- Handling: Managed by the
HandleHighScore
class. - Storage: High scores are stored and retrieved to track the player's best performance.
- Mechanics: The
PointMultiplier
class manages conditions for increasing the player's points under certain conditions, adding a strategic layer to gameplay.
Contributions are welcome! Please follow the standard GitHub flow when contributing:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Commit your changes and push them to your fork.
- Submit a pull request and provide a clear description of the changes.