Skip to content

Add timed actions #27

@Longwelwind

Description

@Longwelwind

Timed actions would be a way to program the execution of an action in the future. This could have multiple usage:

  • It would be possible to create transition phase that just wait for 5 seconds before beginning a game or an other phase
  • To create soft realtime game, like a recreation of the Android game Subterfuge.

The API would roughly look like:

processAction(action) {
  if (action.type == "move-troops") {
    const time = this.computeTimeInMsForTroopToMove();
    this.planAction(time, {
      type: "troop-arrived",
      troop: action.troopId
    });
  }
}

processTimedAction(action) {
  if (action.type == "troop-arrived") {
    // Process the action
  }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions