function very_tiny_silly_but_also_hey_WTF_rant()
Could the built-in demo variable names be any less helpful for n00bs? From demos/hello:
for i=1,11 do for j0=0,7 do j = 7-j0 col = 7+j t1 = t + i*4 - j*2 x = cos(t0)*5 y = 38 + j + cos(t1/50)*5 pal(7,col) spr(16+i, 8+i*8 + x, y) end end |
What does j0 mean? jack0ff? What about j for that matter? I see col, which could mean column, but then I would expect row or something similar for a multi-dimension loop. t1? The t-1000 terminator? Bah! Humbug!
There's a ton of greatly helpful advice in the pico zines and in the forums here, but it just strikes me as frustrating to show n00bs the hello world demo and it just purposely uses these incredibly unhelpful variable names. I've always been taught that function names and variable names should be self explanatory as to their purpose for ease of code reading, particularly in an example meant to demonstrate program functionality.
end
Does print() in _update() work?
Hi there! Just purchased PICO-8 and Voxatron last week and I'm trying to recreate some classic pong action as a way of getting familiar with the ins and outs of the scripting environment (this is my first time ever interacting with anything related to Lua). Right now I've got a paddle that responds to up/down keyboard presses and a ball that bounces around the screen and collides with the paddle.
I'm trying to print some debug text at the moment of paddle + ball collision, but my print function appears to be doing nothing.
Here's what my current gameplay looks like:

And here's the code:
(the print function that appears to not be working is in line 53 - i.e. the 3rd line from the bottom)
(unrelated: sure would be nice to have line numbers on code snippets here in the forums!)
As you can see in the gameplay gif, my updatepaddlecollisions() function seems to be working correctly when the ball collides with the paddle except that there should also be a string "paddle collision" that prints at (6, 6) colored green (color 11), but that string never prints! :(
I'm aware of the printh() function but I'd really like to stay within the editor and just have my debug text print directly onto the app screen.
So! Am I crazy or does the print() function not work if it's in _update() or some function that gets called within _update()? Thanks so much! I'm so excited to actually build cooler things with this amazing tool!