I'm trying to record an objects movements with an attached attribute called data-settings
so far I have managed to set up some sort of JSON/Array but I want one of the objects to hold multiple arrays of hashes like so.
{ nPosX: newPX, nPosY: newPY, moves: [{ posX: newPX, posY: newPY, time: 0 }], [{ posX: newPX, posY: newPY, time: 5 }] }
However I'm struggling to add another array to the moves
so I only have this:
{ nPosX: newPX, nPosY: newPY, moves: [{ posX: newPX, posY: newPY, time: 0 }] }
How do I push an array with hashes to moves
?
Thanks