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.8 in 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:Options with volume sliders and graphics settings; build an OptionsPage panel and a button that sends page: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)

WantedTodayComing
spawn or remove entitiesmove things far away insteadspawn & destroy are in development
a second levelLoadScene works in a published game; the editor only restarts the open scene
scene-wide zero gravityset Gravity scale 0 per bodya 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.