Hello, in the game im working on, I have quite a few sprites. about 15000 I think. But I noticed something when working on menus today, when i go back to the main menu, I clear all media with this code
for i = 1 to 50000
if GetSpriteExists(i)
DeleteImage(GetSpriteImageID(i))
DeleteSprite(i)
endif
if GetTextExists(i)
DeleteText(i)
endif
next i
I started it at 10000, but when I went back to the menu, the sprites used there didn't show up. So I changed to 20000, and it worked, but only the first time. when I started the game and went back to the menu again the sprites didn't show up. When I changed it to 50k, I can go back to the menu a few times, but after a while, it dosn't show up. This suggests that when you delete a sprite, the ID slot dosn't open up again and the game creates new sprites with higher ID's. Is this the case, and is there a way to avoid it. Because when you get up to 50000 sprites to chek, you start to notice a short black screen.
Edit The effect is defenitivley noticable on an android device.
Also, come to think of it, the math dosn't add up, my game uses 10k sprites for the ground, and about 5k for plants ect. That means that there are 15k sprites, and automatic sprite ID's start at 10k. Therefore, after 1 run, the highest sprite ID should be 25k, but the menu loads fine when only 20k sprites are deleted. Do you have any idea about what could be causing this.