Skip to content

Tutorials · Crypt Knight · Chapter 16

Export

20 minutes

By the end

  • Your game exported: a folder named after your project, holding a game that runs with no Rengy installed
  • What the folder holds, and how an exported game follows the Levels list through all three levels
  • Exporting again, afresh
  • The whole game, from the title to the victory screen, as the people you send it to will play it
On this page

Export

Export writes your game to a folder of its own: your project, with its pictures and sounds prepared for the game to load, and a copy of the player that came with Rengy, named after your project. Nothing is compiled. Exporting has the whole of it, and Ship Evader’s export walks through the same steps.

  1. Save with File → Save all: Export copies the files as they are on disk.
  2. Click the Build tab, or choose View → Panels → Build if it is not there.
  3. In its Export section, a line under Export says where the game will be written, ending in crypt-knight/dist/crypt-knight/crypt-knight: a folder and a file both named after your project folder.
  4. Press Export. When it is done, the editor opens the new folder in your file manager.
The editor with the Build panel open under the Viewport: its Export section holds Export and Cook only, and the line crypt-knight/dist/crypt-knight/crypt-knight; the Viewport looks through the camera at the title scene
The Build panel’s Export section: the Export and Cook only buttons, and under them the line crypt-knight/dist/crypt-knight/crypt-knight

For a project made of scenes and Rengy Script, that is the whole form: Export, the line under it, and Cook only, which prepares a copy of the pictures and sounds in a cooked folder in your project to report their sizes. No game reads that folder, and the next export would copy it in, so delete it when you are done with it.

What is in the folder

crypt-knight, or crypt-knight.exe on Windows
The game: a copy of the player, named after your project folder. It opens the project it sits beside, wherever the folder is moved, in a window 1280 by 720 titled Crypt Knight, from your window.ron.
Your project’s files
Everything in your project folder: project.rengy, with its Levels list and its startup scene, the title; the scenes, the scripts, the artifacts, the pictures and sounds, the input map, and the .meta beside each picture, sound, scene, script and artifact.
dist/content/desktop
Your pictures and sounds, prepared for the game to load.

The export carries every .meta the game needs, so the game writes nothing in its own folder: it runs from a folder it cannot write to, such as a read-only drive. An export is for the kind of computer it was made on: a Windows editor exports a Windows game, and a Linux editor a Linux one. Export once from each to have both.

Run it

  1. In the folder Export opened, double-click crypt-knight.
  2. On Linux, if double-clicking does not start it, run ./crypt-knight in a terminal in that folder.
  3. The game opens on its title, in a window of its own. Play it as a friend would, from the title to the victory screen.
The exported game’s title in its own window: CRYPT KNIGHT over the night town, and Play lit above Quit

The exported game does the same as the editor’s Play started on the title, because it follows the same list. The difference is that an exported game always follows the Levels list: whatever scene it is on, a script’s complete() opens the next level, and after the last, the scene named in Then open, and fail() opens the level again. The editor’s Play does so only when it started on a scene that is not a level, such as the title.

  • Play on the title opens The Gate, and the castle loop, already playing, goes on.
  • The Gate’s exit opens The Crypt, and the Crypt’s the Beast’s Hall. A level’s Music plays as it opens.
  • Losing the last heart opens the same level again, with five hearts: the relics you took are still yours.
  • The beast’s death is the last level’s complete(), so the victory screen opens, from Then open.
  • Esc pauses, in all three levels, and Quit on the title closes the game.
The exported game after Play: the knight running right along the Gate’s start floor with five hearts at the top left, the sign Space to jump. over him and the night town behind

It keeps nothing

Crypt Knight saves nothing to disk: no best time, no progress, no settings. What it keeps, the hearts, the relics and the boss’s health, lives in the game’s memory for the run and is gone when the window closes. Every run starts at the title with five hearts and no relic. A game that wants a best time or a volume keeps it with save_number, as Ship Evader’s best score does.

Export again

Change something, save, and press Export again. Export empties its folder and writes it afresh, so a script you have since deleted does not linger in the game. It empties only a folder it made itself, which it marks with a small file in its dist: a folder holding anything else is refused, with nothing written. An export made by an older Rengy has no mark, so it is refused too; delete that folder by hand once, and export.

The game’s name is the project folder’s, and it must be a name every computer can use for a file. A folder name ending in a dot or a space, holding a colon, or a name Windows keeps for itself, such as con, is refused before anything is written: rename the folder. The exported folder is a project too, and exports again under its own name.

Zip the folder and send it. Whoever gets it unzips it anywhere and starts the game: they need no Rengy. The game is finished: sixteen chapters, three levels, a sword and a beast, from an empty folder.

Check it works