Hi I am currently working on a space game in C++ with SFML. I have a 2D Vector
which is my map. I want to create a random map where there will be randomly positioned and sized Planets in the map [As in example below.].
Planets shouldn't be touching or shouldn't overlap each other.
Right now idea is that I have a Class Planet
that contains its center size_t i, j;
and radius unsigned short r;
and I want to create such random generator of pairs (point in 2D - center and radius of the planet). Either that or if there is completely different approach for this kind of problem I would be happy to hear it.
Note - there can be random number or planets. Doesn't matter if the map is packed or half empty.
This [↓] two touches sholdn't occur.
Aucun commentaire:
Enregistrer un commentaire