• Stars
    star
    1,129
  • Rank 40,992 (Top 0.9 %)
  • Language
    TypeScript
  • License
    ISC License
  • Created about 3 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Build retro games using WebAssembly for a fantasy console.


WASM-4 Logo
WASM-4

Build retro games using WebAssembly for a fantasy console

WebsiteShowcaseDocsDiscussions

About

WASM-4 is a low-level fantasy game console for building small games with WebAssembly. Game cartridges (ROMs) are small, self-contained .wasm files that can be built with any programming language that compiles to WebAssembly.

Key Features

  • No Glue Code: If you've ever tried to write even a simple "Hello World" with WebAssembly before, you'll know it usually involves writing a bunch of JS and HTML glue. WASM-4 removes all of that, games interface directly with the system through a small API.

  • Minimalist: Fantasy consoles force developers to work with limited resources. This makes them simple to learn, and easier to focus on finishing your game.

  • Language Agnostic: Use any programming language, as long as it can compile to WebAssembly. Out of the box we currently support: AssemblyScript, C/C++, D, Go, Nelua, Nim, Odin, Rust, WAT, and Zig.

  • Portable: WASM-4 is designed to run on any device that can execute WebAssembly, even outside of the web! It includes a lightweight runtime written in C that runs even low-powered microcontrollers and obsolete hardware.

  • Netplay: Instant online multiplayer, featuring rollback netcode. All games that support local multiplayer automatically support netplay. WASM-4 handles syncing controller inputs over the Internet.

🚀 60 Second Quickstart

# Install the w4 command
npm install -g wasm4

# Create a project
w4 new --assemblyscript hello-world

# Setup toolchain
cd hello-world
npm install

# Build and run your game!
npm run build
w4 run build/cart.wasm

For more info and guides, check the full documentation.

🎮 Hardware Specs

  • Display: 160x160 pixels, 4 customizable colors, updated at 60 Hz.
  • Memory: 64 KB linear RAM, memory-mapped I/O, save states.
  • Cartridge Size Limit: 64 KB.
  • Input: Keyboard, mouse, touchscreen, up to 4 gamepads.
  • Audio: 2 pulse wave channels, 1 triangle wave channel, 1 noise channel.
  • Disk Storage: 1024 bytes.

🙏 Contributing

Contributions are welcome! Here are just a few ways to help:

  • Build a game or experiment, we'll feature it on wasm4.org!
  • Improve our documentation or write a tutorial.
  • Submit a bug report or feature request on Github.
  • Answer questions on the discussions forum.
  • Implement support for a new tool or language.
  • Give the project a star on Github for visibility.

More Repositories

1

flambe

Rapidly cook up games for HTML5, Flash, Android, and iOS.
Haxe
742
star
2

ai.vim

Generate and edit text in Neovim using OpenAI and GPT.
Lua
293
star
3

webuxn

Web runtime for the uxn virtual machine.
C
76
star
4

hydra

An HTML5 game engine for the many faces of mobile WebKit.
JavaScript
64
star
5

flambe-demos

Demos and example code for Flambe.
Haxe
50
star
6

dotfiles

My configuration and theme.
Shell
35
star
7

pjs

An awk-like command-line tool for processing text, CSV, JSON, HTML, and XML.
JavaScript
24
star
8

easel

A 2D scene graph and game engine for HTML5 (canvas) in haXe. Easel is intended to feel natural to Flash developers.
Haxe
16
star
9

dts2haxe

Typescript .d.ts to Haxe extern generator.
Python
15
star
10

Browser.hx

JS externs for Haxe.
Haxe
14
star
11

lintgpt

LintGPT scans your code for bugs using AI.
TypeScript
14
star
12

space-date

A short visual novel
Haxe
7
star
13

popcord

Watch videos together with friends, remotely.
JavaScript
6
star
14

SDL_image

Unofficial git mirror of SDL_image
C
4
star
15

clipboy

Clipboy is a cross-platform, minimal clipboard manager.
Go
4
star
16

hanoi

A Flash/HTML5 game built in a weekend
Haxe
4
star
17

SDL_mixer

Unofficial git mirror of SDL_mixer
C
4
star
18

vigrep

Grep for image files using GPT-4o Vision.
TypeScript
4
star
19

thimble

Anti-fingerprinting browser extension.
TypeScript
4
star
20

trollcat

A Trollscript interpreter written in LOLCODE
3
star
21

SDL

Unofficial git mirror of SDL
C
3
star
22

amity

Getting along with Android and iPhone game development
C
3
star
23

flambe-server

Flambe extensions for multiplayer games
Haxe
2
star
24

lime-volleyball

A WASM-4 game jam entry
C
2
star
25

carebot

A friendly Twitter bot that corrects mentions of "could care less".
Python
1
star
26

webidl-externs

WebIDL
1
star
27

check-tmpmail

JavaScript
1
star
28

camocat

Anti-SEO text transformer.
Go
1
star