F
FloresSottile
Guest
I have an object named oSpawner which creates objects named oAlternativeHolder for a Candy Crush look alike game but with numbers written in the "candy". I've been testing my game with subimages made in the GMS2 Editor for my sAlternativeHolder and never bumped into a problem until now that I changed the subimages. I even tried deleting the sprite sAlternativeHolder and creating it again, but I sill have this problem where the objects oAlternativeHolder are created but it's sprite drawn is missing.
I also checked that all sprites are good and not corrupted. I also cleaned cache with the broom icon and manually deleting the project from my temp data. This is the code i'm running for the selection of the subimage (which is selected randomly among all the subimages).
In oAlternativeHolder, Create Event:
Then, in the draw Event:
A workaround solution that I tried and didin't work either:
oAlternativeHolder, Create Event:
Then, in the Draw Event:
Both are giving me the exact same problem that never happened before with the sprites drawn in the Editor: the objects are created, but the sprite's subimages are not always being drawn or visible.
Lastly, this is my sprite, sAlternativeHolder: http://prntscr.com/psqnlz
Thanks in advance.
I also checked that all sprites are good and not corrupted. I also cleaned cache with the broom icon and manually deleting the project from my temp data. This is the code i'm running for the selection of the subimage (which is selected randomly among all the subimages).
In oAlternativeHolder, Create Event:
Code:
randomize();
ySpeed = random_range(0.3,0.6);
rotation = random_range(0.5,0.8);
image_index = irandom_range(0,sprite_get_number(sAlternativeHolder)-1); // Random selection between the sAlternative sprite subimages
Code:
draw_self();
draw_text(x,y,string(numberOnHolder));
oAlternativeHolder, Create Event:
Code:
randomize();
ySpeed = random_range(0.3,0.6);
rotation = random_range(0.5,0.8);
sub_img = irandom_range(0,sprite_get_number(sAlternativeHolder)-1);
Code:
draw_sprite_ext(sAlternativeHolder, sub_img, x, y, 1, 1, 0, c_white, 1);
draw_text(x,y,string(numberOnHolder));
Lastly, this is my sprite, sAlternativeHolder: http://prntscr.com/psqnlz
Thanks in advance.
Last edited by a moderator: