Log In  
Follow
ZoeB
Follow

Cart #pico_stacker_v01-1 | 2020-11-19 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
8

I'm kind of making a music sequencer as a hobby at the moment, and using Pico-8 to rapidly prototype it. Version 0.1 is just a very basic drum machine style sequencer.

P#84483 2020-11-19 17:06

Cart #fireant-0 | 2019-07-01 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

Here's a rough remake/demake of Fire Ant. It's my first PICO-8 project.

P#65494 2019-07-01 09:02 ( Edited 2019-07-01 09:03)

Hi!

I hope this is the right place to ask...

So I gather I can make some enemies that have X-Y co-ordinates like this:

enemy = {
    x = 0,
    y = 0
}

enemies = {}

for i=1,5 do
    add(enemies, enemy)
    enemies[i].x = i * 5
    enemies[i].y = i * 10
    print(enemies[1].x)
end

(5 and 10 are arbitrary numbers for testing purposes.)

I believe this would be an array of tables.

I would have thought this would make 5 enemy co-ordinates, like this:

enemies[1].x = 5
enemies[1].y = 10

enemies[2].x = 10
enemies[2].y = 20

...and so on. But it looks like it's overwriting every enemy's co-ordinates with the latest pair each time.

Could someone please tell me what I'm doing wrong?

Cheers!

P#65432 2019-06-27 21:18

Follow Lexaloffle:        
Generated 2020-11-25 05:02 | 0.102s | 4194k | Q:42