Manual

Scenes, Prefabs, and Assets

This guide explains how Sendama content is authored and assembled.

The Three Main Content Layers

Most Sendama games are built from three layers:

  1. scenes that define the playable level or screen
  2. prefabs that define reusable object templates
  3. assets such as textures, tile maps, scripts, and events

If you keep those responsibilities separate, projects stay much easier to grow.

Scenes

A scene describes:

  • its name
  • its width and height
  • the environment tile map
  • the optional environment collision map
  • the hierarchy of objects created when the scene loads

The scene root is editable in the hierarchy and inspector.

Typical scene-level fields are:

  • Name
  • Width
  • Height
  • Environment Tile Map
  • Environment Collision Map

Use the tile map for visible background art and the collision map for environment blocking data.

Hierarchy And Nesting

Scene objects can now be nested.

Use nesting when you want:

  • logical grouping
  • relative transforms
  • reusable parent objects with attached parts
  • cleaner hierarchy organization

Common examples:

  • a Player with a child Weapon
  • an EnemySpawner parent with child marker objects
  • a HUD root with grouped UI children

In the editor:

  • drag one object onto another to parent it
  • drag it onto the scene row to make it a root object again
  • drag it onto empty space in the hierarchy to unparent it back to the root

As a rule of thumb, keep scene roots meaningful. Do not leave every object at the top level if it clearly belongs under another object.

Game Objects And UI Elements

The editor currently supports creating:

  • GameObject
  • UIElement variants such as Label and Text

For game objects, the most common editable areas are:

  • transform
  • renderer
  • attached components

For UI elements, the common editable areas are:

  • position
  • size
  • text content

Prefabs

A prefab is a reusable object definition stored as a .prefab.php file under Assets/Prefabs.

Use prefabs when:

  • you want to spawn multiple copies of the same object
  • you want scene data and runtime spawning to share one source of truth
  • you want to pool objects such as bullets, enemies, or pickups

You can create prefabs in several ways:

  • Assets -> Shift+A -> Prefab
  • sendama generate:prefab <name>
  • export an existing scene object with Hierarchy -> Shift+E

Prefab editing happens immediately. It does not wait for Ctrl+S.

Texture And Tile Map Assets

Two of the most important asset types are:

  • .texture for sprite art
  • .tmap for tile map layouts

Use the Sprite tab to edit them.

Typical pattern:

  1. create a texture
  2. draw the sprite in the Sprite tab
  3. assign it to an object's renderer
  4. set the renderer crop rectangle with Offset and Size

Renderer and scene paths are typically written as asset-relative paths such as:

  • Textures/player
  • Textures/player.texture
  • Maps/level
  • Maps/level.tmap

Script And Event Assets

Scripts and events are PHP classes that live under the project asset tree.

Use generated scripts for:

  • gameplay behaviors
  • input handling
  • timers
  • pooling logic
  • collision reactions

Use generated events when you want project-specific event types or event-driven systems.

The editor can generate these files, but the actual PHP logic is still written in code.

Asset Renames And Deletes

Be careful with file operations.

Renaming behavior:

  • happens immediately
  • preserves file extensions
  • can update in-memory scene references
  • still needs Ctrl+S if you want the updated scene references persisted

Deletion behavior:

  • happens immediately after confirmation
  • does not automatically repair broken references elsewhere

Suggested Content Workflow

For a new gameplay feature, this sequence works well:

  1. Create or update a texture.
  2. Create or update a prefab for the reusable object.
  3. Attach scripts and set serialized values in the prefab.
  4. Place the prefab or related objects in a scene.
  5. Parent objects in the hierarchy where the relationship matters.
  6. Save the scene.
  7. Run the game and iterate.

Continue with Scripting and Gameplay for the code side of that workflow.