Skip to content

N2 examples

Compile these files with the N2 Code Compiler. For the multi-file example, import its entire folder into the Project Compiler.

Source Topic
01_hello_world.n2 hello world
02_globals_and_locals.n2 globals and locals
03_classes_oop.n2 classes oop
04_lists_and_maps.n2 lists and maps
05_system_libraries.n2 system libraries
06_audio_and_input.n2 audio and input
07_oop_game_project Multi-file project; keep subdirectories and imports intact.
airship_demo.n2 Airship telemetry and named wireless redstone channels
environment-detector.n2 Biome and world coordinates through the peripheral mailbox
network-http.n2 HTTP GET request
network-mailbox.n2 Low-level HTTP mailbox and buffer handling
network-routes.n2 HTTP listener with routes (requires server opt-in)
peripheral-tools.n2 Note block and speaker calls

Chapter contents