Manual

Scripting and Gameplay

This page is a gameplay workflow map.

For deeper learning, use the focused guides linked here.

Choose Your Task

Core Gameplay Loop

  1. create or update a script
  2. attach it to a scene object or prefab
  3. tune serialized fields in inspector
  4. save scene with Ctrl+S when scene data changed
  5. run sendama play and validate behavior

Minimal Behavior Example

<?php

use Sendama\Engine\Core\Behaviours\Behaviour;

final class Rotator extends Behaviour
{
    public function onUpdate(): void
    {
        $this->getTransform()->rotateBy(1, 0);
    }
}

When To Split Features Across Scripts

Create separate scripts when behaviors have different reasons to change.

Example split:

  • PlayerMove for movement input
  • PlayerWeapon for shooting and cooldowns
  • PlayerHealth for life and damage logic

This keeps debugging and balancing much easier.

Next Step

Use Playtesting and Debugging to verify behavior reliably.