8bit_gnosis [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=87901 Update #2 - Please help <p> <table><tr><td> <a href="/bbs/?pid=140599#p"> <img src="/bbs/thumbs/pico8_blocks-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=140599#p"> blocks</a><br><br> by <a href="/bbs/?uid=87901"> 8bit_gnosis</a> <br><br><br> <a href="/bbs/?pid=140599#p"> [Click to Play]</a> </td></tr></table> </p> <h1>My second progress update:</h1> <p>I'm trying to implement the ability for my player character to create temporary blocks which can be used as platforms to reach otherwise unreachable areas. The idea is that the bunny player character digs up earth which piles up behind him and then disappears after a few seconds. </p> <ol> <li>When the player presses the o button while on a ground tile, a 'newblock' is added to a table so that it can be deleted after its set duration. In order to ensure the original map tile is restored after the 'dirt block' disappears, mget is used to grab the original tile sprite as 'oldblock.'</li> </ol> <p><code>if btnp(🅾️) and p.landed then newblock={} newblock.spr=14 newblock.x=p.x newblock.y=p.y newblock.age=0 oldblock = mget(flr(p.x/8)-1,flr(p.y/8)) add(blocks,newblock)</code></p> <ol start="2"> <li>The block is drawn according to the coordinates stored in a table. The block is drawn behind the player based on whether the character sprite is flipped.</li> </ol> <p><code>function draw_block() for myblock in all(blocks) do if p.flp then mset((myblock.x/8)+2,(myblock.y/8),myblock.spr) else mset((myblock.x/8)-1,(myblock.y/8),myblock.spr) end end end</code></p> <ol start="3"> <li>The block is deleted from the table after it's aged past its duration and mset replaces the block with the original 'oldblock' variable.</li> </ol> <p><code>function update_block() for myblock in all(blocks) do myblock.age+=.1 if myblock.age&gt;10 then del(blocks,myblock) mset((myblock.x/8)-1,(myblock.y/8),oldblock) end end end</code></p> <h2>Problems</h2> <img style="margin-bottom:16px" border=0 src="/media/87901/block p8_0.gif" alt="" /> <p>There are multiple problems I'm encountering. </p> <ol> <li> <p>The dirt block doesn't always draw directly behind the player sprite but sometimes 2 tiles away.</p> </li> <li> <p>Two blocks are drawn if the player happens to move in the opposite direction immediately after the first block is drawn.</p> </li> <li> <p>The original map tile is not always stored and replaced. Frequently, the 'oldblock' variable will store the adjacent tile sprite instead.</p> </li> <li>If the button is held down, multiple dirt blocks are drawn and only the final one appears to delete.</li> </ol> <h2>Gratitude</h2> <p>If anyone has any insight into how to fix these problems, even it is simply nudging me in the right direction or pointing to a resource, you have my eternal gratitude. I'm still a complete novice at this. Thank you.</p> https://www.lexaloffle.com/bbs/?tid=139966 https://www.lexaloffle.com/bbs/?tid=139966 Thu, 25 Jan 2024 16:28:51 UTC First Blog Update <p> <table><tr><td> <a href="/bbs/?pid=139921#p"> <img src="/bbs/thumbs/pico8_fsatobugu-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=139921#p"> fsatobugu</a><br><br> by <a href="/bbs/?uid=87901"> 8bit_gnosis</a> <br><br><br> <a href="/bbs/?pid=139921#p"> [Click to Play]</a> </td></tr></table> This is my first blog update. I'm feeling a bit defeated. I'm not making meaningful progress any more. The progress I have made is all but entirely owed to tutorials from nerdy teachers and lazy devs. I'm now spending way more of my time trying to find relevant content to learn from than I am actually learning. I've spent hours combing through BBS posts, reddit, youtube, and discord. When I do find discussion that seems relevant to what I want do, it's rare that I am able to parse the code to learn from it. Trying to stay motivated and move forward.</p> <p>What I have thus far:<br /> -A running, jumping player sprite which I don't understand how to further animate without continuously looping through a cycle of sprites (How do I do a once-and-done animation?)<br /> -A functional camera that follows the player<br /> -Collision detection for the map tiles<br /> -An expanding and contracting field of view effect which I have no idea how to adjust due to the math involved.<br /> -A particle effect simulating kicked-up dirt whose location I'm not fully able to anchor behind the sprite when it's flipped.</p> <p>What I would like to have:<br /> -Some sort of animated background, perhaps glistening or dripping rocks.<br /> -Breakable tiles for a digging mechanic.</p> https://www.lexaloffle.com/bbs/?tid=139776 https://www.lexaloffle.com/bbs/?tid=139776 Tue, 09 Jan 2024 23:11:14 UTC Pressing start <p>My first post. I'm beginning this blog to document my progress in pursuing a passion project, the creation of my first game. The existence of Pico-8 and 'mini metroid-vanias' such as Metroid Crimson, The Ascent, and Subsurface have inspired me. I grew up with an NES and my finest childhood memories involved exploring the game worlds of Zelda and Metroid. My goal is to create a game with a focus on exploration and environmental puzzle solving with progression through an ability-gated game world. I lack programming experience and have a general aversion to math. I'm hopeful the community here will share its wisdom if I'm earnest in my attempt to understand conceptually all the code and math and I refrain from making a million requests for information.</p> <p>My progress so far: With the assistance of a set of super helpful youtube tutorials, I've created a player sprite capable of running and jumping using platformer controls. I've also managed to alter existing camera code to track the player character room by room.</p> <p>My current obstacle: Collision detection is proving to be a struggle. My player sprite is capable of landing on tiles of empty space. The code uses a combination of local variables and 'objects.' Conceptually I don't understand 'objects' and what the code is doing. Perhaps I need to turn my focus toward learning how Lua works.</p> https://www.lexaloffle.com/bbs/?tid=55545 https://www.lexaloffle.com/bbs/?tid=55545 Fri, 29 Dec 2023 19:28:00 UTC