Skip to content
Bit Quirky Round Trip
Visual Scripting

Search documentation

All topics and APIs

Close returns focus to Search.

What are you looking for?

Try a common topic or a C# feature.

Browse the reference instead

Esc closes · Tab reaches results · Enter opens the focused link

v1.0.0
Menu

Platformer project layout

Find the sample scene, runtime assembly, rules asset, credits, and local Round Trip layout and configuration files in the imported Platformer folder.

This page describes the folder layout of the Platformer sample, the sample of the optional Round Trip Sample - Platformer package. Package Manager copies it into your project as Assets/Samples/Round Trip Sample - Platformer/<version>/Platformer/; every path below starts at that Platformer folder. It is the sample’s own arrangement, and your project does not need to follow it. Round Trip reads and writes the C# in whichever folders you choose in your own project.

The sample is small enough to copy ideas from without first decoding a production project. Runtime code sits under one root, rules that do not depend on scene objects have their own folder, and personal canvas arrangements stay under UserSettings.

Path What lives there
Platformer/Scenes/ Platformer.unity, the playable scene.
Platformer/Runtime/Player/ PlayerController interactions and PlayerMotor movement.
Platformer/Runtime/Collectibles/ Coin, which ignores repeated collection attempts.
Platformer/Runtime/Scoring/ Shared coin and score state.
Platformer/Runtime/Enemies/ The Enemy component, which coordinates its parts, plus patrol and the state machine.
Platformer/Runtime/Progression/ The goal Door.
Platformer/Runtime/Presentation/ HUD and optional audio cues.
Platformer/Runtime/Config/ LevelRules and EnemyState.
Platformer/Runtime/Logic/ Pure rules for coin threshold, enemy contact, fall boundary, and restart.
Platformer/Runtime/Composition/ Scene setup code that connects the components and their dependencies.
Platformer/Runtime/Physics/ Rigidbody2DVelocity, the one place the sample reads and writes a body’s velocity, so the game classes read the same on Unity 6 and Unity 2022.3.
Platformer/Runtime/Examples/ FlowExamples, one small method per flow shape the Flow guides show. Nothing in the scene calls it.
Platformer/Config/ The serialized LevelRules.asset.
Platformer/Input/ Input System actions.
Platformer/UI/ The HUD prefab.
Platformer/ThirdParty/Kenney/ Third-party art and audio plus the original license.
Platformer/CREDITS.md and Platformer/README.md The credits and a short readme.

Platformer/Runtime/RoundTrip.Platformer.Runtime.asmdef defines RoundTrip.Platformer.Runtime. It references the Round Trip Unity runtime assembly, Input System, and Unity UI.

The sample ships no test assembly, so importing it adds no test-framework dependency to your project. Its tests stay in the Round Trip repository.

Platformer/Config/LevelRules.asset stores one LevelRules ScriptableObject. Its public variables are:

Variable Default Effect
coinUnlockThreshold 5 Passed to CoinUnlockRule as the requested coin threshold.
coinScoreValue 10 Score awarded per coin.
stompScoreValue 25 Score awarded for a defeated enemy.
moveSpeed 7 Horizontal player speed.
jumpForce 14 Jump vertical velocity.
bounceForce 16 Stomp bounce vertical velocity.
fallRespawnHeight -6 Height at or below which the player respawns.

These values are game data. They are separate from Round Trip project settings and canvas preferences.

The LevelRules Variables card groups progression settings above the player variables.

The LevelRules class in Graph view groups the progression variables together. This is the script’s variable list, not the LevelRules.asset Inspector: select the asset in Unity to change the game’s serialized tuning values.

Round Trip’s layout storage is local by default, so in the test project every layout and configuration file is local. When you open a sample method and arrange its canvas, Round Trip writes a .rt.json file under UserSettings/RoundTrip/ that mirrors the source path below Assets/, for example UserSettings/RoundTrip/Samples/Round Trip Sample - Platformer/<version>/Platformer/Runtime/Collectibles/Coin.rt.json.

Unity projects normally keep UserSettings/ out of version control, so these files exist only on the machine that arranged the diagrams. They store canvas configuration for the matching source file. They do not contain the game behavior, and deleting them leaves the .cs files unchanged.

The sample uses Kenney’s New Platformer Pack, version 1.1, under Creative Commons Zero 1.0 Universal. The sprites and sounds live under Platformer/ThirdParty/Kenney/Platformer Pack/, with the original License.txt preserved. CC0 does not require attribution, but the sample credits Kenney in Platformer/CREDITS.md.

Inside Platformer/Runtime/, start at Composition/PlatformerComposition.cs to see how the components receive the references they need. Move to Player/PlayerController.cs to read its interactions. Then read Scoring/ScoreCounter.cs and Enemies/EnemyStateMachine.cs for the two decisions that open the goal and apply enemy state. Finish in Logic/ to see the rules those components call without depending on scene objects.

Full-size image