Log In  

I'm trying to make a tetris game in pico 8, and the way im doing it is with a 2d array. i can make the array fine, but i have no idea how to draw it on the screen. my array is 10x20, just like a normal tetris board, and the pieces that should be blocks are 1, everything else is 0.
please help me.

P#93503 2021-06-15 02:23 ( Edited 2021-06-15 02:34)

loop over the top TABLE (its a table, not an array. this is more important than it sounds) with

for x=1,#table do

end

then, inside that loop, loop over the inner table with

for y=1,#table[x] do

end

then, draw based on that loop

for x=1,#table do
 for y=1,#table do
  --draw stuff here
  --x*8 y*8 is your positions
 end
end
P#93523 2021-06-15 08:14

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 10:53:16 | 0.005s | Q:13