uncertifiedloaf [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=99018 checkpoints don't work (then expected near &quot;=&quot;) <p> <table><tr><td> <a href="/bbs/?pid=155806#p"> <img src="/bbs/thumbs/pico8_borurisajo-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=155806#p"> borurisajo</a><br><br> by <a href="/bbs/?uid=99018"> uncertifiedloaf</a> <br><br><br> <a href="/bbs/?pid=155806#p"> [Click to Play]</a> </td></tr></table> <br /> not exactly sure how to layout the code, but so far i have these:<br /> in the init_game, level=1<br /> when the level 2/3/4 door is entered, the level is set to 2/3/4<br /> but, im not exactly sure how to make the code work for the checkpoint. how can i fix this??</p> <p>AND BEFORE I FORGET how can i make the level 4 camera work?</p> https://www.lexaloffle.com/bbs/?tid=144771 https://www.lexaloffle.com/bbs/?tid=144771 Wed, 16 Oct 2024 22:09:40 UTC help printing after collecting item <p> <table><tr><td> <a href="/bbs/?pid=155470#p"> <img src="/bbs/thumbs/pico8_sogahugasu-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=155470#p"> sogahugasu</a><br><br> by <a href="/bbs/?uid=99018"> uncertifiedloaf</a> <br><br><br> <a href="/bbs/?pid=155470#p"> [Click to Play]</a> </td></tr></table> <br /> hey everyone, having some trouble.<br /> im trying to make it so that when you collect the emerald a bit into the first level, it prints &quot;gem get!&quot; next to it.<br /> however, when I collect it, nothing happens.<br /> i would also like the text to disappear after a few seconds. how would I do that?</p> <p>the emerald code is in tab 5 under function upickups2(). apologies if any of the code is difficult to read, I'm pretty new to this.</p> <p>also, any further feedback for the game is much appreciated!</p> <p>(please don't mind the door sprites at the beginning of the level, its just for debug purposes so that I can test level 2 quickly!)</p> https://www.lexaloffle.com/bbs/?tid=144655 https://www.lexaloffle.com/bbs/?tid=144655 Wed, 09 Oct 2024 02:06:24 UTC multimedia demo banana potassium <p> <table><tr><td> <a href="/bbs/?pid=152712#p"> <img src="/bbs/thumbs/pico8_yedafenune-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=152712#p"> multimedia demo banana potassium</a><br><br> by <a href="/bbs/?uid=99018"> uncertifiedloaf</a> <br><br><br> <a href="/bbs/?pid=152712#p"> [Click to Play]</a> </td></tr></table> <br /> just a test for my multimedia game</p> https://www.lexaloffle.com/bbs/?tid=143688 https://www.lexaloffle.com/bbs/?tid=143688 Thu, 15 Aug 2024 22:52:32 UTC attempt to index global 'funtion name' (a nil value) <p>same as title, its trying to call player1 but isnt able to?<br /> im relatively new to coding so idrk how to fix this</p> https://www.lexaloffle.com/bbs/?tid=143564 https://www.lexaloffle.com/bbs/?tid=143564 Fri, 09 Aug 2024 02:06:47 UTC cant climb on a climbable wall <p>the thing is, this error only happens when I attempt to make a climbable wall.<br /> here's my setup:</p> <p>my collisions page:</p> <p>--collisions</p> <p>function collide_map(obj,aim,flag)<br /> --obj = table needs x,y,w,h<br /> --aim = left,right,up,down</p> <p>local x=obj.x<br /> local y=obj.y<br /> local w=obj.w<br /> local h=obj.h</p> <p>local x1=0 local y1=0<br /> local x2=0 local y2=0</p> <p>if aim==&quot;left&quot; then<br /> x1=x-2 y1=y<br /> x2=x-1 y2=y+h-1</p> <p>elseif aim==&quot;right&quot; then<br /> x1=x+w+2 y1=y<br /> x2=x+w+1 y2=y+h-1</p> <p>elseif aim==&quot;up&quot; then<br /> x1=x+3 y1=y-1<br /> x2=x+w-3 y2=y</p> <p>elseif aim==&quot;down&quot; then<br /> x1=x+2 y1=y+h<br /> x2=x+w-3 y2=y+h<br /> end</p> <p>--player hitbox test<br /> x1r=x1 y1r=y1<br /> x2r=x2 y2r=y2</p> <p>--pixels to tiles<br /> x1/=8 y1/=8<br /> x2/=8 y2/=8</p> <p>if fget(mget(x1,y1), flag)<br /> or fget(mget(x1,y2), flag)<br /> or fget(mget(x2,y1), flag)<br /> or fget(mget(x2,y2), flag) then<br /> return true<br /> else<br /> return false<br /> end</p> <p>end</p> <p>my player page:<br /> --player<br /> function player_update()<br /> --physics<br /> player.dy+=gravity<br /> player.dx*=friction</p> <p>--controls<br /> if btn(⬅️) then<br /> player.dx-=player.acc<br /> player.running=true<br /> player.flp=true<br /> end<br /> if btn(➡️) then<br /> player.dx+=player.acc<br /> player.running=true<br /> player.flp=false<br /> end</p> <p>--slide<br /> if player.running<br /> and not btn(⬅️)<br /> and not btn(➡️)<br /> and not player.falling<br /> and not player.jumping then<br /> player.running=false<br /> player.sliding=true<br /> end</p> <p>--jump<br /> if btnp(❎)<br /> and player.landed then<br /> player.dy-=player.boost<br /> player.landed=false<br /> end</p> <p>--check collision up and down<br /> if player.dy&gt;0 then<br /> player.falling=true<br /> player.landed=false<br /> player.jumping=false</p> <pre><code>player.dy=limit_speed(player.dy,player.max_dy) if collide_map(player,&quot;down&quot;,0) then player.landed=true player.falling=false player.dy=0 player.y-=((player.y+player.h+1)%8)-1 end</code></pre> <p>elseif player.dy&lt;0 then<br /> player.jumping=true<br /> if collide_map(player,&quot;up&quot;,1) then<br /> player.dy=0<br /> end<br /> end</p> <p>--check collision left and right<br /> if player.dx&lt;0 then</p> <pre><code>player.dx=limit_speed(player.dx,player.max_dx) if collide_map(player,&quot;left&quot;,1) then player.dx=0 end</code></pre> <p>elseif player.dx&gt;0 then</p> <pre><code>player.dx=limit_speed(player.dx,player.max_dx) if collide_map(player,&quot;right&quot;,1) then player.dx=0 end</code></pre> <p>end</p> <p>--stop sliding<br /> if player.sliding then<br /> if abs(player.dx)&lt;.2<br /> or player.running then<br /> player.dx=0<br /> player.sliding=false<br /> end<br /> end</p> <p>player.x+=player.dx<br /> player.y+=player.dy</p> <p>--limit player to map<br /> if player.x&lt;map_start then<br /> player.x=map_start<br /> end<br /> if player.x&gt;map_end-player.w then<br /> player.x=map_end-player.w<br /> end<br /> end</p> <p>function player_animate()<br /> if player.jumping then<br /> player.sp=7<br /> elseif player.falling then<br /> player.sp=8<br /> elseif player.sliding then<br /> player.sp=9<br /> elseif player.running then<br /> if time()-player.anim&gt;.07 then<br /> player.anim=time()<br /> player.sp+=1<br /> if player.sp&gt;6 then<br /> player.sp=3<br /> end<br /> end<br /> else --player idle<br /> if time()-player.anim&gt;.3 then<br /> player.anim=time()<br /> player.sp+=1<br /> if player.sp&gt;2 then<br /> player.sp=1<br /> end<br /> end<br /> end<br /> end</p> <p>function limit_speed(num,maximum)<br /> return mid(-maximum,num,maximum)<br /> end</p> <p>--attempting to climb<br /> function player_climbing()<br /> if collide_map(player,&quot;right&quot;,2)<br /> and btn(❎) and btn(⬆️)<br /> then player.y+=500<br /> end<br /> end</p> <p>flag 2 is meant to be climbable walls.<br /> should this not increase my vertical velocity by 5?</p> https://www.lexaloffle.com/bbs/?tid=142662 https://www.lexaloffle.com/bbs/?tid=142662 Mon, 10 Jun 2024 07:22:04 UTC