Platformer Flags, Counters, and Rules
Make a door wait until the player collects three coins. The Platformer editor can add that rule from an example, then show its counter, triggers, and door condition as editable forms.
Prerequisites
Prepare a platformer room with a door and at least three Coin pickups. Give the parts distinct names and test the door’s destination. Save the project before adding rules.
Add the Coin-Door Example
- Open the Platformer editor’s Rules view.
- Under Start from an example, find A door that opens after 3 coins. The number follows the available coins, up to three.
- Read the example’s description and choose Add. If it is unavailable, read the listed requirement and place the missing door or coins first.
- Inspect Flags and counters. The example adds a Counter for coins taken.
- Inspect When something happens. Each selected coin has a pickup trigger that adds one to that counter once.
- Inspect Doors that wait. The chosen door requires the counter to reach the example’s target and has a message for an unmet condition.
- Play from a fresh start. Try the door before collecting enough coins, collect them, then try the same door again.
Expected result: the first attempt shows the gate’s message and keeps the door closed. After the required pickups, the door leads to its configured destination. Check that it gates the door you intended; the example selects suitable parts from the current game.
Declare a Flag or Counter
Choose Start with empty rules when you want to author the forms yourself. Under Flags and counters, Add a record and set:
| Field | Use |
|---|---|
| Name | The stable ID used by other rules and Set Platformer Rule Value. Keep it distinct. |
| Shown as | A readable label for the editor. |
| Kind | Flag (yes or no) or Counter (a number). |
| Starts as | The value at the beginning of the game. |
Use a Flag for a switch such as bridge-open; use a Counter for a quantity such as coins-taken. These records belong to the platformer machine’s rules. Declare a Global separately if ordinary Myth Logic also needs a Global of that name.
After renaming a record, inspect the triggers and gates that use it. A readable Shown as label lets you improve the editor wording while retaining its ID.
Add a Trigger
In When something happens, Add a record. Give it a Name and choose When. Available events include entering a room or area, pressing Up in an area, taking a pickup, defeating a foe, a condition becoming true, and a timer running out. Other choices cover goals, damage, lives, bosses, and switches.
Choose In room and any part required by the event. For an area event, define the Area in tiles or use the drawing control where offered. Select the intended pickup or foe instead of relying on another part with a similar displayed name.
Conditions choose All of these are true or Any of these is true. Each condition checks a rule variable or a player stat and compares it with Value. Match the value’s type to the selected flag, counter, or stat.
Add the trigger’s actions through Do. For example, Set a flag or counter changes one value, Add to a counter changes its quantity, and Show a message displays Words. Start a timer and Stop a timer refer to the selected record. Show a place (pan the camera) uses a place and duration.
Someone says something can have a speaker, up to four Choices, and The game waits while it is read. A choice can set a variable. Test accepting each choice, closing the exchange, and returning to movement.
Check the trigger’s one-time behavior when it gives a reward. Re-entering a room or taking another route can produce another event. Compare a fresh run with a return visit so a reward or message occurs at the intended time.
Gate a Door
Add a record in Doors that wait, select its room and door, and supply its conditions. Use the unmet-condition message to tell the player what is missing.
Test both sides of the threshold. For a counter gate at 3, check values 2 and 3; for a flag gate, check false and true. Also check that the destination door or return route lets the player leave the area after the gate opens.
The Rules view’s forms run inside the platformer machine and can participate in its room checks. If you add custom Logic that changes the route, use a manual playtest for that room.
Troubleshooting
| Symptom | Check |
|---|---|
| An example’s Add button is disabled | Read its required door, pickup, or other part; add that content and return to Rules. |
| A counter never increases | Check the pickup ID, room selection, and trigger action’s selected counter. |
| A door opens too early | Check its selected door and whether the conditions use All or Any. |
| A reward repeats | Inspect the event and one-time behavior; test a second entry or visit. |
| A conversation keeps the player waiting | Inspect the pause setting and choices, then test how the conversation ends. |
| Logic changes a different value | Use the machine variable’s Name with Set Platformer Rule Value; a Global is a separate record. |
Myth Engine Documentation
