The title might not be a good one but I had a hard time thinking of a fifth synonym. The fifth and last prototype includes three additions.
The scrollable game field took the most time. I must have tried at least five different approaches until I finally found one that worked (although not as elegant as some of the things I tried). I first thought that there were some elegant way to do it in OpenGL, and there is probably, but I couldn't find it (or at least couldn't make it work properly). Instead I had to make a new Camera class to handle the scrolling and translations between screen coordinates and field coordinates. The game field is scrolled by dragging the mouse while holding the right mouse button pressed.
You can see the new Camera class above the MagneticSource interface. It is the only major change so nothing too exciting.
The win conditions part was very simple. Basically one wins by having a single transport manage to dock with each landing pad, hence proving that one has created a communication net through which a transport can glide from each pad to all other. The result is that every transport records where it has been.
Building the game field generator was fairly easy but still quite fun. Here is an example of a part of a generated play field.
I scrapped the initial idea of randomly trying to place landing pads one by one while checking that they are far enough apart. The reason was that it would take a lot of trials to get the last pads placed if the initial placements were unlucky (or rather very spread out). Instead I opted for a recursive depth first random placement algorithm. It basically works by starting of by placing a pad at a random sport, then the recursion starts. It select a random angle from the parent and then tries to place a child at the minimum distance from the parent in that direction. If it succeeds then the recursion continues until there are no longer any valid places to place a child. The process is then backed one step to the parent of the child that tried the recursion, that parent tries to place a second child and continue recursing through it. And so it goes on until there are no places left in the game field where a pad can be placed (as the recursion has backed up all the way to the root, trying to place more children along the way without success). That type of recursion is commonly called depth first, hence the name of the algorithm.
This image is an attempt to graphically show the algorithm. The blue dots are landing pads and the black circle around them represents the minimum distance that each landing pad has to have to all other pads. The circles are above all circles that were placed after them, hence the circle in the middle above all other circles was the first that was placed. Then you can see a kind of backbone of circles emanating from that circle, and then shorter branches emerge from the backbone. In the end everything has been covered and no more landing pads can be placed.
I did not try something as elaborate for the mountains, I just randomly placed them as they do not have any restrictions of minimum distance to other mountains (just a short minimum distance to other entities).
The next step will be to start building the actual game. I have a few things on my todo list, but more things will probably pop up.