Tutorial: Meadow Quest (2D RPG)
What's next
Ideas to extend Meadow Quest, and what visual scripting can't do yet but soon will.
Ideas
- More enemies: duplicate a slime. Make one faster by raising the
1.8in its script, or give it more health with a per-entity variable it counts down before it's defeated. - A key and a locked door: pick up a key like a coin (a global
hasKey), show it in a sixth inventory slot, and make a second gate test it. - A shop: a second NPC whose bubble offers a potion; pressing Space near it trades 1 coin
(
coins− 1) for a potion (potions+ 1). - Bigger world: widen the map (Tilemap Resize…), add rooms, and update the camera clamp.
- A score: a second UI Text with SetTextNumber
Score:and a global that coins and slimes add to. - Footsteps and music changes: a quiet looping Audio Source started with PlayAudio while the hero moves and stopped with StopAudio when it stands still.
- An options page: the game-menu system also knows
page:Optionswith volume sliders and graphics settings; build anOptionsPagepanel and a button that sendspage:Options. - Gamepad: plug one in. Move is the left stick and Jump (talk, start, swing) is the bottom button.
Useful nodes not used yet: Every (fires every N seconds), Random / RandomRange,
SendMessage / OnMessage (one entity telling another to do something), CameraFollow2D (a
smoothed camera follow in one node), Raycast2D and OverlapCircle2D (asking physics what is
in a line or an area), and OnCollisionEnter for solid hits (tick Reports collisions on a
Physics Body 2D).
Not possible yet (and what's coming)
| Wanted | Today | Coming |
|---|---|---|
| spawn or remove entities | move things far away instead | spawn & destroy are in development |
| a second level | LoadScene works in a published game; the editor only restarts the open scene | |
| scene-wide zero gravity | set Gravity scale 0 per body | a scene physics setting is requested |
Hand it to an AI
Everything in this guide is plain text underneath: the scripts above, and the scene, which the
editor saves as a .tgscene. See Working with AI to have an agent build or
extend it.
The complete game is downloadable as meadow-quest.zip. In the editor tab's developer console, agent-build-2d.js imports and opens it in one step.