I am trying to make a game with a boat with cargo. The idea is that boat arrives at the port with cargo so that the cargo can be transferred to land, and when that's done the boat can go on.
For the beginning of the game the boat needs to "navigate" onto the screen to a certain location from the very left. So in a way that it seems the boat just arrives at the port.
Now the boat is an certain actor and it has a move function which makes it navigating slowly untill it is at a certain location which is being checked with getX();. Now i want the boat to have 8 different cargo "containers" on it, which are being placed onto the boat the further it gets to the certain location. So everytime the boat travels 20 x-coordinates or so, there needs an new cargo object to be spawned.
How can i do this?