11-02-2024, 10:52 PM
Hi to all !!!
I will try to explain myself with my limited english ?
I am making a space shooting/strategy game that loads multiple images. I have a main image (ship) and when it is attacked I load two different images in other two layers (shields impact, damages made to the ship). Last thing I do is _PUTIMAGE of these three layers. During the game I use _LOADIMAGE to change the images of these layers, and there are several ships in the game with the same three layers.
I noticed that when I start my game, the Windows task manager shows some RAM used, and as I am playing it this RAM is increasing.
I know the _FREEIMAGE command, but my code is very large and I find very difficult to check when to use it...
Also I noticed that when I execute a _LOADIMAGE command, and some time later I execute this command over the same variable the memory is still increasing. I thought that when using the same variable the RAM occupied was the same... obviously I was wrong
Is there any way to re-use some LONG variable to load several images without having to _FREEIMAGE between every load? I thought to make a SUB that makes a _FREEIMAGE in the variable just before load an image, but it goes wrong a lot of times
Anybody can help me? Thank you !!!
I will try to explain myself with my limited english ?
I am making a space shooting/strategy game that loads multiple images. I have a main image (ship) and when it is attacked I load two different images in other two layers (shields impact, damages made to the ship). Last thing I do is _PUTIMAGE of these three layers. During the game I use _LOADIMAGE to change the images of these layers, and there are several ships in the game with the same three layers.
I noticed that when I start my game, the Windows task manager shows some RAM used, and as I am playing it this RAM is increasing.
I know the _FREEIMAGE command, but my code is very large and I find very difficult to check when to use it...
Also I noticed that when I execute a _LOADIMAGE command, and some time later I execute this command over the same variable the memory is still increasing. I thought that when using the same variable the RAM occupied was the same... obviously I was wrong
Is there any way to re-use some LONG variable to load several images without having to _FREEIMAGE between every load? I thought to make a SUB that makes a _FREEIMAGE in the variable just before load an image, but it goes wrong a lot of times
Anybody can help me? Thank you !!!
10 PRINT "Hola! "
20 GOTO 10
20 GOTO 10