notnasiul [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=48821 pset not working with i32 userdata? <p>I'm creating an image using this</p> <p>texture = userdata(&quot;i64&quot;, 3, texture_width * texture_height )</p> <p>and setting it up like this</p> <p>p.texture:set(0,i,flr(xx),flr(yy),flr(1+(color_offset+(noise_value+1)*5)%30))</p> <p>which I can draw with</p> <p>pset(p.texture)</p> <p>and is properly drawn (it's the rectangular image)</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/48821/image.png" alt="" /> <p>But I don't need floats! I wanted to define it with i32 instead, like this</p> <p>texture = userdata(&quot;i32&quot;, 3, texture_width * texture_height)</p> <p>But then it's not drawn at all:</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/48821/image2.png" alt="" /> <p>Doesn't pset work with i32 userdata? Or should it and I'm doing something wrong? The only thing that changes here is how I define texture with f64 or i32...</p> https://www.lexaloffle.com/bbs/?tid=147654 https://www.lexaloffle.com/bbs/?tid=147654 Tue, 04 Mar 2025 14:11:47 UTC I may have hit a wall? Could I speed this up? <p>So I have this planet generator that creates a texture and a set of points as userdata, drawing the planet with a single pset(planet.points) line. But then I want to animate it so it looks like rotating. In each frame I get the UVs for each point, sample the texture with an offset and I get what you see in that image, but rotating. Looks nice.</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/48821/Captura de pantalla 2025-03-03 162426.png" alt="" /> <p>So far so good except because it's painfully slow - a planet with radius 32 is drawn at 15fps :(</p> <p>So I thought I could speed this up by precomputing UVs and got to something like this to update the animation:</p> <p>for i=1,planet.discArea do<br /> local tx,ty = planet.uvs:get(0,i,2)<br /> local xx,yy = planet.points:get(0,i,2)<br /> tx = (tx + planet.rotation) % texture_width<br /> local index = flr(ty) * texture_width + flr(tx)<br /> local a,b,c = planet.texture:get(0,index,3)<br /> planet.points:set(0,i,xx,yy,c)<br /> end</p> <p>Which got me exactly to the same outcome, at exactly the same fps :'(</p> <p>Given that I do have to iterate all points to get the new color from the texture based on the planet rotation, I fear I can't do much more to speed this up. Or could I? Would love to read ideas! :D</p> https://www.lexaloffle.com/bbs/?tid=147638 https://www.lexaloffle.com/bbs/?tid=147638 Mon, 03 Mar 2025 16:02:06 UTC Goblins' Gold <p> <table><tr><td> <a href="/bbs/?pid=84949#p"> <img src="/bbs/thumbs/pico8_playmedusa_goblinsgold-5.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=84949#p"> Goblins' Gold 1.0.5</a><br><br> by <a href="/bbs/?uid=48821"> notnasiul</a> <br><br><br> <a href="/bbs/?pid=84949#p"> [Click to Play]</a> </td></tr></table> </p> <p>Rumors say that goblins hide their most precious treasures deep within their nests. They guard it with their own lifes, so it must be quite valuable indeed! </p> <p>If you want the Goblins' Gold you must be tough, but also cautious and witty! Traverse 10 levels of goblin-infested rooms one step at a time, facing 8 different creatures, from the mindless slime to fearsome necromancers. </p> <h1>HOW TO PLAY:</h1> <ul> <li>Attack enemies by bumping into them. Your sword will do the job.</li> <li>Use the ZAP attack (X) to hit and stun (if they can be stunned) all enemies around you.</li> <li>Clear a room to find the stairs to the next level (grab all gold and kill all enemies)</li> <li>Do not rush! This is a turn based game. Some enemies are fast and weak, some slow and won't be stunned by your blows. They are easy to defeat when they are alone, but dangeours if they surround you!</li> <li>Make the most of your surroundings! Running head-first is not usually the safest option...</li> </ul> <h1>THANKS FOR PLAYING!</h1> <p>This was a side-side-project inspired by Jeremiah Reid's Broughlike tutorial, loosely translated to Pico-8 as a first contact with this wonderful fantasy console. </p> https://www.lexaloffle.com/bbs/?tid=40637 https://www.lexaloffle.com/bbs/?tid=40637 Wed, 02 Dec 2020 18:58:02 UTC