I encounter a small problem, I created a factory linked to my player object to generate bullets and when they encounter an obstacle they are supposed to be destroyed, here is roughly the script of my bullets:
function init(self)
self.pos = go.get_position()
end
function update(self, dt)
self.pos.y = self.pos.y + 400 * dt
go.set_position(self.pos)
end
function on_message(self, message_id, message, sender)
if message_id == hash("contact_point_response") then
go.delete()
end
end
My problem is that very quickly I come across this error:
ERROR:GAMESYS: Sprite could not be created since the sprite buffer is full (128). See 'sprite.max_count' in game.project
ERROR:GAMEOBJECT: Could not spawn an instance of prototype /main/game/gObjects/bullet.goc.
Doesn’t the go.delete()
function completely deallocate a created object? By that I mean sprites or other assets related to it?
I also find it a bit strange that the same image is reallocated every time for the same objects, maybe I’m doing something wrong?