preppie [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=71883 Feature Request: Two colours in Sprite Editor <p>I'm sure this must have been requested before but I'll post this anyway.</p> <p>Please could you give a second colour to the right click in the sprite editor. This would make deleting mistaken pixels so much easier.</p> <p>A second tile in right click for the map editor would be great too.</p> <p>Thanks.</p> https://www.lexaloffle.com/bbs/?tid=50327 https://www.lexaloffle.com/bbs/?tid=50327 Wed, 23 Nov 2022 07:28:07 UTC Map Tile Animation <p>I'm new to PICO-8 so please forgive me if something simlar has already been posted (I searched and couldn't find what I wanted)</p> <p>I wanted to be able to draw on the map and then have some of those map tiles animated.</p> <p>The following code will animate a map tile by copying memory from a number of sprites to a main sprite which you draw on the map.</p> <p>The main sprite must be immediatly followed by the animation frames, and (for simplicity of code) all frames must be on the same row of the sprite sheet. This gives a max of 15 frames of animation in a row, with 1 main sprite.</p> <p>Animation is by rotation (frame 1,2,3,4,1,2,3,4 etc) if you want ping-pong (1,2,3,4,3,2,1,2,3,4 etc) you'll need to tweak the code. </p> <p>Please forgive my code, I've never used LUA before - I'm used to Atari BASIC and 6502 Assembler. I'm sure this can be done better, so if someone more experianced with LUA would like to re-write it then that would be great.</p> <p> <table><tr><td> <a href="/bbs/?pid=121099#p"> <img src="/bbs/thumbs/pico8_zorubegoh-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=121099#p"> zorubegoh</a><br><br> by <a href="/bbs/?uid=71883"> preppie</a> <br><br><br> <a href="/bbs/?pid=121099#p"> [Click to Play]</a> </td></tr></table> </p> <p>There are 5 paramters of map_animator{a,b,c,d,e}</p> <p>a=sprite number to animate<br /> b=number of frames<br /> c=current frame (set this to 1, the function will change it)<br /> d=speed (1= every frame, 2=every 2 frames etc. if you set this to 0 the animation will stop)<br /> e=speed counter (set it to 0, function will change it)</p> <p>if you want multiple tiles to animate then add an additional group of 5 parameters</p> <p>You'll need to call it once for every tile that animates, so if you have 2 tiles you do:</p> <p>map_animate(1)<br /> map_animate(2)</p> <p>Hope this is useful for someone.</p> <p>edit. If you don't want to use up all your sprite sheet with frames you could store the animation frames data in a table and copy it to the main tile and just have your main tile in the sprite sheet. If I'm correct in the way that integers are stored then it would take 4 tokens per frame.</p> <p>edit2: I just realised that strings cost same tokens regardless of how big they are, so you could use a single string to store as many frames as you want for minimal tokens.</p> https://www.lexaloffle.com/bbs/?tid=50293 https://www.lexaloffle.com/bbs/?tid=50293 Mon, 21 Nov 2022 09:14:08 UTC