Clock

From Castle Wiki
Revision as of 16:20, 12 May 2022 by Ben (talk | contribs) (ADD ZE CLOCK)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The Clock is a system for measuring time in Cards. It is useful for adding rhythmic events and logic to games, in particular when combined with the Music behavior, but it can be used by itself for anything where you need to measure time in a structured way.

Clock units

The clock measures time in bars, beats, and steps. Bars are the largest unit of time, several beats make up a bar, and several steps make up a beat. By default, there are four steps to a beat, and four beats to a bar.

The clock has a tempo measured in beats per minute. By default, the clock starts at 120 bpm.

Clock scope

There is one clock shared across the entire card. All of the Music across all of the Actors in the card will synchronize to the clock, and all time-related Rules in the card have the option of synchronizing to the clock.

When the player moves between cards in the same deck, the previous card's clock will finish its current bar before adopting the settings in the next card's clock. This means that if both cards share the same clock settings, any music which was already playing won't get interrupted by the navigation between cards.

Modifying the clock

From the editor, press the Gear icon at the top of the screen to open the Card Settings sheet. Then navigate to the Clock tab on that sheet. From here you can change the beats per bar, steps per beat, and tempo which will be used when the card starts.

While the card is playing, you can use the Set clock tempo response inside a Rule to change the tempo. You can read the current tempo using the Clock tempo Expression.