Sprite buffer full (SOLVED)

Hi, im generating sections of level for an endless runner style game. the tile map is under a game object called ‘map’ theres a script attached to the map game object that detects when its off screen, and removes the game object.

despite this, as the game progresses, i soon get this message - Sprite could not be created since the sprite buffer is full (128).

so what exactly is the sprite buffer? and how come its full even though I’m removing the tile maps when they’re no longer in play?

Sprite buffer is just limit on active sprites. You can set higher in game.project - but it sounds like something is not working correctly in method of removing the game objects.

What’s the code look like for detecting off-screen and removing? Should be using go.delete()

1 Like

hey thanks for the reply.

heres the code I’m running on the map go (which contains the tile map)

function update(self, dt)
if go.get(".",“position.y”) > go.get(“main:/camera”,“position.y”) + 1000 then
go.delete()
end
end

in this game the player moves down so I’m just detecting if the map segment is some arbitrary distance behind the camera (1000) and ill refine it later. its getting deleted but the sprite buffer still returns full when i generate new maps.

the only other sprites are some other game objects which run the same delete code.

Are you sure they get deleted? Add a print() in the final() function of a script attached to the objects that are supposed to get deleted. Do you see the print statements in the console?

1 Like

Also, how are the new maps being generated? by factory?

hey thanks britzl and decoded, turns out they weren’t getting deleted as expected, the questions you asked sent me in the right direction. Thanks so much!

3 Likes