AtticusFinn [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=44772 Making Pong in Pico 8 <p>Hi everyone,</p> <p>I made a couple of videos on making Pong in Pico 8 if anyone's interested.</p> <p>As I mention in the video I don't consider this to be a tutorial really, since I'm new to Pico 8 and programming as a whole but it'd be great to get some feedback!</p> <p><object width="640" height="400"><param name="movie" value="https://www.youtube.com/v/2kRj1ZHmYCQ&hl=en&fs=1&rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="https://www.youtube.com/v/2kRj1ZHmYCQ&hl=en&fs=1&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="400"></embed></object></p> https://www.lexaloffle.com/bbs/?tid=38656 https://www.lexaloffle.com/bbs/?tid=38656 Fri, 03 Jul 2020 09:36:32 UTC [Help] Powerup Code <p>Hi everyone, I'm fairly new to programming and Pico8.</p> <p>I'm trying to add powerups to one of my games. I've made an empty table and a function to create each powerup within it.<br /> The problem I'm having is that I'd like one single random powerup to be created depending on the score (say when score==5)</p> <p>I've managed to do this but the problem was that a second powerup gets created before the player has the chance to up the score.<br /> I've tried to use time() and also creating a boolean but I haven't managed to get 1 single powerup on screen at a time, I either get more than one or nothing.</p> <p>What would be the best way to do this?</p> <p>here's the code I have at the moment:</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>function _init() score=0 powerups={} end function _update() if score==5 then powerup=true end if powerup==true then create_powerup() end end function _draw() for capsule in all(powerups) do spr(capsule.sp,capsule.x,capsule.y) end end --powerups powerups_start=5 total_powerups=4 fall=1 function create_powerup() capsule={ sp=powerups_start+flr(rnd(total_powerups)), x=flr(rnd(100)+20), y=flr(rnd(10))+20 } add(powerups,capsule) powerup=false if powerup==false then del(powerups,capsule) end end function update_powerup() for capsule in all(powerups) do capsule.y+=fall if capsule.x&gt;=player.x and capsule.x&lt;=player.x+player.w and capsule.y==player.y-player.h then sfx(2) lives.left+=1 del(powerups,capsule) end if capsule.y&gt;128 then del(powerups,capsule) end end end </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Thanks in advance!</p> https://www.lexaloffle.com/bbs/?tid=38574 https://www.lexaloffle.com/bbs/?tid=38574 Fri, 26 Jun 2020 17:08:56 UTC