just testing out ollama cloud for vibecoding in C.
  • C 98.6%
  • Makefile 1.4%
Find a file
2026-09-01 17:49:43 +02:00
assets fucking gitignore 2026-08-30 03:24:27 +02:00
src updated prompt.md :3 2026-09-01 17:49:43 +02:00
.gitignore fucking gitignore 2026-08-30 03:24:27 +02:00
LICENSE Initial commit 2026-08-28 20:50:33 +02:00
Makefile Initial commit basically lol 2026-08-28 20:51:26 +02:00
prompt.md updated prompt.md :3 2026-09-01 17:49:43 +02:00
README.md added some new assets and effects 2026-08-30 03:21:26 +02:00

C/SDL2 Game Framework

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:

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:

    make
    
  2. Run the game:

    ./game
    
  3. Clean build files:

    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.

🔊 Audio Credits

🔤 Font Credits

  • font.ttf: Determination Mono Web Font from FontSpace