Hi okee,
There is only a small overhead to creating and deleting sprites, I create my own particle systems which create a lot of sprites when needed and there is absolutely no noticeable slow down. I normally load all the media at the start for a relatively small game and then create sprites for each scene / menu / level as required.
On larger games I have loaded media for each level as needed but I think it's pretty unnecessary to do that unless you're using a lot of large images or sound files.
I store my images in a user friendly Used Defined Type (UDT). Something like this:
// Set up Data Structures
type imageType
background as integer
player as integer
endtype
global image as imageType
global background as integer
global player as integer
// Call the function (below) for loading media
LoadMedia()
// Create scene
LoadScene(1)
// Start Game loop
do
// Add your game logic here
`example
SetSpritePositionByOffset(player, GetSpriteXbyOffset(player)+GetDirectionX(), GetSpriteYbyOffset(player)+GetDirectionY())
Sync()
loop
// functions
function LoadMedia()
image.background = loadImage("backgroundImage.png")
image.player = loadImage("playerImage.png")
endfunction
function LoadScene(num)
select num
case 1
// Create Sprites
background = CreateSprite(image.background)
SetSpriteSize(background, GetDeviceWidth(), GetDeviceHeight())
player = CreateSprite(image.player)
SetSpritePositionByOffset(player, GetDeviceWidth()/2, GetDeviceHeight()/2)
endcase
case 2
// Add more scenes like this
`...
endcase
endselect
endfunction
Using AppGameKit V2 Tier 1