-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Description
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
}
}