Nenga [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=62648 Space Rogue! (Update 1.2) <p><strong> <strong><strong>____</strong></strong> SPACE ROGUE! ____</strong></p> <p>UPDATE 1.2:</p> <p>-- increased bullet starting speed &amp; slightly decreased amount of cooldown per upgrade<br /> -- slightly decreased starting bomb cooldown<br /> -- decreased XP gems movement</p> <p>Small little tweaks to the game play to make it more engaging &amp; a bit more fast paced. Hope you guys enjoy!!!!</p> <p>Embark on a mission to destroy the enemy aliens!!!!!</p> <p>Upgrade your ships weapons as you power up in this Space Invader/Roguelike mash-up!</p> <p>How many enemies can you defeat before re-upgrading your ship?</p> <p> <table><tr><td> <a href="/bbs/?pid=146180#p"> <img src="/bbs/thumbs/pico8_spacerogue_2324-3.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=146180#p"> space rogue 1.2</a><br><br> by <a href="/bbs/?uid=62648"> Nenga</a> <br><br><br> <a href="/bbs/?pid=146180#p"> [Click to Play]</a> </td></tr></table> </p> https://www.lexaloffle.com/bbs/?tid=141583 https://www.lexaloffle.com/bbs/?tid=141583 Tue, 09 Apr 2024 17:07:51 UTC Making upwards &amp; downwards animations <p>So I've created this code to make walking animations:</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>if plr.walking then if time()-plr.anim&gt;.1 then plr.anim=time() plr.sp+=1 if plr.sp&gt;5 then plr.sp=2</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>also added this for idle sprite:</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>if not plr.walking then plr.sp=1</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>However I can't figure out a way to change the sprite to the upward/downward movement sprites (spr 6-9, sprite 10-13) without having the code overwirte the plr.sp eachframe</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>if plr.upmove then plr.sp=6 #Do anim function</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>as far as I've gotten is making the sprite change to the correct movement sprite and then have it iterate back to the idle animation or animate to the very next frame and revert back to the first forward sprite</p> https://www.lexaloffle.com/bbs/?tid=46480 https://www.lexaloffle.com/bbs/?tid=46480 Sun, 06 Feb 2022 19:10:51 UTC Wall/Tile Collision not properly working <p>Hello!<br /> I've started learning how to do some programming with Pico-8 and am following a youtube tutorial (<a href="https://www.youtube.com/watch?v=T9z6RPvyypE">https://www.youtube.com/watch?v=T9z6RPvyypE</a>)</p> <p>I've been typing the same code more or less and have encountered a problem with wall collision.</p> <p>It seems that my player character will move through certain tiles I've flagged as walls and there are also invisible walls on tiles that are not flagged at all. </p> <p>code for collision:</p> <p>function is_tile(tile_type,x,y)<br /> tile=mget(x,y)<br /> has_flag=fget(tile,tile_type)<br /> return has_flag<br /> end</p> <p>function can_move(x,y)<br /> return not is_tile(wall,x,y)<br /> end</p> <p>and the code for player movement/wall detection:</p> <p>function move_player()<br /> newx=plr.x<br /> newy=plr.y</p> <pre><code>if (btnp(⬅️)) newx-=1 if (btnp(➡️)) newx+=1 if (btnp(⬆️)) newy-=1 if (btnp(⬇️)) newy+=1 if (can_move(newx,newy)) then plr.x=mid(0,newx,127) plr.y=mid(0,newy,63) else sfx(0) end</code></pre> <p>end</p> <p>not sure this happens, the youtubers character is able to move and hit the proper tiles and I haven't changed much in my code compared to his. </p> https://www.lexaloffle.com/bbs/?tid=46370 https://www.lexaloffle.com/bbs/?tid=46370 Sat, 29 Jan 2022 21:03:24 UTC