<commit_before><commit_msg>Added Crate<commit_after>
import luxe.options.ComponentOptions;
import luxe.options.SpriteOptions;
import luxe.Rectangle;
import luxe.Sprite;
import luxe.Vector;
import luxe.components.sprite.SpriteAnimation;

class Crate extends Sprite
{
    
    var anim:SpriteAnimation;

    override public function new(options:CrateOptions)
    {
        options.name = 'crate';
        options.name_unique = true;
        options.texture = Luxe.resources.texture('assets/images/crate.gif');
        options.size = new Vector(16,16);
        options.centered = true;
        options.depth = 7;

        super(options);

        this.texture.filter_mag = nearest;
        this.texture.filter_min = nearest;
    }

    override function init()
    {
        anim = new SpriteAnimation({ name:'anim' });
        add( anim );

        var animation_json = '
            {
                "idle" : {
                    "frame_size":{ "x":"16", "y":"16" },
                    "frameset": ["1"],
                    "loop": "true",
                    "speed": "12"
                },
                "held" : {
                    "frame_size":{ "x":"16", "y":"16" },
                    "frameset": ["1"],
                    "loop": "true",
                    "speed": "12"
                },
                "flying" : {
                    "frame_size":{ "x":"16", "y":"16" },
                    "frameset": ["1"],
                    "loop": "true",
                    "speed": "12"
                }
            }
        ';

        anim.add_from_json( animation_json );
        anim.animation = 'idle';
        anim.play();

    }

    override public function ondestroy()
    {
        anim.stop();
        anim = null;
        this.geometry.drop();
    }

}

typedef BombOptions = {
    > SpriteOptions,
}
{'fraction_non_alphanumeric': 0.13879781420765028, 'fraction_numerical': 0.014207650273224045, 'mean_word_length': 1.457718120805369, 'pattern_counts': {'":': 18, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2914958', 'n_tokens_mistral': 547, 'n_tokens_neox': 509, 'n_words': 99}