Skip to content

timlittle/aktis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Raycasting Engine

A 2.5D raycasting game engine built from scratch in C with SDL2, implementing classic techniques used in games like Doom and Wolfenstein 3D.

Demo

Aktis Demo

Features

  • Pure C raycasting implementation - No external game engines
  • Real-time 2.5D rendering - Wall projection with texture mapping
  • Sprite rendering system - Billboard sprites with depth sorting
  • Texture mapping - Multiple wall textures with transparency support
  • Minimap display - Real-time overhead view with player position
  • Collision detection - Grid-based world collision system
  • Cross-platform - Works on macOS and Linux

Controls

  • Arrow Keys - Move forward/backward, turn left/right
  • ESC - Exit

Installation

Prerequisites

macOS:

brew install sdl2

Ubuntu/Debian:

sudo apt-get install libsdl2-dev

Fedora/RHEL:

sudo dnf install SDL2-devel

Building

git clone <repository-url>
cd raycasting-c
make build
./raycast

Technical Implementation

  • Ray casting algorithm - Cast rays for each screen column to find wall intersections
  • DDA (Digital Differential Analyzer) - Efficient grid traversal for ray-wall intersection
  • Texture sampling - UV mapping for realistic wall textures
  • Sprite projection - 3D to 2D transformation with distance-based scaling
  • Transparency handling - Magenta color key for sprite backgrounds
  • Memory management - Custom texture loading and sprite management

Architecture

src/
├── main.c          # Game loop and input handling
├── graphics.c      # SDL rendering and display
├── ray.c           # Raycasting algorithm implementation
├── player.c        # Player movement and physics
├── sprite.c        # Sprite rendering and management
├── map.c           # World map and collision detection
└── upng.c          # PNG texture loading

Credits

  • PNG Loading: Uses upng by Sean Middleditch - A minimal PNG decoder library
  • Graphics: SDL2 for cross-platform rendering and input handling
  • Game Assets: Wolfenstein 3D textures and sprites © id Software - Used for educational purposes

Built as an educational project to understand classic 3D rendering techniques and game engine architecture.

About

Aktis - Raycasting game engine

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published