I don't know if this is a bug or feature, but it seems to me that nested loops do not work.
I attempted to use the following code, debugging the text showed that only one loop occurred:
local x=0 local y=0 while(x<16) do while(y<16) do val=mget(x,y) print(val) y+=1 end x+=1 end |
I don't know if this is intended or a limit of lua, but I was able to work around it with the following code:
local i=0 while(i<256) do local x=i%16 local y=(i-x)/16 val=mget(x,y) print(val) i+=1 end |

Hey.
I really like PICO-8 - it's really helpful to be able to learn a little tool, and stay inside that same tool until I finish a whole game.
However, one of my goals in playing with PICO-8 is to practice Lua.
Is there a way to turn off the PICO-8 specific syntax, so that I don't acquire "bad habits" of using += or whatever?
Thanks!
Johnicholas

I'm not 100% sure this is working correctly but it was a good first try.
-- conway's game of life
-- by ian seyler
maxinit=1400
cls()
for t=1,maxinit do
x=rnd(127)
y=rnd(127)
pset(x,y,15)
end
while(1) do
for y=0,127 do
for x=0,127 do
neigh=0
for tx=-1,1 do
for ty=-1,1 do
if(pget(x+tx,y+ty)==15) then
neigh+=1
end
end
end
if(pget(x,y)==15) then
neigh-=1
if(neigh<2 or neigh>3) then
pset(x,y,0)
end
elseif(pget(x,y)==0) then
if(neigh==3) then
pset(x,y,15)
end
end
end
end
end
|

While studying the jelpi.p8 file I noticed that its using some things that aren't documented in the manual (pico-8.txt) file so I figured I'd post it here.
Missing math function:
sgn(x) returns -1, 0, or 1 based on the sign of the input value, currently passing in 0 returns 1 (maybe a bug)
Missing optional properties:
spr(n, x, y, [w, y, [flip]] the normal draw sprite function can also take the optional flip bool (not documented)
The Argus is watching all, always,. .
(small graphic/sound test)
loving the hard limits of this system,.
except the color limit, can we currently peek/poke to dynamically alter the colors in the 16 ?
I like the limit of 16 palette,. however would rather be able to change these sometimes., all greens or blues,. cycle one, etc.
very cool system otherwise.
So far I found these bugs in the code editor (v0.1.0 on Windows):
- Delete key doesn't work when cursor is at the very beginning of the program (also applies to the command line).
- Copy-pasting adds a blank character at the end of each pasted line.
- Shift-Home and Shift-End don't work properly.
- Saving and reloading the cartridge adds a newline at the end, resulting in lots of blank lines over time.
It may be done but It is not finished.
I am not, I repeat NOT going to continue on this project. Hopefully it works okay.
It contains 2 Nights with 3 Animatronics, 1 of which is not functional.
This is an accurate FNAF clone with some differences in the way you play it. Click things to activate them and watch the cameras to see where the animatronics are. The left vent does not have a light so you have to know when he gets in there. by checking the cameras.
Note this is very buggy.
Despite being made up of almost still images, THE JUMPSCARES STILL STARTLED MY FRIENDS!!! just a warning, I don't want to be sued for heart attacks.
On Night Two you might die out of nowhere this signifies that the second character got you. He doesn't have a jumpscare.
Finally please use this if you want to I give full permission as long as my name is visible in the credits area.
Ask any questions you like I will respond, but I will not continue working on this






2 comments




