Discord
Login
Community
DARK THEME

Clearing sprites offscreen command?

I possibly may have missed an easier way to do this, if so this can be a "help" post :P

But maybe could there be a command such as screen.clearSprite - or something similar. So far the best idea I've worked out for "Deleting" sprites is having an "if" statement for the draw script (although I'm not sure if it works, lol)

But maybe having a simplified way to clear a sprite would helpful when something is destroyed.

if alive == 1 then
 drawExampleSprite()
end

drawExampleSprite = function()
 screen.drawSprite(example)
end

As far as I understand, all the sprites are actually cleared after screen.clear(), so the conditional screen.drawSprite() inside the main draw() should work ;)

Ok, thank you :)

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community