SquishyChs [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=46125 Editing sprites at runtime <p>I am trying to edit sprites at runtime (using a sprite to store a large map), I know the sprites can be resized and from what I can tell the limit is 512 pixels in dimension?</p> <p>I managed to draw to the sprite using set_draw_target() and then pset to draw the pixels I want, but I can't figure out how to then read the pixels! The guide mentions sset and sget which I know from pico8 but I can't make them work for some reason, I figured maybe I need to return the sprite as a user data with get_sprite but then sget doesn't seem to be a function of user data and can't find anywhere that explains how to use sget and sset.</p> <p>Also I know the sprites will reset when the game is run so how would I then overwrite the sprite with the edited version so I can save the generated map?</p> https://www.lexaloffle.com/bbs/?tid=150692 https://www.lexaloffle.com/bbs/?tid=150692 Sat, 02 Aug 2025 09:20:15 UTC Colour Tables (solved!) <p>I have looked around but been unable to find anything that clearly describes how best to utilise the colour table features of Picotron. I may just have missed it so if you know of a good resource please feel free to redirect me!</p> <p>So I was looking into the colour tables and from what I know so far, its a lookup table that describes which colour to use when colouring a pixel. By default I know that drawing over a colour with another (drawing red over blue for example) will just result in the new colour being placed, replacing the previous colour (so the pixel is now red in my example).</p> <p>I know that other colour blending techniques could take advantage of this, however I cant seem to figure out how to modify the values in the table. In a game I'm working on for example I would like to be able to draw a 'shadow' that is essentially just an oval using a predefined 'shadow colour', and it would darken each pixel it draws over by 1 'unit'.</p> <p>I suspect I would need to alter the values for the shadow colours 'row ' or 'column' in the colour table so it returns a different value but figuring out how is a mystery!</p> <p>I appreciate any tips or tutorials anyone comes up with!</p> <p>EDIT: I recommend Taxicomics' tutorial on how to do exactly this, lots of helpful points below but if you were hoping to do exactly what I do, please see their link below :)</p> https://www.lexaloffle.com/bbs/?tid=149436 https://www.lexaloffle.com/bbs/?tid=149436 Sun, 08 Jun 2025 16:57:36 UTC How to save data properly <p>I'm just curious how you might save data easily that would otherwise be a bit much for the usual 64 number limit of dset/dget. I am trying to store high scores and have tried a lot of things and just ended up confused, the data format is something like:</p> <p>AAA - time (minutes:seconds) - clicks<br /> (1 byte per letter) - (1 for m, 1 for s) - 1 for clicks &lt;---when I tried poke this is how I approached it</p> <p>I wish to store different scores for each difficulty so people can compete at different levels and probably about 10 scores per difficulty (though I don't mind going lower if I have to). I tried dset and dget but it didn't provide enough spaces for data, and so I was looking at peek and poke, I should be able to store it no problem then but then how do I make the data persistent? even though I saved to the persistent data area in memory, it is empty when I reload the game, do I need cstore? and if so, I read that that doesn't work with browser played games so it isn't really going to work for me either right?</p> <p>I also messed with the idea of using shifting bits to concatenate these values to store them into dset and dget but that had varying degrees of success, worked slightly but then would stop randomly so maybe I was using the wrong shifting, I think I tried shl() (I know there's a newer version though, &lt;&lt;&lt; right?)</p> <p>another thing I messed with for a while was generating a text file of high scores but then when I export as html, where would I need to put the blank text file? pretty sure I would need a blank file there by default otherwise using #include will cause an error...</p> <p>as you can see there's a huge web of trains of thought here and I keep coming up blank with them because I feel I'm misunderstanding something small that ties it all together haha, I just want high scores that can run through itch.io</p> <p>Hopefully you kept up with all this, if you understand this stuff and are happy to help but need more info about anything, please let me know and I can provide details :)</p> https://www.lexaloffle.com/bbs/?tid=43093 https://www.lexaloffle.com/bbs/?tid=43093 Thu, 27 May 2021 21:33:42 UTC Editing spritesheet at runtime? <p>Is there any way of editing the spritesheet at runtime so that I can use the spritesheet as the save location for a game?</p> <p>The game consists of a 32x32 grid but each grid can have many states so figured I could store that as binary, but that doesn't really work well with the cart data limitations. So I figured if I can store the information to the spritesheet, I'm just utilising the memory available there but I cant seem to find much documentation on the matter. I know there is sget/sset but when I used that the screen had alternating colour lines appear... (I think I was putting it on the lower half of the spritesheet if that might be part of the issue?)</p> <p>Maybe a text file would be better?</p> https://www.lexaloffle.com/bbs/?tid=42866 https://www.lexaloffle.com/bbs/?tid=42866 Wed, 12 May 2021 10:23:09 UTC