Log In  
Follow
nef0510

Hello

[ :: Read More :: ]

Cart #52509 | 2018-05-07 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

I've submitted this cartridge to the WIP section because it is not finished, it does not have sound and it starts lagging like crazy after a minute. I would appreciate it if someone could tell me a way to store a table with the bullets and remove them once they are no longer visible. I have tried using the DEL() function, but it just changes a value into nil, which bugs the code.

How are the bullets stored in a table?

This is pretty much the way they are stored:

if btn(4) then
 -- storing the X so it stays there
 add(bullets, player_x)
 -- storing the Y, so it can be changed
 add(bullets, 100)
end

And this is how the table is read:

for i=1, #bullets do
 if i % 2 == 0 then

  -- change the y so that they go up
  bullets[i-1] -= 2

 end
end

So I really need help finding a better way to store them and removing the unnecessary bullets.

P#52510 2018-05-07 16:02 ( Edited 2018-05-07 20:41)

[ :: Read More :: ]

Cart #43482 | 2017-08-20 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1


This is my first thing I've made with Pico-8. Press Z/click to add a circle, and press X to clear.

How it works:

For every time you draw a circle it adds the X and Y of it to a table. Then, in the draw function, all circles in the table are rendered. I thought it was interesting how this rendered the circles so I published it for everyone to see.

P#43483 2017-08-20 10:37 ( Edited 2017-09-03 17:21)