Skip to main content

Home

This community-maintained websites references the resources useful for creating custom levels for PewPew Live.

Levels are created by writing Lua code. If you are new to programming or new to Lua, a good first step is to start with the Beginner guide.

If you are already familiar with programming, a good starting point is to look at the examples (for example, the simple_level) to get a feeling of how a level is made, and then go through this website to get more precise information about the various aspect of level creation.

If you have questions, the game's creator and many level creators are available on Discord.

Level structure

A level is a directory that contains a manifest and Lua files. The Lua files fall in three categories:

  • Files that describe graphics.
  • Files that describe sounds.
  • Files that describe the behavior of the level. They make use of the pewpew and fmath libraries, which require an understanding of the types used.

Uploading your level

You can upload your level by signing into your account on https://pewpew.live and navigating to the Manage your custom levels page.

screenshot of UI for uploading

PewPew Live's Lua

PewPew Live embeds a slightly customized version of Lua 5.3.

Among the changes are:

  • Added a fixed point type to make the game logic deterministic everywhere.
  • Iteration over tables was made deterministic.
  • The interpreter search for files in a virtual "dynamic" directory.
  • The interpreter has aggressive memory limits.

When writing code, it is recommended to follow LuaRocks's style guide, but using 2 space indentation to be consistent with the rest of PewPew's codebase.

Helpful tools and utilities

  • PewPew Snippets is an essential Visual Studio Code extension that offers autocompletion and useful code snippets for creating levels.
  • PewPewLive-MeshExporter is a Blender plugin for converting scenes into PewPew Live 3D meshes.
  • PewPew Overhaul Lite is a highly opinionated framework that iterates upon the original PewPew API to optimize the level development process.