Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Why would you want to overwrite the sprites during runtime? Understanding your use case would help me evaluate if that’s a good fit for the engine or not.

I have been thinking about a game like Worms, with terrain destruction. The terrain would be kept on the sprite sheet and would be drawn with the sspr function. I can check for collision with the get_spr_px function, but I cannot make changes to the terrain, because there is no set_spr_px function.

I have made a similar game for PICO-8 and it allowed me to remap the screen and sprite sheet addresses in the drawing state, so I could manipulate the sprite sheet during runtime.

Could you use gfx.px instead to draw the pixels? Here’s an example that shows how to re-render a sprite pixel-by-pixel, which i think should allow you to do what you’re looking for: https://codeberg.org/brettchalupa/usagi/src/commit/cd7822d9dd26aac9ea01c970aa5ca90dac58cc4d/examples/px.lua#L70-L83