I'm trying to implement a puzzle that involves sorting some objects that are initially randomly oriented. The code below was intended to initialize the objects orientation but instead of replacing the object's sprite with a rotated sprite, the objects get the famous blue cup sprite. Any suggestions for what I'm doing wrong? Thanks.
Code: ags
function room_Load(){
DynamicSprite* sprite[19];
for(int i=0;i<19;i++){
sprite[i] = DynamicSprite.CreateFromExistingSprite(object[i].Graphic);
int starting_rotation=Random(3);
if (starting_rotation!=0){
sprite[i].Rotate(starting_rotation*90);
object[i].Graphic=sprite[i].Graphic;
sprite[i].Delete();
}
}
}