• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

QUESTION: Editing tracks of a running sequence

sammaster9

Member
Hello,

I have a sequence where I want to move about 10 sprites around. These will be sprites representing cards chosen by the player.

However, I won't know which 10 sprites to choose until the player has chosen the cards.

Is there a way to make a sequence to move the sprites how I'd like them to be moved, and then insert the 10 sprites into the sequence before the sequence is ran?

I've been reading through the documentation. I'd like to create the sequence itself in the sequence editor, and then use GML to change the sprite_index of each track in the sequence to the appropriate card sprite, before running the sequence.
In the example code in the documentation, they do this:


var graphickeydata = array_create(1);
graphickeydata[0] = sequence_keyframedata_new(seqtracktype_graphic);
graphickeydata[0].spriteIndex = spr_Platform;


Is there code to get a track, and then change the spriteIndex via gml?

Any suggestions would be appreciated. Thank you.
 
Hello! According to the manual, elements of a sequence can also be instances. I've never used sequences before but I guess you could create the sequence using 10 objects without sprite, and then change their sprites according to the player's choice.
 
Top