Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

100 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sandboxia2D

Logo

"Fast, simple and open source sandbox game"

Sandboxia is a sandbox game written in C using Raylib. It was originally written in C++ and used OpenGL based renderer, but it became too messy to maintain. It's designed to be a simple sandbox game that is easy to run on older machines. There aren't any goals in the game. The game is still in development. Sandboxia2D comes with a simple Lua API for mods to add new features to the game. For deeper modding, modify the source code directly. Official Windows support was dropped in version v0.2.0-beta.

Currently the game is being rewritten in C, so expect missing features and bugs.

Features

  • Bugs may be present
  • 2D World
  • World saving/loading
  • Debug mode(WIP)
  • Console(WIP)
  • Support for mods!(Partially implemented)

Supported platforms

  • Linux: x64, x86, aarch64

How to play

Controls

  • Esc to exit
  • W, A, S, D to move
  • Left mouse button to destroy blocks
  • Right mouse button to place blocks
  • T to open console(WIP)
  • F1 to save current world
  • F2 to load world named "world.dat"

Pre-requisites for Linux

For debian based distros, run sudo apt install gcc cmake liblua5.4-dev to install the necessary packages. You need to manually install raylib.

These could be installed using your package manager. If they aren't available, you can build them from source.

Building

Linux

Linux is currently the only tested platform.

  • Building instructions:
    1. Run mkdir build
    2. Run cmake -B build -DCMAKE_BUILD_TYPE=Release This will generate the Makefile, for debug use cmake -B build -DCMAKE_BUILD_TYPE=Debug
    3. Run cmake --build build -j(number of threads) to build the game.
  • Run ./build/Sandboxia to play the game.

If you get compile errors of stb_perlin, try to comment line #define STB_PERLIN_IMPLEMENTATION in src/game.c

To build a simple mod

See MODDING.md for more info

Launch args

  • --width= to set the width of the window
  • --height= to set the height of the window
  • --fps= to set the target framerate
  • --collision= to set the collision, Default is 1
  • --world= to set the world file

These doesn't work yet(Obsolete):

  • -d to set the debug, Default is 0
  • -noMods to disable mods
  • -noSounds to disable sounds

Example

./build/Sandboxia --width=800 --height=600

For debug

The legacy renderer was removed in v0.1.9-beta. The OpenGL renderer was removed in v0.2.0-beta.

Debug keys(Doesn't work yet):

  • P to print the player position
  • O to print the selector position
  • T to print the current tile data at the cursor
  • F to print the current FPS

Screenshots

Sandboxia

Textures

All textures are 8x8 in size. Texture size may change in the future

TODO

  • Release v1.0.0 version
  • Add audio support
  • Add more blocks
  • Make better GUI
  • Add settings menu
  • Better documentation
  • Do optimizations
  • Make Windows fully functional
  • Implement modding API
  • Replace OpenGL 2.1 with 3.0 core
  • Rewrite the whole game in C using raylib

Third-party libraries used

Contributing

If you have any suggestions, bug reports, or feature requests, please open an issue.

License

Copyright (c) 2024-2026 Benjamin Helle

Sandboxia2D is licensed under the GPL-3.0 license.

About

A simple 2D sandbox game written in c

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages