Write 2D games in MiniScript, powered by Raylib graphics, running in your browser via WebAssembly.
No compiler needed. Just edit your MiniScript code and assets, refresh the browser, and play!
Play the live demo - See MSRLWeb in action!
Unzip and you're ready to go:
- Start a web server in the unzipped folder. If you have Python installed, you can just
cdto the folder, and do:python3 -m http.server 8000
If you don't have Python, consider Redbean. Any web server will do.
-
Open your browser to: http://localhost:8000
-
Edit
assets/main.msto change the game - then refresh the web page to see your changes.
That's it! No build tools, no compilation, no hassle.
MSRLWeb lets you create 2D games and interactive graphics using:
- MiniScript - A simple, elegant scripting language (like Python meets JavaScript)
- Raylib - A powerful 2D/3D game programming library
- WebAssembly - Runs anywhere, right in the browser
Your game logic lives in easy-to-edit MiniScript files. Change the code, refresh the browser, see results instantly. No recompiling, no build steps.
Here's a complete bouncing sprite demo in MiniScript:
// Load a sprite
spriteTex = raylib.LoadTexture("assets/Wumpus.png")
// Starting position and velocity
x = 100; y = 100
dx = 5; dy = 5
// Game loop
while true
raylib.BeginDrawing
raylib.ClearBackground raylib.RAYWHITE
// Move the sprite, bouncing off edges
x += dx; y += dy
if x > 960 - 64 or x < 0 then dx = -dx
if y > 640 - 64 or y < 0 then dy = -dy
// Draw it
raylib.DrawTexture spriteTex, x, y, raylib.WHITE
raylib.DrawFPS
raylib.EndDrawing
yield // Let the browser breathe
end whileThat's it! Edit, save, refresh.
MSRLWeb provides 174 Raylib functions organized into modules:
- rcore (29 functions) - Window, input, timing, mouse, keyboard
- rshapes (35 functions) - Circles, rectangles, lines, polygons, collision detection
- rtextures (45 functions) - Load/draw images, procedural textures, image manipulation
- rtext (12 functions) - Load fonts, draw text, measure text
- raudio (53 functions) - Sound effects, music streaming, spatial audio
See RAYLIB_API.md for the complete function list.
All functions have sensible defaults, so you can start simple:
raylib.DrawCircle 100, 100, 50, raylib.RED // Works!
raylib.DrawRectangle // Also works! (uses defaults)- Game developers who want rapid prototyping without build tools
- Educators teaching game development with a simple language
- Hobbyists making web games with minimal friction
- Anyone who wants to try Raylib without installing C/C++ toolchains
MiniScript:
- Interactive Tutorial - Learn by doing
- Quick Reference - Syntax cheat sheet
- Language Manual - Complete guide
Raylib:
- Cheatsheet - All Raylib functions
- Examples - Code samples (in C, but easy to translate)
Want to hack on MSRLWeb itself? See BUILDING.md for:
- Setting up the build environment
- Compiling from source
- Adding new Raylib intrinsics
- Creating release packages
- MSRLWeb: [LICENSE](MIT License)
- MiniScript: MIT License - https://miniscript.org
- Raylib: zlib License - https://www.raylib.com/license.html
Happy game making! ๐ฎ
Have questions or want to share what you've made? Open an issue or discussion, or join us on Discord.