The example catalog โ€” 78 raylib examples

A map of the whole suite. Each example is one namespace under src/examples/ (or src/examples/games/, src/examples/models/), runnable via bb <name> or clj -M:<alias>. bb examples prints this same grouping live from bb/helpers.bb's examples registry โ€” this page is that registry rendered as a browsable table, plus (where known) which official raylib C example a given Clojure example ports. Nearly every "ported from" cell cites a file in raysan5/raylib's own examples/ tree; the 3 cells marked ยน instead cite the companion raysan5/raylib-games repo โ€” see the note under the games table below.

Full-size preview gallery: demos.md โ€” every example at full size, one-line description included. The preview column below thumbnails straight from the same committed GIFs (docs/demos/*.gif), regenerated by the maintainer-only bb record task and configured by scripts/demo_manifest.edn.

Run one, or see them all grouped:

bb <name>       # e.g. bb asteroids   (opens a window)
bb examples     # this same grouping, printed from the terminal

๐ŸŽฎ Original games (9)

previewbb nametitleshowscontrolsported from
hello-worldHello WorldBasic window testQ to exit, F1 for debug statscore_basic_window.c
pongPongTwo-player paddle gameW/S, K/J, Enterโ€”
asteroidsAsteroidsShoot asteroidsArrows, Spaceโ€”
asteroids2Asteroids 2Alternate versionArrows, Spaceโ€”
tetrisTetrisBlock-stacking puzzleArrows, Spaceโ€”
vampire-survivorsVampire SurvivorsSurvival actionWASDโ€”
snakeSnakeClassic snake gameArrows, P, ENTER, Qsnake.cยน
floppyFloppyFlappy bird cloneSPACE, P, ENTER, Qfloppy.cยน
retro-maze-3dRetro Maze 3DGameBoy-style maze escapeWASD, Mouse, SPACE, M, ENTER, Qretro_maze_3d.cยน

ยน Ported from raysan5/raylib-games โ€” a companion repo of classic-game clones and game-jam entries, separate from raysan5/raylib's own examples/ tree that every other "ported from" cell on this page cites. snake.c and floppy.c come from its classics/ collection; retro_maze_3d.c from its retro_maze_3d/ GGJ 2021 entry (header comment: "GGJ 2021 - RETRO MAZE 3D โ€ฆ Copyright (c) 2021 Ramon Santamaria (@raysan5)", matching this example's own docstring credit).

๐Ÿ“ฆ Core (23)

previewbb nametitleshowscontrolsported from
bouncing-ballBouncing BallPhysics demoSPACE, Gshapes_bouncing_ball.c
following-eyesFollowing EyesMouse trackingMove mouseshapes_following_eyes.c
screen-managerScreen ManagerState machineENTERcore_basic_screen_manager.c
input-keysInput KeysKeyboard inputArrow keyscore_input_keys.c
input-mouseInput MouseMouse inputClick, movecore_input_mouse.c
input-gamepadInput GamepadGamepad demoConnect gamepadcore_input_gamepad.c
mouse-wheelMouse WheelScroll inputMouse wheelcore_input_mouse_wheel.c
gestures-testbedGestures TestbedTouch gesturesTouch/clickcore_input_gestures_testbed.c
scissor-testScissor TestScissor clippingS, Mousecore_scissor_test.c
random-valuesRandom ValuesRandom numbersWatchcore_random_values.c
camera-2dCamera 2D2D cameraArrows, A/S, Wheelcore_2d_camera.c
camera-3d-freeCamera 3D FreeFree 3D cameraMouse, Wheelcore_3d_camera_free.c
split-screen-3dSplit Screen 3DTwo-player 3DW/S, UP/DOWNcore_3d_camera_split_screen.c
first-person-3dFirst Person 3DFPS cameraWASD, Mouse, 1-4core_3d_camera_first_person.c
camera-fpsCamera FPSFPS with physicsWASD, Space, Ctrlcore_3d_camera_fps.c
world-screenWorld Screen3D to 2D coordsMouse, Wheelcore_world_screen.c
picking-3dPicking 3DRay castingClickcore_3d_picking.c
collision-areaCollision AreaCollision detectionMouse, SPACEshapes_collision_area.c
colors-paletteColors PaletteColor showcaseHover, SPACEshapes_colors_palette.c
logo-animLogo AnimationLogo animationR to replayshapes_logo_raylib_anim.c
window-should-closeWindow Should CloseCustom close confirmationY/N to confirm/cancelcore_window_should_close.c
camera-2d-platformerCamera 2D Platformer5 camera follow modesArrows, SPACE, C, R, Wheelcore_2d_camera_platformer.c
window-letterboxWindow LetterboxResolution-independent renderingSPACE, Resize windowcore_window_letterbox.c

๐Ÿ”ท Shapes (15)

previewbb nametitleshowscontrolsported from
logo-raylibLogo RaylibRaylib logo drawn with shapesESC to exitshapes_logo_raylib.c
logo-raylib-animLogo Raylib AnimAnimated logo constructionR to replayshapes_logo_raylib_anim.c
basic-shapesBasic ShapesCircles, rectangles, triangles, polygonsESC to exitshapes_basic_shapes.c
rectangle-scalingRectangle ScalingDrag to resize rectangleDrag bottom-right cornershapes_rectangle_scaling.c
mouse-trailMouse TrailCircles following mouse cursorMove mouseshapes_mouse_trail.c
lines-bezierLines BezierInteractive bezier curveDrag endpointsshapes_lines_bezier.c
easings-ballEasings BallEasing function animationENTER to replayshapes_easings_ball.c
ball-physicsBall PhysicsGrab and throw ballsClick, Right-click, Wheel, Middleshapes_ball_physics.c
simple-particlesSimple ParticlesWater/smoke/fire effectsArrows, Clickshapes_simple_particles.c
dashed-lineDashed LineInteractive dashed lineArrows, Cshapes_dashed_line.c
starfield-effectStarfield Effect3D starfield simulationSPACE, Wheelshapes_starfield_effect.c
easings-boxEasings BoxBox animation with easing functionsSPACE to resetshapes_easings_box.c
double-pendulumDouble PendulumChaotic pendulum simulationESC to exitshapes_double_pendulum.c
lines-drawingLines DrawingDraw rainbow lines on canvasClick, Right-click, Wheel, Middleshapes_lines_drawing.c
easings-rectanglesEasings RectanglesGrid animation with easing functionsSPACE to replayshapes_easings_rectangles.c

๐Ÿ“ Text (3)

previewbb nametitleshowscontrolsported from
writing-animWriting AnimationTypewriter text effectSPACE speed up, ENTER restarttext_writing_anim.c
format-textFormat TextFormatted score/timer displayESC to exittext_format_text.c
input-boxInput BoxText input fieldClick, type, Backspacetext_input_box.c

๐Ÿ–ผ๏ธ Textures (2)

previewbb nametitleshowscontrolsported from
background-scrollingBackground ScrollingParallax demoWatchtextures_background_scrolling.c
sprite-animationSprite AnimationSpritesheetLEFT/RIGHTtextures_sprite_animation.c

โœจ Shaders (1)

previewbb nametitleshowscontrolsported from
basic-lightingBasic LightingDynamic lightingMouse, Y/R/G/Bshaders_basic_lighting.c

๐Ÿ”Š Audio (4)

previewbb nametitleshowscontrolsported from
audio-moduleAudio ModuleMusic visualizationSPACE, P, Arrowsaudio_module_playing.c
sound-loadingSound LoadingWAV/OGG playbackSPACE, ENTERaudio_sound_loading.c
music-streamMusic StreamMP3 streamingSPACE, P, Arrowsaudio_music_stream.c
sound-multiSound MultiMultiple soundsSPACEaudio_sound_multi.c

๐Ÿ—ฟ Models (21)

previewbb nametitleshowscontrolsported from
geometric-shapesGeometric Shapes3D primitivesQ to exitmodels_geometric_shapes.c
waving-cubesWaving CubesAnimated cube waveQ to exitmodels_waving_cubes.c
box-collisionsBox Collisions3D collision detectionArrow keys, Qmodels_box_collisions.c
orthographic-projectionOrthographic ProjectionPerspective vs orthographicSPACE, Qmodels_orthographic_projection.c
tesseract-viewTesseract View4D hypercubeQ to exitmodels_tesseract_view.c
solar-systemSolar SystemOrbiting planetsQ to exitmodels_rlgl_solar_system.c
spinning-cubesSpinning CubesColor-cycling cubesQ to exitโ€”
point-cloudPoint CloudSpherical pointsUP/DOWN, Qmodels_point_rendering.c
wireframe-shapesWireframe ShapesCustom wireframesSPACE, Qโ€”
camera-modesCamera ModesFree/Orbital/FPS cameras1/2/3, WASD, Qโ€”
ray-pickingRay PickingClick to select cubesClick, Right-click, Qcore_3d_picking.c
bouncing-spheresBouncing SpheresPhysics in 3D boxSPACE, R, G, Qโ€”
rotating-cubeRotating Cube3D rotationArrows, +/-, R, Qmodels_rotating_cube.c
particle-systemParticle System3D particlesSPACE, G, W, R, Qโ€”
dna-helixDNA HelixDouble helixArrows, SPACE, R, Qโ€”
first-person-mazeFirst Person MazeNavigate 3D mazeWASD, Mouse, R, M, Qmodels_first_person_maze.c
yaw-pitch-rollYaw Pitch Roll3D rotation demoArrows, SPACE, R, Qmodels_yaw_pitch_roll.c
lissajous-3dLissajous 3DParametric curves1-5, Arrows, W/S, SPACE, Qโ€”
lorenz-attractorLorenz AttractorChaos theory1-3, Arrows, SPACE, R, Qโ€”
terrain-generationTerrain GenerationProcedural terrain1-3, Arrows, G, W, SPACE, Qโ€”
mesh-generationMesh GenerationProcedural 3D shapesLeft/Right, Click, SPACE, R, Qmodels_mesh_generation.c

Adding a new example

See example-architecture-patterns.md for the full recipe (source file, deps.edn alias, bb.edn task, bb/helpers.bb registry entry).