Base TetraScript Object
All TetraScript objects inherit from this class. Includes all common properties, actions, and triggers.
- SpriteSheet path, hframes, vframes
- Sets the sprite sheet to the png file found at ‘path’. Splits frames by ‘hframes’ and ‘vframes’.
- ‘path’ – an image at “res://game/objects/stalfaux.png” would be typed in as “objects/stalfaux”. Omit the path before the world root and the file extension. Only png files are accepted.
- ‘hframes’ – amount of horizontal frames in the sprite sheet. Must be evenly spaced.
- ‘vframes’ – amount of vertical frames in the sprite sheet. Must be evenly spaced.
- Size width, height
- Creates capsule collision with ‘width’ and ‘height’.
- Plays ‘animation’ defined in Animations. anim_play(“throw”) will play an animation called “throw”
- Plays one of three animations based on object’s direction. Animations must be named “animUp”, “animDown”, and “animSide”. For example, anim_dir_play(“idle”) will play “idleUp”, “idleDown”, or “idleSide” depending on the object’s direction.
- Changes state. Use at the end of a state without triggers to run every action before it once and immediately go to another state.
- Triggers whenever the current animation is finished playing. Combine with anim_play(animation) to create animated state transitions.
- object_entered(radius, group)
- Triggers if an object in group is within ‘radius’. ‘group’ can be any object type, including enemy, player, etc. ‘radius’ is measured in pixels.
- object_exited(radius, group)
- Triggers if an object in group is outside of ‘radius’. ‘group’ can be any object type, including enemy, player, etc. ‘radius’ is measured in pixels.
- Triggers after inputted ‘length’ have passed.