Hello, basically I am making a program which uses OOP to draw objects onto a canvas and they constantly move, I am making a feature which will save the position variables as the objects move each time and then once a file is outputted it can be read again and the objects can be spawned and moved in the exact same locations.
The problem I have is decided on the best solution as I am new to OOP, I was thinking I could store all the location variables in a separate Type Record and constantly BlockWrite that data, possibly using a dynamic array. But I am having problems with BlockWrite and it is slightly buggy in my prototype scripts as the pointers end up causing read and write errors with the dynamic array.
I was thinking should I carry on trying to use BlockWrite and if so can someone help me with some code which could use dynamic arrays to store data like this. Or should I look into another way of saving such as Object Persistence and keep all variables inside the Object Class? (including the movement ones).
Edit: The problem with the dynamic array is that it wipes the data of the counter variables after calling BlockRead, which tells me how many arrays were made and how many need to be displayed/read, it changes the value to anything, pretty much erases it.