Skip to main content

Setup

Download WASM-4:

๐Ÿ“ฅ Windows๐Ÿ“ฅ macOS๐Ÿ“ฅ Linux

This contains the w4 command that will be used to create new projects and run games locally.

info

You can also install w4 with NPM by running npm install -g wasm4

Quickstart#

Let's go over creating a new project called hello-world for your chosen language. Use the dropdown menu to select a different language.

To compile AssemblyScript projects you will need npm installed.

w4 new --assemblyscript hello-worldcd hello-world

First we'll setup AssemblyScript (this only needs to be done once):

npm install

Compile the .wasm cartridge:

npm run build

Run it in WASM-4 with:

w4 run build/cart.wasm
tip

You can also use w4 watch to automatically watch for changes in source files and rebuild in real-time.

Next Steps#

Next let's take a look at some source code for Hello World.