- Documentation
- New stuff in ps>xr
- runtime_border_twiddling
runtime_border_twiddling
What it does
The runtime_border_twiddling prelude flag enables a new rule command named border.
With this command, your game can expand or shrink the current level bounds while the game is running.
Example: level bounds changing at runtime with border commands.
How to enable it
- Add runtime_border_twiddling in the prelude.
- Use border in rules where you want the resize to happen.
title Border Demo
author You
runtime_border_twiddling
[ > Player | Grow ] -> [ > Player | ] border right 1
[ > Player | Trim ] -> [ > Player | ] border left -1
Command format
Use border <direction> <amount>.
- Directions: right, left, up, down
- Relative direction aliases also work: <, >, ^, v
- Positive amount expands in that direction
- Negative amount shrinks in that direction and removes anything outside the new bounds
When the resize happens
Border changes are applied immediately when the command is triggered.
Any rules that run later in the same turn will use the updated board size.
Notes
- Without runtime_border_twiddling, the border command is disabled.
- If shrinking would remove too many cells, the level is clamped to a minimum size.
- If multiple border commands trigger in one turn, they are applied in trigger order.
- This feature works with again loops, so bounds can change over multiple automatic turns.