Code Editor & Player
Pyxen puts a code editor and your running game in the same window. You write Pyxen Script in the code pane and play your game in the Preview beside it.
Code editor
The editor colours Pyxen Script and checks your code as you type: a problem shows at its line, with the reason.
On the Mac, and on the iPad with a hardware keyboard, the standard shortcuts work: select, copy, paste, undo, redo. A mouse or trackpad places the cursor precisely.
Parameters as you type
Type the ( of a call, world.get( or hero.tween(, and a card above the line shows what the call takes: its parameters, the one you’re on picked out, that parameter’s line from the reference, and Reference › to open its page. It follows you across commas and into the calls inside it, and goes when you type the closing ). Your own functions get the card too, with their docstring’s first line.
The list under the line offers what fits first: the entity names written in your project for world.get(, the easing names after ease=, the keywords the call hasn’t been given yet, then the usual names. It only knows names written out as text, so an entity named while the game runs won’t be there.
Press Esc once to close the list, twice to hide the card for that call. Cmd+Shift+Space (Edit › Show Parameters) brings it back, and Ctrl+Space (Edit › Show Completions) opens the list. On the iPad, tap the card to open the reference; with the on-screen keyboard, the typing row’s . key types , inside a call.
Assets as you type
Inside the quotes of a name a call takes, Sprite(", Sound(", Music(", Text(…, font=" or GridMap(tilemap=", the list holds your project’s assets of that kind, then each asset pack’s, each with its picture: an image’s first tile (or the whole image) with its size and animations, a font writing the call’s own text, a map drawn small. After animation=" it lists the animations of the image named in the same call, each one playing. The one you’re on is shown larger beside the list, with Open in Sprite › (or the pane for its kind) to open it.
Sounds and music have ▶: click it, or press Option+Return (Edit › Show Picker) on the selected one, to hear it. Nothing plays while you move through the list, and Esc stops it. A sound from a sound bank is written "bank/sound".
The list only knows names written as text: a name kept in a variable or built from parts gets no list, and the card says it is worked out when the game runs. With the system’s Reduce Motion on, the animations hold still.
In a tile argument, Sprite("tiles", tile=( or a map’s level.set(…, tile=(, the tile picker opens below the line on the image the call names, its grid over it. Click a tile, or drag across several: the numbers are written into your code as you pick, in pixels for a sprite, (x, y, w, h), and in cells for a map, (column, row). Typing the numbers yourself moves the pick. Return keeps it (on iPad, Done), Esc puts back what was there, and one Undo takes back the whole pick. The picker opens by itself on an empty tile=(; for a tile already written, click its small picture just before the numbers, or press Option+Return (Edit › Show Picker) and use the arrow keys (with Shift for more tiles). A number worked out from a constant, such as HERO * 16, is shown dashed, and the picker says so before a pick writes numbers over it. An image without a grid picks in the size the numbers already give, else in 16 pixels.
Hold Cmd and move the pointer over the name of an asset in your code, such as "ninja" in Sprite("ninja", animation="run"): the name is underlined and a card shows the asset, with its picture, its size and its animations. Cmd+Click it to open the asset in its editor at what the call names: the Sprite editor on the run animation, the rectangle of a tile=(16, 0, 16, 16) selected, or a bank’s sound, Sound("sfx/coin"), picked in its Sound Bank. A name your project doesn’t have opens nothing.
And back: an asset’s pane shows Used in Code with how many lines of your scripts name the asset. Choose one in its menu to go to that line. Where the pane’s bar is too narrow for it, it’s at the top of the pane’s ⋯ menu.
A name your project doesn’t have, such as "ninjaa" in Sprite("ninjaa"), is underlined in amber before you run the game. Put the cursor on it and a card says Nothing in the project is called “ninjaa”., with Use “ninja” to write the closest name in its place, and New Image… to make it (New Tilemap…, New Font… or New Sound Bank… for those kinds). An animation the image doesn’t have is underlined the same way, and so are tile= and animation= in the same Sprite, which can’t be used together. These are warnings, not errors: the game still runs, since a name can come from an asset pack you add later. Only names written as text are checked.
Jump to Symbol
Press Cmd+Shift+O (Edit › Jump to Symbol…) to list the functions and names in your project, and the reference’s entries. Start typing to filter, then choose one to go to it.
Jump to Definition
Cmd+Click a function or variable name, or press Cmd+J (Edit › Jump to Definition) with the cursor on it, to go to where it’s defined. This works across files in your project — if a function is defined in utils.py and called in main.py, Cmd+Click takes you straight there. When a name has several definitions, or none in your project, Jump to Symbol opens on it.
Word-wise navigation
Use Option+Arrow keys to move the cursor one word at a time instead of one character. Combined with Shift, this selects word by word — useful for quickly selecting variable names or function calls.
Text size and themes
Press Cmd+= to make the code bigger and Cmd+- to make it smaller, or choose View › Make Text Bigger and Make Text Smaller. In Settings › Editor, set the size from 10 to 32 points and pick one of ten themes for the code: Automatic follows the appearance with Pyxen Dark or Pyxen Light; the others are Pyxen Deep Dark, Pyxen Deep Light, Dracula, GitHub Light, One Dark, One Light, Solarized Dark and Solarized Light.
On a narrow iPad window
When the window is narrower than 900 points (an 11-inch iPad in portrait, Split View, Slide Over), Pyxen shows one pane at a time, the others as tabs above it, and the pane’s tools sit in the tray at the window’s foot. Tap its handle to make it taller or shorter, or drag it down to fold it away. The code pane’s tray has:
- Keys: the Caret pad, which you drag like a trackpad to move the cursor, the word and line keys, Select, the keys code needs, undo, redo, Cut, Copy and Paste. Touch and hold a key with a dot for its variants.
- Find: find and replace in this file.
- Symbols: this file’s functions and names. Tap one to go there, or Jump to Symbol… to search the whole project.
With the on-screen keyboard up, the code’s keys are in the row over the keyboard; with a hardware keyboard, the code pane has no tray.
Running your game
Choose Run (Cmd+R) to check, compile and run your code. The game starts in the Preview. Stop (Cmd+.) ends it, and Pause in the Preview’s bar holds it on a frame.
If your code has an error, Pyxen shows the message at its line. Fix it and Run again.
Frame inspector
When you pause a running game, the frame inspector activates. This is Pyxen’s built-in debugger.
The inspector lets you:
- Browse every entity in the current frame — see their position, components, and state
- Inspect components — view the exact values of sprites, bodies, custom components, and transforms
- Understand your scene — see parent-child relationships, layers, and visibility
Time scrubber
Pyxen records up to 300 frames of history while your game runs, ten seconds at 30 frames a second. When paused, you can scrub backward and forward through time.
Each frame keeps its entities and what it drew, within a memory budget: a busy game, with many entities or a lot of draw, keeps fewer frames, the oldest going first, and the scrubber shows how far back it goes. Set the budget in Settings › Game Preview › Debugger › History memory. It starts at the value recommended for your device, written under it, which keeps 300 frames of most games.
This means you can:
- Rewind to the exact frame where a bug happened
- Step frame by frame to see how state changes over time
- Compare frames to understand what your code did between two points
The time scrubber turns debugging from guesswork into observation. Instead of adding print statements and re-running, you pause, rewind, and look.
Workflow
A typical workflow in Pyxen:
- Write or edit code in the editor
- Run it to test
- If something looks wrong, pause the game
- Scrub back in time to find the frame where it went wrong
- Inspect entities to see what state was unexpected
- Stop, fix the code, repeat