03-23-2021, 02:55 PM
I'm testing out Tilengine with the CS binding and when making a simple character with an animation I keep getting an Invalid SequencePack error. I will admit that I'm using a 3 year old video as a tutorial of sorts so it's possible something changed since then and I just don't know it. I'll post my code below:
Code:
static int Main(string[] args) {
engine = Engine.Init(512, 288, 11, 30, 30);
engine.SetBackgroundColor(new Color(0x00, 0xCC, 0xCC));
engine.LoadPath = "assets/Sprites/Terri";
Spriteset ss = Spriteset.FromFile("TerriIdle.png");
SequencePack sp = SequencePack.FromFile("TerriIdle.sqx");
Sequence idle = sp.Find("idle");
Sprite sprite = new Sprite();
sprite.Setup(ss, TileFlags.None);
sprite.SetPosition(160, 120);
Animation anim = new Animation();
anim.SetSpriteAnimation(0, idle, 0);
int frame = 0;
Window window = Window.Create(null, WindowFlags.Vsync);
while (window.Process()) {
window.DrawFrame(frame);
frame += 1;
}
return 0;
}