I think I may be experiencing a similar issue. Or maybe I'm doing something wrong? I'm trying to create a simple function, the code is below. Whenever I run the program I am getting the 'Sprite does not exist at line 31'. Reading the above I assumed it was something to do with declaring the Sprite as global. However doing so, doesn't solve the issue either. I've been trying to solve this for the last hour or so and am now completely stumped... Do you have any ideas?
SetVirtualResolution (320, 480)
SetSyncRate(30, 1)
WoFImage = Loadimage("WoF.0.png")
WoFSprite = CreateSprite(WoFImage)
SetSpritePosition(WoFSprite, 10, 10)
ButtonImage = Loadimage("StopButton.png")
ButtonSprite = CreateSprite(ButtonImage)
SetSpritePosition(ButtonSprite, 15, 420)
SetSpriteVisible(ButtonSprite, 0)
do
if GetPointerPressed() = 1
Press = GetSpriteHit(GetPointerX(), GetPointerY())
endif
if Press = ButtonSprite AND GetSpriteVisible(ButtonSprite) = 1
// Do Something
Press = 0
endif
MyFunction()
Print(ScreenFPS())
Print(Press)
Print(GetSpriteVisible(ButtonSprite))
Sync()
loop
function MyFunction()
SetSpriteVisible(ButtonSprite, 1)
endfunction
Any help would be much appreciated,
Many thanks!