All Projects → andrew-lim → sdl2-raycast

andrew-lim / sdl2-raycast

Licence: MIT license
SDL2 C++ raycasting engine with vertical movement, floor/ceiling texture mapping and sprites.

Programming Languages

C++
36643 projects - #6 most used programming language
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to sdl2-raycast

Engine
A basic cross-platform 3D game engine
Stars: ✭ 208 (+160%)
Mutual labels:  engine, sdl2
raycaster-sdl
A simple raycasting demonstration using SDL2
Stars: ✭ 24 (-70%)
Mutual labels:  sdl2, raycasting
ray engine
A toy raycasting engine in Go + Ebiten
Stars: ✭ 19 (-76.25%)
Mutual labels:  engine, raycasting
FallingSandSurvival
2D survival game inspired by Noita and slightly Terraria
Stars: ✭ 66 (-17.5%)
Mutual labels:  engine, sdl2
Xray 16
Improved version of the X-Ray Engine, the game engine used in the world-famous S.T.A.L.K.E.R. game series by GSC Game World. Join OpenXRay! ;)
Stars: ✭ 1,806 (+2157.5%)
Mutual labels:  engine, sdl2
RendererEngine
2D - 3D Renderer Engine builds with OpenGL, SDL2, C++
Stars: ✭ 17 (-78.75%)
Mutual labels:  engine, sdl2
tnt
A 2d Game Engine written in C++20.
Stars: ✭ 30 (-62.5%)
Mutual labels:  engine, sdl2
Sourcehold
Open source re-implementation of Stronghold 1
Stars: ✭ 152 (+90%)
Mutual labels:  engine, sdl2
Dome
A lightweight game development environment where games can be written in Wren
Stars: ✭ 251 (+213.75%)
Mutual labels:  engine, sdl2
elk
A low footprint JavaScript engine for embedded systems
Stars: ✭ 1,458 (+1722.5%)
Mutual labels:  engine
openmom
A cross-platform open source port of Master of Magic game from Microprose
Stars: ✭ 90 (+12.5%)
Mutual labels:  sdl2
exengine
A C99 3D game engine
Stars: ✭ 487 (+508.75%)
Mutual labels:  engine
gnuboy
latest version of original laguna source, with a handful fixes for modern compilers and systems
Stars: ✭ 70 (-12.5%)
Mutual labels:  sdl2
quickjs-build
Build for QuickJS JavaScript Engine
Stars: ✭ 25 (-68.75%)
Mutual labels:  engine
RustTetris
Tetris Made in Rust and SDL2
Stars: ✭ 18 (-77.5%)
Mutual labels:  sdl2
tortuga
A modern game engine built using dot net core
Stars: ✭ 14 (-82.5%)
Mutual labels:  engine
delphi3d-engine
A 3D-graphic and game engine for Delphi and Windows.
Stars: ✭ 52 (-35%)
Mutual labels:  engine
DummyEngine
Small cross platform Vulkan/OpenGL 3d engine for personal experimentation
Stars: ✭ 76 (-5%)
Mutual labels:  engine
ColumbusEngine
3D cross-platform game engine written in C++
Stars: ✭ 45 (-43.75%)
Mutual labels:  engine
pyEnigma
Python Enigma cypher machine simulator.
Stars: ✭ 44 (-45%)
Mutual labels:  engine

SDL2 Raycasting Engine

This was originally a port of my HTML5 canvas version here. If you just want to learn basic floor/ceiling texture mapping in a raycaster, I recommend studying the HTML5 version. The code is easier to read and can be run in your browser.

This C++ project has a few more features compared to the HTML5 version: vertical movement, wall top/bottom texture mapping, sprites and projectiles. There is also experimental support for thin angled walls and slopes.

You can see videos of it in action here.

Download the Windows demo here.

Screenshots

Building

I highly recommending compiling with some kind of optimization enabled. For Dev-C++ I use the -O2 flag. The -O3 flag also works if -fno-tree-vectorize is specified as well.

You will need SDL2 and SDL2_mixer.

SDL2 version used is SDL2-devel-2.0.12-mingw.tar.gz
https://www.libsdl.org/download-2.0.php

SDL2_mixer version used is SDL2_mixer-devel-2.0.4-mingw.tar.gz
https://www.libsdl.org/projects/SDL_mixer/

So far I've only tested this with Dev-C++ 5.11
https://sourceforge.net/projects/orwelldevcpp/

Asset Credits

Sounds and images are from these OpenGameArt links:

https://opengameart.org/content/big-pack-of-hand-painted-tiling-textures

https://opengameart.org/content/first-person-dungeon-crawl-protagonist

https://opengameart.org/content/lab-sprites

https://opengameart.org/content/first-person-dungeon-crawl-art-pack

https://opengameart.org/content/2-high-quality-explosions

https://opengameart.org/content/4-projectile-launches

https://opengameart.org/content/lpc-animated-doors

https://opengameart.org/content/door-open-door-close-set

https://opengameart.org/content/cloudy-sky

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].