Hmmm, that's interesting... I tried adding the filter I mentioned around the createSprites lines in the main do loop and the FPS decreases as it's running meaning that every loop it must be creating 7 new sprites, ignoring the getSpriteExists filter.
Most of my sprites are loaded in a preload function which is only called once so I'm not experiencing this problem in my project but I have noticed some slowness and I'm often checking to see if a sprite exists before creating it so I may have to re-look at my code.
Here's the code that shows the number of sprites increase, fps decrease and the getSpriteExists() functions being ignored each loop
do
if (getSpriteExists(testSprite1) = 0)
testSprite1 = createSprite(0)
setSpritePosition(testSprite1, 50, 50)
endif
if (getSpriteExists(testSprite2) = 0)
testSprite2 = createSprite(0)
setSpritePosition(testSprite2, 50, 50)
endif
if (getSpriteExists(testSprite3) = 0)
testSprite3 = createSprite(0)
setSpritePosition(testSprite3, 50, 50)
endif
if (getSpriteExists(testSprit4) = 0)
testSprite4 = createSprite(0)
setSpritePosition(testSprite4, 50, 50)
endif
if (getSpriteExists(testSprite5) = 0)
testSprite5 = createSprite(0)
setSpritePosition(testSprite5, 50, 50)
endif
if (getSpriteExists(testSprite6) = 0)
testSprite6 = createSprite(0)
setSpritePosition(testSprite6, 50, 50)
endif
if (getSpriteExists(testSprite7) = 0)
testSprite7 = createSprite(0)
setSpritePosition(testSprite7, 50, 50)
endif
print(GetManagedSpriteDrawnCount())
print(ScreenFPS())
sync()
loop
I added print(getSpriteExists()) lines at the top of the loop and they all showed 1 so maybe I'm writing the if lines wrong?!
the12thplaya