Animation
Plays frames of the entity’s sprite sheet: FrameCount frames starting at FirstFrame. For several animations on one sheet, name them in Clips and switch with Play.
Requires: Sprite (its image is the sprite sheet)
Properties
Section titled “Properties”Each is listed as its key in the scene file and the MCP tools, then its kind of value, its default and what it does.
firstFrame: a whole number = 0. The sheet’s frame it starts on, counting from 0 along the top row, then the next. (Field: a number.)frameCount: a whole number = 4. How many frames it plays, from FirstFrame on. (Field: a number.)framesPerSecond: a number = 10. How fast it plays, in frames per second. (Field: a number.)loop: true or false = true. Starts over after the last frame; off stops on it. (Field: on or off.)playing: true or false = true. Whether it’s playing now; off holds the frame it’s on. (Field: on or off.)clips: text = null. Named animations on the sprite sheet, separated by commas: a name, a frame or range of frames, and optionally a speed and whether it plays once, e.g. Idle 0-3, Run 4-9 @12, Jump 10, Die 11-15 @8 once. A range written high to low plays backward: Open 0-3 once, Close 3-0 once. (Clips, separated by commas: a name, a frame or range of frames, then optionally @speed (frames a second) and once or loop, e.g. “Idle 0-3, Run 4-9 @12, Die 11-15 @8 once”. The Inspector lists them a row each; the Clip Editor (Art > Animation Clips) plays them.) (Field: its own editor: Clips.)clip: text = null. The clip playing, by name, e.g. “Idle”. While it names one of Clips, its frames are shown instead of FirstFrame and FrameCount. Set it in the Inspector to pick the clip the game starts with. (Names one of its clips (Clips); the Inspector picks from them and flags a name that isn’t one. Empty for none.) (Field: its own editor: Choice Of.)time: a number = 0. Seconds into the current animation; restart by setting to 0. Kept with the scene, so a rewind or a saved game comes back to the frame it was on (and the boxes of a Hitboxes with it); give a row of torches different times so they don’t flicker in step. (Not sent in a network game: each machine has its own.) (Field: a number.)
While the game runs
Section titled “While the game runs”Not saved with the scene; scripts read them, and entity_get shows them as live while the game plays.
clipNames: lines of text: an array of strings, or one string with line breaks. The names of its Clips, in order: what Clip can name.finished: true or false. True once a non-looping animation has shown its last frame.
Scripts use it as Animation: its methods, events and values that aren’t saved with the scene.