The original post was locked. However I have an update on progress.
I originally asked for a way to swap colors on a sprite to keep me from photoshoping the same sprite numerous times for color effects. Petr gave me this function... which works flawlessly.
FUNCTION swapcolor
(handle
, oldcolor~&
, newcolor~&
) a& = a& + 4
However I also happen to use this same function to make the sprites "flash" random colors when they take damage. The issue is when this is ran a few thousand times the game hard crashes without warning and without the "On Error" command catching it. When i run task manager the memory usage goes up and up until it reaches a point and the game window closes without warning. To be sure i disabled the use of this function and memory usage stays down and the game ran for two hours without a problem. _MEM is very new to me and I dont quite understand it yet.
So my questions are...
1)why is this happening? If it is using _MEMFREE to release m then in theory memory usage shouldn't climb like the way it is.
2)how could I fix this? and if not is there maybe a way to do this without using _MEM since i suspect that is the culprit.