add broken ships

This commit is contained in:
SilicaAndPina 2020-09-09 11:53:46 +12:00
parent a9faaf94e6
commit 63ada3dd33
16 changed files with 330 additions and 16 deletions

View file

@ -29,15 +29,26 @@
instance_list = ds_list_create();
loaded = true;
var hasGeneratedBlackHole = false;
var hasGeneratedBrokenShip = false;
// GENERATION
for(var xx = 0; xx < CHUNK_SIZE*TILE_SIZE; xx+= TILE_SIZE)
{
for(var yy = 0; yy < CHUNK_SIZE*TILE_SIZE; yy+= TILE_SIZE)
{
var rnd = random_range(0,5000);
if(floor(rnd) == 1000)
var rnd = random_range(0,10000);
if(floor(rnd % 10000) == 8103)
{
if(hasGeneratedBrokenShip)
continue;
var inst = instance_create(x+xx,y+yy, obj_broken_ship);
inst.CHUNK_CONTAINED = self.id;
ds_list_add(instance_list, inst);
hasGeneratedBrokenShip = true;
continue;
}
if(floor(rnd % 5000) == 1000)
{
if(hasGeneratedBlackHole)
continue;