Paul Knight [Lexaloffle Blog Feed] New Release! <p>Yay!</p> <p>Version 0.2.5 released!</p> <p>Thanks Zep!:-)</p> Mon, 29 Aug 2022 06:50:04 UTC 3D interface <p>Hi,</p> <p>I wondered if someone could point me to any good tutorials that will give me some pointers into how to code 3D interfaces please?</p> <p>If anyone remembers the game Frontier (Elite2) (<a href=",310350/">,310350/</a>) then I want to re-create something like the 3D starmap in that game, where you could navigate around different stars in 3d, getting information about the selected stars.</p> <p>Instead of stars, I want to use a similar interface to view and select different projects I am currently managing, where perhaps the size of the &quot;star&quot; or project represented the budget of the project. Its position in the Z axis, might represent the duration of the project etc... and it x and y position on the 3d grid could represent some other parameter.</p> <p>Basically, I'm tired of showing customers information in the form of spreadsheets and powerpoint presentations and would love to &quot;fly&quot; around the projects in real-time! Time to ditch the boring business software we've become so used to!</p> <p>Anyway,any pointers much appreciated. I am a novice coder, so back-to-basics would be good, if possible. I guess it all starts with the maths etc... but I'm keen to learn how to progress from this to something really visual.</p> <p>Many thanks in advanced,</p> <p>All the best,<br /> Paul :-)</p> Tue, 07 Dec 2021 23:23:09 UTC Calculating num of days between 2 dates <p>Hi,</p> <p>Just wondered if anyone knows how I can calculate the number of days between a date assigned to a variable (or 3 variables actually) and the current date please?</p> <p>I have googled around and now know that I can use the following to get the current date in Pico8:</p> <p>year=stat(90)<br /> month=stat(91)<br /> day=stat(92)</p> <p>And if I set up three variables to hold a date in the past e.g.</p> <p>appyear=2018<br /> appmonth=7<br /> appday=13</p> <p>How can I easily work out the number of days between the 2 dates please, or do I need to work up some code to acknowledge the different number of days in various months, and work it out like that? Sounds fiddly!!</p> <p>Any help much appreciated :-)</p> <p>Thank you!<br /> Paul.</p> Sat, 20 Feb 2021 23:47:33 UTC Ultra portable gaming! <p>Hi,</p> <p>Just came across this!</p> <p><a href=""></a></p> <p>Wonder if anyone could ever get PICO8 running on this little machine!</p> <p>Ultimate portability :-)</p> <p>Cheers,<br /> Paul.</p> Thu, 21 Jan 2021 12:31:23 UTC Electro chemical cell <p> <table><tr><td> <a href="/bbs/?pid=84467#p"> <img src="/bbs/thumbs/pico8_niwotihpo-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=84467#p"> Electro chemical cell</a><br><br> by <a href="/bbs/?uid=14711"> Paul Knight</a> <br><br><br> <a href="/bbs/?pid=84467#p"> [Click to Play]</a> </td></tr></table> </p> Thu, 19 Nov 2020 01:13:02 UTC Noob code problem! <p>Hi,</p> <p>I'm pulling together a simple animation that shows some electrochemical concepts.<br /> I've managed to get an &quot;ion&quot; moving around a simple electrochemical cell (anticlockwise flow) using some random movements with some bias to help &quot;push&quot; the ion in the right direction to simulate flow. Its not perfect and there are no doubt much simpler ways to do this, but my coding skills aren't up to it so I've hacked this together - please excuse the mess!</p> <p>Anyway, I am trying to get the white &quot;ion&quot; to turn green when it hits the electrode (aka grey box) and stay green. I'm doing this by checking if the &quot;ion&quot; is within the bounds of the electrode, and also that the electrode is powered up (variable pwr=1). As far as I can see, it should work, but after literally hours trying to figure out why its not working, I'm close to giving up, and thought I'd see if I was missing a really obvious thing - as I say, I'm not a good coder, just muddle by!</p> <p>Any help would be very much appreciated.</p> <p>All the best,<br /> Paul.</p> <p>PS: another problem that I've not fixed is the switching on/off of the power to the electrode. Should be done using a simple btn press, but for some reason this isn't working either. Again, any suggestions much appreciated. Thanks :-)</p> <p> <table><tr><td> <a href="/bbs/?pid=84232#p"> <img src="/bbs/thumbs/pico8_gunukuzibu-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=84232#p"> gunukuzibu</a><br><br> by <a href="/bbs/?uid=14711"> Paul Knight</a> <br><br><br> <a href="/bbs/?pid=84232#p"> [Click to Play]</a> </td></tr></table> </p> Sat, 14 Nov 2020 15:33:21 UTC Running Carts from inside PowerPoint <p>Hi,</p> <p>I am working on a small cart to demonstrate an engineering process for a colleague who wants to spice up a PowerPoint presentation he is giving.</p> <p>Does anyone know if its possible to embed a Cart (in HTML format??) into a PowerPoint presentation so that he can run it from within his presentation?</p> <p>Any help much appreciated.</p> <p>All the best,<br /> Paul :-)</p> <p>PS: Am asking here since I can't test this as I use a Mac and don't have PowerPoint! Thanks :-)</p> Fri, 13 Nov 2020 21:09:41 UTC Slow code - any ideas for speed up <p>Hi,</p> <p>I'm a part time tinkering when it comes to coding - just dabbling now and again, and I wondered if anyone had any ideas on how to speed up the following code please?</p> <p>I want to draw a screen full of random CHR$ characters, but this method is taking approx 13 seconds to run!</p> <p>function _init()<br /> cls(1)<br /> b=1<br /> i=1<br /> end</p> <p>function _update()<br /> i=i+5<br /> print(chr(rnd(128)),i,b,7)<br /> if i&gt;=120 then<br /> b=b+8<br /> i=0<br /> if b&gt;=125 then<br /> stop()<br /> end<br /> end<br /> end</p> <p>Any help would be much appreciated :-)</p> <p>Thank you</p> Wed, 14 Oct 2020 06:57:11 UTC Crabdash <p> <table><tr><td> <a href="/bbs/?pid=59424#p"> <img src="/bbs/thumbs/pico8_dijikehutu-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=59424#p"> Crabdash</a><br><br> by <a href="/bbs/?uid=14711"> Paul Knight</a> <br><br><br> <a href="/bbs/?pid=59424#p"> [Click to Play]</a> </td></tr></table> </p> <p>Very basic!</p> <p>Avoid the crabs and collect the gold to get the highest score.</p> <p>Simple :-)</p> <p>Thanks for looking</p> Wed, 28 Nov 2018 20:02:49 UTC Project Scheduler/Spend profile calculator <p> <table><tr><td> <a href="/bbs/?pid=59273#p"> <img src="/bbs/thumbs/pico59272.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=59273#p"> Project Scheduler/Spend profile calculator 1.0</a><br><br> by <a href="/bbs/?uid=14711"> Paul Knight</a> <br><br><br> <a href="/bbs/?pid=59273#p"> [Click to Play]</a> </td></tr></table> </p> <p>This is very much a work in progress, and is really to try out a few ideas.</p> <p>Basically, it allows you to see the impact on total spends of a project portfolio (fixed to 3 at the moment) at a particular time, if individual projects are moved within the overall scheduling of the projects.</p> <p>To move projects along the timeline, use the up/down cursors to move the orange pointer to the project you want to move, then the left/right arrow keys to move it back and forwards on the timeline.</p> <p>Once the projects have all been scheduled, move the orange pointer up to the &quot;Timeline Zone&quot; and the left/right arrow keys will move the red &quot;timeline now&quot; line along the project schedule. The total cost of the projects at that point will be show at the bottom of the screen, together with the total project cost when all projects have been completed.</p> <p>A spend profile (the rate at which money is spent) is overlaid on the project timelines, and moves in real time as the individual projects are moved.</p> <p>For now, individual projects have a fixed duration (hard coded), and it is assumed that the total cost of each project is spend linearly. I want to add flexible cost rates so for example, a project spend rate can be set to relatively low at the beginning and end of a project, with a higher spend rate in the middle of a project, when the work is really in full swing.</p> <p>Lots more to do including autoscaling of the project spend profile, individual project spend profiles (rather than assume linear spend), on-the-fly changes to individual project parameters e.g. total value, duration etc...</p> <p>Anyway, this cart will likely have very limited appeal to most, but I thought I'd post it anyway!!</p> <p>Thanks for looking,<br /> Paul.</p> Wed, 21 Nov 2018 15:03:30 UTC Radiation Sources <p> <table><tr><td> <a href="/bbs/?pid=50557#p"> <img src="/bbs/thumbs/pico50556.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=50557#p"> Radiation Sources 1.0</a><br><br> by <a href="/bbs/?uid=14711"> Paul Knight</a> <br><br><br> <a href="/bbs/?pid=50557#p"> [Click to Play]</a> </td></tr></table> </p> <p>This is my first posted cartridge.</p> <p>Its just a concept at the moment, to see if a fun game could even be made from it.</p> <p>Basically, you need to collect the sample vials (much better collision detection needed) before you are irradiated by too much radiation.</p> <p>As you move around, you build up a radiation map to help you avoid radiation &quot;hot spots&quot;. </p> <p>There are 3 radiation sources, and you can also mark them up by clicking on them using the mouse when you think you know where they are.</p> <p>Pressing Z actually shows where they are (this would not be enabled if I made a game from it) and X hide the sources again.</p> <p>Anyway, all comments much appreciated :-)</p> <p>Thanks for looking!</p> Sun, 18 Mar 2018 05:49:57 UTC Placed sprites <p> <table><tr><td> <a href="/bbs/?pid=42683#p"> <img src="/bbs/thumbs/pico42682.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=42683#p"> Placed sprites 1.0</a><br><br> by <a href="/bbs/?uid=14711"> Paul Knight</a> <br><br><br> <a href="/bbs/?pid=42683#p"> [Click to Play]</a> </td></tr></table> </p> <p>Hi,</p> <p>I was hoping someone might be able to help me with a 'newbie' question please.</p> <p>I want to be able to move a mouse pointer around, and then when the mouse is clicked, record the x and y position and place a sprite in that position. The next time the mouse button is pressed, a second sprite is displayed at the new mouse position, and then finally, a third upon another mouse button click. Further mouse button clicks will then re-position the first sprite and so on......</p> <p>This should leave 3 sprites on the screen, and record their positions.</p> <p>The current code does this, and displays the x/y position of each sprite. The problem I have is that a single &quot;mouse click&quot; event is hard to make and the code loops round very quickly making discrete sprite positioning difficult.</p> <p>Can anyone please suggest a way to remedy this?</p> <p>Any help would be much appreciated.</p> <p>Kind regards,<br /> Paul :-)</p> Fri, 21 Jul 2017 15:57:56 UTC Strange PGET results! <p>Hi all.</p> <p>A newbie question!</p> <p>I am using the PGET command to read the value of a pixel as you move a point around the screen.</p> <p>The code I have written seems to work fine in the X axis, but the y-axis is offset for some reason.</p> <p>If you move the point over the yellow square from left to right, the PGET command successfully reads the pixel colour value.</p> <p>If you move the point over the yellow square from top to bottom, the PGET command is offset by approx 6 pixels.</p> <p>Strange.</p> <img style="" border=0 src="" width=160 height=205 alt="" /> <p>Am I missing something?</p> <p>Any advice would be very much appreciated.</p> <p>Many thanks</p> <p>Paul :-)</p> <p>PS:</p> <p>Code pasted below.</p> <p>x={}<br /> y={}<br /> x=50<br /> y=50<br /> cls()</p> <p>function _update()<br /> if btn(1) then x=x+1 end<br /> if btn(0) then x=x-1 end<br /> if btn(3) then y=y+1 end<br /> if btn(2) then y=y-1 end<br /> a=pget(x,y)<br /> end</p> <p>function _draw()<br /> rectfill (0,0,124,124,0)<br /> rectfill (50,50,70,70,10)<br /> pset(x,y,7)<br /> print(a)<br /> end </p> Sat, 20 May 2017 10:46:41 UTC Frustrated by coding problem! <p>Hi,</p> <p>I've been dabbling in Pico-8 since yesterday and am loving it so far! However, I have come up against a really frustrating problem and have spent hours trying to figure out why my code doesnt work. I keep getting a<br /> &quot;then&quot; expected near &quot;=&quot; error up, for the line highlighted in the code below. Any ideas of why this isn't working would be very much appreciated!!!</p> <p>All the best,<br /> Paul.</p> <p>player = {}<br /> player.x = 5<br /> player.y = 5<br /> player.sprite = 0<br /> player.speed = 2<br /> crab = {}<br /> crab.x = 50<br /> crab.y = 50<br /> crab.sprite = 9<br /> crab.ran = 1</p> <p>function mover()<br /> player.moving = true<br /> player.sprite += 1<br /> if player.sprite &gt; 4 then<br /> player.sprite = 0<br /> end<br /> end</p> <p>function movel()<br /> player.moving = true<br /> player.sprite -= 1<br /> if player.sprite &lt;4 then<br /> player.sprite = 8<br /> end<br /> end</p> <p>function crabmov()<br /> crab.ran = flr(rnd(2))<br /> if crab.ran = 0 then<strong></strong> &lt;------------------<br /> crab.x -= 1<br /> end<br /> if crab.ran = 1 then<br /> crab.x += 1<br /> end<br /> end</p> <p>function _update()<br /> player.moving = false</p> <p>if btn(0) then<br /> player.x -= player.speed<br /> movel()<br /> end<br /> if btn(1) then<br /> player.x += player.speed<br /> mover()<br /> end<br /> if btn(2) then<br /> player.y -= player.speed<br /> movel()<br /> end<br /> if btn(3) then<br /> player.y += player.speed<br /> mover()<br /> end<br /> if not player.moving then<br /> player.sprite = 0<br /> end</p> <p>-- decide if the crab moves left or right<br /> crabmov()</p> <p>end</p> <p>function _draw()<br /> --cls()<br /> rectfill (0,0,128,128,13)<br /> spr(player.sprite, player.x, player.y)<br /> spr(crab.sprite, crab.x, crab.y)</p> <p>end</p> Fri, 29 Jul 2016 09:05:13 UTC