# aego/action

> Aego 0.12.5 · development; docs build `4a32b816933e02930662f6a443cb25abe6050d090c55e237cbff5c44ae9b25f8`. [Build manifest](/docs-build.json).

Build the action in one frame: `Sequence` or `Parallel`, then `Then`, `ThenTimer`, `ThenAction` and `Wait`. It starts at the next tween update; `yield` it to wait for the end. In a project, attach it to a node with a Sprite Renderer. See [Actions](/tween/actions.md).

## Example

```aes run
package demo

import (
    "aego/action"
    "aego/curve"
    "aego/log"
    "aego/timer"
    "aego/tween"
)

script Door {
    func Ready() {
        start Open()
    }

    func Open() coroutine {
        shake := action.Parallel().
            Then(tween.ToFloat(node, "transform.rotation", 0.1, 0.1, curve.OutQuad).PingPong(4)).
            ThenTimer(timer.Start(0.3))
        a := action.Sequence().
            ThenAction(shake).
            Wait(0.2).
            Then(tween.Position(node, Vec2{0, -2}, 0.5, curve.InOutCubic))
        a.Completed.Connect(OnOpened)
        log.Info("opening, running: " + string(a.Running()))
        yield a
        log.Info("door at y=" + string(node.Position().Y) + ", done: " + string(a.Done()))
    }

    func OnOpened(finished bool) {
        log.Info("action finished: " + string(finished))
    }
}
```

## Parallel

```
func Parallel() Handle<aego/action.Action>
```

Makes an action that runs all its steps at once and ends after the last one.

## Sequence

```
func Sequence() Handle<aego/action.Action>
```

Makes an action that runs its steps one after another, starting at the next tween update.
