A first-person shooter prototype combining classic graphics with generative AI power.
Prompt Me Maybe is a retro-inspired ray-casting engine written in C, powered by MLX42. At its core, it recreates the charm of early FPS games — but with a twist: generative AI is used to produce game assets like weapons, textures, and more.
The result is a hybrid workflow: fast, real-time rendering meets creative iteration through AI prompts. This is not just a game demo — it’s a proof of concept for AI-assisted game development, and a game-changer for the future of gaming.
- 🎨 AI-Assisted Asset Creation: Weapons are now generated by open-ai prompt. In future, doors, wall textures, NPC designs or even game play will be produced using prompt-driven workflows — empowering rapid prototyping.
- Ray-Casting Rendering: Real-time 3D perspective rendering from a 2D grid map, mimicking early FPS engines.
- Minimap: A top-down live map showing player position and current rays.
- Floor & Ceiling Coloring: User-configurable RGB values in
.cubfiles for stylistic flexibility. - Dynamic Doors: Doors open and close when the player approaches, complete with animated transitions (also AI-generated).
- Interactive Sprites: Support for displaying enemy and item sprites (AI-generated or hand-made).
- Animated HUD Hands: Fully animated weapon hands, generated using AI image models and optimized for sprite-based animation.
- Keyboard & Mouse Controls: Smooth first-person movement, camera rotation, shooting mechanics, and weapon switching.
- Custom Map Configuration: Easily define levels using
.cubfiles for layout, textures, and colors.
- MLX42 (with PNG support)
- C compiler (GCC or Clang)
stb_image&stb_image_write(bundled)cJSONfor JSON parsing- POSIX libraries (
pthread,math,fcntl)
This project uses the OpenAI API for AI-assisted asset generation. You need to provide your own API key to enable this functionality.
- Open
src/api.c - Find the macro or variable where the API key is defined (e.g.,
#define API_KEY "your_api_key_here") - Replace
"your_api_key_here"with your actual OpenAI API key as a string.
Alternatively, you can modify the code to load the key from an environment variable or a configuration file for better security.
Note: Keep your API key private and never commit it to public repositories.
If you don't have an API key, get one at https://platform.openai.com/account/api-keys.
# Clone the repo
git clone https://github.com/aapadill/cub3d.git
cd cub3d
# Build using Make (adjust as needed)
make
Before building, make sure the following libraries are installed: macOS (with Homebrew)
# Install cJSON (for JSON parsing)
brew install cjson
# Install GLFW (required by MLX42)
brew install glfw
# Install libpng (for PNG support)
brew install libpng
# Install curl (if your API uses libcurl to make HTTP requests)
brew install curl
# Optional: If make is missing
xcode-select --install
sudo apt update
# Install build essentials
sudo apt install build-essential
# Install dependencies
sudo apt install libcjson-dev libglfw3-dev libpng-dev libcurl4-openssl-dev
🧪 Test tip: If you run into build issues, make sure your compiler supports C99 and that all libraries are correctly linked in the Makefile.
./cub3d path/to/map.cub [--strict]--strict: Enforce stricter map closure rules.
NO path/to/north.png
SO path/to/south.png
WE path/to/west.png
EA path/to/east.png
DO path/to/door.png
F 220,100,0 # Floor RGB
C 225,30,0 # Ceiling RGB
1111111
1 1
1 N 1
1 D 1
1111111
N/S/E/W: Player start orientationD: Door tile1: Wall0or space: Floor
| Key / Mouse | Action |
|---|---|
| W / A / S / D | Move forward/left/back/right |
| Left / Right Arrows | Rotate camera |
| Mouse Drag (Tab) | Free-look |
| Space / Left Click | Shoot (trigger hand animation) |
2 |
Change weapon (enter object name) |
0 |
Talk to NPC (needs to be close) |
| Esc | Quit |
├── include/ # Headers
│ └── cub3D.h
├── src/ # Source files
│ ├── main.c
│ ├── parsing.c
│ ├── movement.c
│ ├── ray.c
│ ├── utils.c # entry_screen, draw_floor_and_ceiling, etc.
| ├── api.c # Open ai api call
│ └── ...
├── textures/ # Default textures & AI-generated hands
│ ├── hand/ # Hand sprite frames
│ └── pics/ # Wall & door PNGs
│ └── ...
├── map.cub # Example map file
├── Makefile
└── README.md
Feel free to open issues or submit pull requests. Please follow the existing coding style and provide clear commit messages.
This project is licensed under the MIT License. See LICENSE for details.