Initial commit basically lol
This commit is contained in:
parent
e29921d9c9
commit
6d77491228
5 changed files with 316 additions and 2 deletions
67
README.md
67
README.md
|
|
@ -1,3 +1,66 @@
|
|||
# sdk-experiment
|
||||
# C/SDL2 Game Framework
|
||||
|
||||
just testing out ollama cloud for vibecoding..
|
||||
A lightweight, professional game template built with C and SDL2, designed for macOS. This project implements a robust game loop architecture with a cinematic introductory sequence and precise frame-rate management.
|
||||
|
||||
## 🚀 Features
|
||||
|
||||
- **Fixed Time-Step Loop**: Locked at 60 FPS using `SDL_Delay` and execution time calculation to ensure consistent gameplay across different hardware.
|
||||
- **Cinematic Intro System**:
|
||||
- Typewriter-style text animation driven by millisecond timers (`SDL_GetTicks`).
|
||||
- Dynamic centering algorithm for text rendering regardless of string length.
|
||||
- "Hold-to-Quit" mechanism utilizing `delta_time` for mathematical precision.
|
||||
- **State Management**: Centralized `Game` struct acting as the single source of truth for the application state.
|
||||
- **macOS Optimized**: Configured to work seamlessly with Homebrew-installed SDL2 libraries.
|
||||
|
||||
## 🛠️ Technical Stack
|
||||
|
||||
- **Language**: C (C11)
|
||||
- **Libraries**:
|
||||
- `SDL2`: Core windowing, input, and rendering.
|
||||
- `SDL2_ttf`: TrueType font rendering.
|
||||
- `SDL2_image` & `SDL2_mixer`: Linked and ready for asset expansion.
|
||||
|
||||
## 📋 Prerequisites
|
||||
|
||||
You must have Homebrew installed on your macOS system. Install the required SDL2 dependencies using:
|
||||
|
||||
```bash
|
||||
brew install sdl2 sdl2_ttf sdl2_image sdl2_mixer
|
||||
```
|
||||
|
||||
## 🔨 Building and Running
|
||||
|
||||
The project includes a `Makefile` to automate the compilation process.
|
||||
|
||||
1. **Compile the project**:
|
||||
```bash
|
||||
make
|
||||
```
|
||||
|
||||
2. **Run the game**:
|
||||
```bash
|
||||
./game
|
||||
```
|
||||
|
||||
3. **Clean build files**:
|
||||
```bash
|
||||
make clean
|
||||
```
|
||||
|
||||
## 📂 Project Structure
|
||||
|
||||
- `src/main.c`: Core game logic, including the game loop, input handling, update, and render functions.
|
||||
- `Makefile`: Build configuration using `sdl2-config` for path resolution.
|
||||
- `assets/`: Directory for game assets (e.g., `font.ttf`).
|
||||
|
||||
## 🎮 Controls
|
||||
|
||||
- **Hold ESC**: Exit the game (requires a 1-second hold during the intro).
|
||||
- **Arrow Keys**: Movement logic is implemented (currently disabled during the intro sequence).
|
||||
|
||||
## 🗺️ Roadmap
|
||||
|
||||
- [ ] Implement transition from Intro Sequence to Active Gameplay.
|
||||
- [ ] Integrate sprite rendering for the player character.
|
||||
- [ ] Expand game world with interactive objects.
|
||||
- [ ] Add background music and sound effects using `SDL2_mixer`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue